/* Modern Portfolio Theme */

:root {
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --border-color: rgba(17, 24, 39, 0.12);
    --accent-color: #0f0f0f;
    --accent-color-strong: #4b5563;
    --accent-soft: rgba(17, 17, 17, 0.08);
    --accent-gradient: linear-gradient(135deg, #0f0f0f 0%, #1f1f1f 45%, #6b7280 100%);
    --shadow-soft: 0 32px 60px rgba(15, 23, 42, 0.1);
    --radius-large: 28px;
    --primary-color: #1f1f1f;
    --gradient-primary: linear-gradient(135deg, #0f0f0f 0%, #1f1f1f 40%, #6b7280 100%);
    --gradient-hero: radial-gradient(circle at 20% 20%, rgba(17, 17, 17, 0.16), transparent 55%), radial-gradient(circle at 80% 10%, rgba(75, 85, 99, 0.12), transparent 60%), linear-gradient(180deg, #f9fafb 0%, #ffffff 100%);
    --shadow-xl: 0 32px 64px rgba(17, 24, 39, 0.18);
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: none;
    scrollbar-gutter: stable both-edges;
    overflow-y: scroll;
}

html::-webkit-scrollbar {
    width: 0;
    height: 0;
}

html.scrolling {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
}

html.scrolling::-webkit-scrollbar {
    width: 6px;
}

html.scrolling::-webkit-scrollbar-track {
    background: transparent;
}

html.scrolling::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 999px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(180deg, rgba(17, 17, 17, 0.04) 0%, rgba(55, 65, 81, 0.03) 30%, #f9fafb 100%);
    overflow-x: hidden;
}

/* Skip Navigation */
.skip-nav {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
}

.skip-nav:focus {
    top: 0;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.navbar.scrolled {
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
    background-color: rgba(248, 250, 252, 0.95);
}

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

.nav-logo {
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.6px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    color: transparent;
    background-clip: text;
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--accent-color);
}

.nav-link:focus-visible {
    outline: 2px solid rgba(17, 24, 39, 0.28);
    outline-offset: 4px;
}

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

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7rem 2rem 5rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle at center, rgba(17, 17, 17, 0.18) 0%, rgba(17, 17, 17, 0) 65%);
    top: -160px;
    right: -120px;
    filter: blur(0);
    opacity: 0.55;
    z-index: -2;
}

.hero::after {
    content: "";
    position: absolute;
    width: 540px;
    height: 540px;
    background: radial-gradient(circle at center, rgba(107, 114, 128, 0.25) 0%, rgba(107, 114, 128, 0) 70%);
    bottom: -220px;
    left: -140px;
    opacity: 0.6;
    z-index: -2;
}

.hero-content {
    max-width: 820px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-greeting {
    font-size: 0.95rem;
    color: var(--accent-color-strong);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    position: relative;
    display: block;
}

.hero-greeting-placeholder,
.hero-greeting-typing {
    display: block;
    white-space: nowrap;
}

.hero-greeting-placeholder {
    visibility: hidden;
}

.hero-greeting-typing {
    position: absolute;
    inset: 0;
}

.hero-name {
    font-size: 3.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -1px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-title {
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 3rem;
    padding: 1.75rem 2.5rem;
    border-radius: var(--radius-large);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

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

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.btn {
    padding: 0.85rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:focus-visible {
    outline: 2px solid rgba(17, 24, 39, 0.3);
    outline-offset: 4px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    box-shadow: 0 22px 40px rgba(17, 24, 39, 0.18);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 28px 48px rgba(17, 24, 39, 0.24);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-primary);
    border-color: rgba(17, 24, 39, 0.18);
    box-shadow: 0 18px 30px rgba(17, 24, 39, 0.12);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 24px 40px rgba(55, 65, 81, 0.2);
}

.hero-links {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
}

.social-link {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--accent-soft);
    color: var(--accent-color);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
    box-shadow: 0 14px 28px rgba(17, 24, 39, 0.12);
    overflow: hidden;
}

.social-link::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.social-link svg {
    width: 22px;
    height: 22px;
    position: relative;
    z-index: 1;
    transition: transform 0.25s ease;
}

.social-link:hover,
.social-link:focus-visible {
    transform: translateY(-3px);
    color: #ffffff;
    box-shadow: 0 18px 36px rgba(17, 24, 39, 0.18);
}

.social-link:hover::before,
.social-link:focus-visible::before {
    opacity: 1;
}

.social-link:hover svg,
.social-link:focus-visible svg {
    transform: scale(1.05);
}

.social-link:focus-visible {
    outline: 2px solid rgba(17, 24, 39, 0.28);
    outline-offset: 3px;
}

/* Container */
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 2.5rem;
    position: relative;
}

/* Sections */
section {
    padding: 5.5rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    position: relative;
}

section:nth-of-type(even)::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.65) 0%, rgba(248, 250, 252, 0.85) 100%);
    opacity: 0.5;
    z-index: -1;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 3rem;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.section-title::after {
    content: "";
    width: 64px;
    height: 4px;
    border-radius: 999px;
    background: var(--accent-gradient);
    opacity: 0.9;
}

/* About Section */
.about-content {
    max-width: 700px;
    margin: 0 auto;
}

.about-text {
    margin-bottom: 3rem;
}

.about-text .lead {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.about-text p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.highlight-card {
    --accent: #0f172a;
    --accent-soft: rgba(15, 23, 42, 0.12);
    text-align: center;
    padding: 2.25rem 1.75rem;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(245, 247, 250, 0.98) 100%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.highlight-card.accent-indigo {
    --accent: #4338ca;
    --accent-soft: rgba(99, 102, 241, 0.25);
}

.highlight-card.accent-cyan {
    --accent: #0f766e;
    --accent-soft: rgba(45, 212, 191, 0.25);
}

.highlight-card.accent-amber {
    --accent: #b45309;
    --accent-soft: rgba(251, 191, 36, 0.3);
}

.highlight-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(243, 244, 246, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 0 0 1px var(--accent-soft), 0 10px 18px rgba(15, 23, 42, 0.12);
    color: var(--accent);
}

.highlight-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
    filter: grayscale(1) brightness(0);
}

.highlight-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.highlight-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Experience Section */
.experience-list {
    max-width: 700px;
    margin: 0 auto;
}

.experience-item {
    margin-bottom: 2.5rem;
    padding: 2.5rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 100%);
    box-shadow: 0 28px 58px rgba(100, 116, 139, 0.16);
}

.experience-item:last-child {
    margin-bottom: 0;
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.exp-role {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.exp-company {
    display: block;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.exp-period {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 600;
    white-space: nowrap;
}

.exp-highlights {
    list-style: none;
    padding-left: 0;
}

.exp-highlights li {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding-left: 0;
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
}

.exp-highlights li:before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent-gradient);
    box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.1);
    margin-top: calc(0.45rem + 5px);
    flex-shrink: 0;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.skill-category h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    position: relative;
}

.skill-category h3::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    border-radius: 999px;
    background: var(--accent-gradient);
}

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

.skill-bubble {
    padding: 0.55rem 1.1rem;
    font-size: 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.95));
    box-shadow: 0 14px 24px rgba(148, 163, 184, 0.18);
    color: var(--text-secondary);
}

/* Contact Section */
.contact {
    border-bottom: none;
}

.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.contact-icons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.contact-icon {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--accent-soft);
    color: var(--accent-color);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
    box-shadow: 0 18px 36px rgba(17, 24, 39, 0.16);
    overflow: hidden;
    padding: 0;
}

.contact-icon::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.contact-icon svg {
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 1;
    transition: transform 0.25s ease;
}

.contact-icon:hover,
.contact-icon:focus-visible {
    transform: translateY(-3px);
    color: #ffffff;
    box-shadow: 0 22px 38px rgba(17, 24, 39, 0.22);
}

.contact-icon:hover::before,
.contact-icon:focus-visible::before {
    opacity: 1;
}

.contact-icon:hover svg,
.contact-icon:focus-visible svg {
    transform: scale(1.08);
}

.contact-icon:focus-visible {
    outline: 2px solid rgba(17, 24, 39, 0.3);
    outline-offset: 3px;
}

/* Footer */
.footer {
    padding: 2.5rem 0;
    text-align: center;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(248, 250, 252, 0.75);
    backdrop-filter: blur(14px);
}

.footer-content p {
    color: #64748b;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        position: relative;
        padding: 0.85rem 1.5rem;
    }

    .hero-name {
        font-size: 2.5rem;
    }

    .hero-title {
        font-size: 1.25rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .highlight-card {
        padding: 2rem 1.5rem;
    }

    .experience-item {
        padding: 2rem;
    }

    .contact-icons {
        flex-wrap: wrap;
    }

    .contact-icon {
        width: 48px;
        height: 48px;
    }

    .nav-menu {
        position: absolute;
        top: calc(100% + 0.75rem);
        right: 1rem;
        flex-direction: column;
        gap: 0.35rem;
        width: min(85vw, 280px);
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid rgba(148, 163, 184, 0.4);
        border-radius: 18px;
        text-align: left;
        padding: 0.75rem;
        box-shadow: 0 22px 48px rgba(15, 23, 42, 0.18);
        opacity: 0;
        transform: translateY(-10px) scale(0.96);
        pointer-events: none;
        transition: opacity 0.25s ease, transform 0.25s ease;
        z-index: 1000;
    }

    .nav-menu.active {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 0.65rem 0.85rem;
        border-radius: 12px;
        background: transparent;
    }

    .nav-link:hover,
    .nav-link:focus-visible,
    .nav-link.active {
        background: rgba(99, 102, 241, 0.08);
        color: var(--accent-color);
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .exp-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .exp-period {
        white-space: normal;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .container {
        padding: 0 1.5rem;
    }

    section {
        padding: 3rem 0;
    }
}

@media (max-width: 480px) {
    .hero-name {
        font-size: 2rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

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

/* Case Studies Section */
.case-studies {
    background: transparent;
    padding: 6rem 0;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: -1rem;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.case-studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.case-study-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 100%);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 24px;
    padding: 2.25rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 32px 60px rgba(100, 116, 139, 0.16);
    position: relative;
    overflow: hidden;
}

.case-study-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(17, 24, 39, 0.12), transparent 60%);
    pointer-events: none;
}

.case-study-card > * {
    position: relative;
    z-index: 1;
}

.case-study-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.case-study-icon {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    border-radius: 16px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.12);
}

.case-study-icon svg {
    width: 20px;
    height: 20px;
    color: currentColor;
}

.case-study-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.case-study-company {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.case-study-type {
    font-size: 0.78rem;
    color: var(--accent-color);
    background: var(--accent-soft);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-weight: 600;
}

.case-study-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.3;
    color: var(--text-primary);
}

.case-study-excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.case-study-metrics {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    margin-bottom: 1.5rem;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.case-study-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s ease;
}

.case-study-link .arrow-icon {
    display: inline-flex;
    transition: transform 0.2s ease;
}

.case-study-link:hover {
    color: var(--accent-color-strong);
}

.case-study-link:hover .arrow-icon {
    transform: translateX(4px);
}

/* Case Study Detail Page */
.case-study-detail {
    padding: 80px 0 4rem;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.85) 0%, rgba(255, 255, 255, 1) 35%);
}

.case-study-back-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 1rem clamp(1rem, 5vw, 2.5rem) 0;
}

.case-study-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.case-study-back:hover {
    color: var(--text-primary);
}

.case-study-back svg {
    width: 20px;
    height: 20px;
}

.case-study-content {
    max-width: 820px;
    margin: 0 auto;
    padding: clamp(1.5rem, 3vw, 3rem) clamp(1.25rem, 4vw, 3rem);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
    border-radius: 32px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.12);
}

.case-study-hero {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.case-study-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.breadcrumb-separator {
    color: var(--border-color);
}

.case-study-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.case-study-summary {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.case-study-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 24px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.85rem 1rem;
    border-radius: 18px;
    background: var(--bg-primary);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

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

.meta-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.4;
}

.meta-label::after {
    content: none;
}

.case-study-body {
    line-height: 1.8;
    font-size: 1.05rem;
}

.case-study-section {
    margin-bottom: 1.85rem;
    padding: 0;
    border: none;
    position: relative;
}

.case-study-section::before {
    content: none;
}

.case-study-section h2 {
    font-size: 1.65rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
    margin-top: 1.85rem;
    color: var(--text-primary);
    line-height: 1.25;
}

.case-study-section:first-of-type h2 {
    margin-top: 1.25rem;
}

.case-study-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.case-study-section h4 {
    font-size: 1.02rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
    margin-top: 0.85rem;
    color: var(--text-primary);
}

.case-study-section p {
    color: var(--text-secondary);
    margin-bottom: 1.1rem;
    line-height: 1.75;
}

.case-study-section ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1.25rem;
}

.case-study-section ul li {
    padding-left: 1.75rem;
    margin-bottom: 0.5rem;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.7;
}

.case-study-section ul li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--text-primary);
    font-weight: 600;
}

.problem-list li::before {
    content: "•";
}

.solution-subsection,
.implementation-phase {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
    border-left: 3px solid var(--border-color);
}

.solution-subsection h3,
.implementation-phase h3 {
    margin-top: 0;
}

.results-section {
    margin: 1.5rem 0;
    padding: 0;
}

.results-category {
    padding: 1.25rem 0;
    border-top: 1px solid rgba(17, 24, 39, 0.12);
}

.results-category:first-of-type {
    border-top: none;
    padding-top: 0;
}

.results-category h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.result-card {
    display: flex;
    gap: 0.95rem;
    align-items: flex-start;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 245, 249, 0.96) 100%);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: 0.93rem;
}

.result-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, rgba(255, 255, 255, 1), rgba(229, 231, 235, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05), 0 6px 16px rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

.result-icon svg {
    width: 20px;
    height: 20px;
}

.result-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: grayscale(1) brightness(0);
}

.result-text {
    flex: 1;
    color: var(--text-secondary);
}

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

.learnings-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.learning-card {
    padding: 0;
    border-left: none;
    padding-left: 1.5rem;
    position: relative;
}

.learning-card::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.learning-icon {
    display: none;
}

.learning-card p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.7;
}

.challenge-card {
    background: transparent;
    padding: 0;
    border-radius: 0;
    margin-bottom: 1.25rem;
    border-left: 3px solid var(--border-color);
    padding-left: 1.5rem;
}

.challenge-card h4 {
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.challenge-card p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
}

/* Related Case Studies */
.related-case-studies {
    background: var(--bg-secondary);
    padding: 4rem 0;
}

.related-studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.related-study-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.related-study-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.related-study-company {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.related-study-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.related-study-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.related-study-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: opacity 0.2s;
}

.related-study-link:hover {
    opacity: 0.6;
}

/* Responsive for Case Studies */
@media (max-width: 768px) {
    .case-studies-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .case-study-title {
        font-size: 1.6rem;
    }

    .case-study-summary {
        font-size: 1rem;
    }

    .case-study-metrics {
        flex-direction: column;
        gap: 1rem;
    }

    .case-study-meta-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .case-study-content {
        padding: 1.25rem 1.25rem 2rem;
        border-radius: 24px;
        box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12);
    }

    .case-study-back-container {
        padding: 0 1.25rem;
    }

    .case-study-body {
        font-size: 1rem;
    }

    .case-study-section h2 {
        font-size: 1.35rem;
    }

    .case-study-section h3 {
        font-size: 1.05rem;
    }

    .meta-item {
        padding: 0.85rem 1rem;
        box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
    }

    .case-study-section ul li {
        padding-left: 1.35rem;
    }

    .learnings-grid,
    .results-grid {
        grid-template-columns: 1fr;
    }

    .related-studies-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .case-study-detail {
        padding-top: 70px;
    }

    .case-study-back-container {
        padding: 0 1rem;
    }

    .case-study-content {
        padding: 1rem 1rem 1.75rem;
        border-radius: 20px;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    }

    .case-study-title {
        font-size: 1.45rem;
    }

    .case-study-section h2 {
        font-size: 1.25rem;
    }

    .case-study-section h3 {
        font-size: 1rem;
    }

    .meta-item {
        padding: 0.75rem 0.85rem;
    }

    .case-study-section ul li {
        padding-left: 1.15rem;
    }

    .result-card {
        padding: 0.85rem;
        gap: 0.75rem;
    }
}
