/* Shared layout for case-studies-*.html — matches index.html / case-studies.html marketing theme */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #fbbf24;
    --cyan: #22d3ee;
    --text: #0f172a;
}

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

html {
    background: #030712;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #e2e8f0;
    background: #030712;
    overflow-x: hidden;
    max-width: 100%;
}

.page-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: radial-gradient(circle at top left, rgba(55, 65, 81, 0.35), transparent 40%),
                radial-gradient(circle at 80% 20%, rgba(14, 165, 233, 0.25), transparent 45%),
                #030712;
}

.page-bg::before {
    content: '';
    position: absolute;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35), transparent 70%);
    top: -220px;
    right: -180px;
    filter: blur(60px);
    opacity: 0.7;
}

.page-bg::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.25), transparent 65%);
    bottom: -260px;
    left: -260px;
    filter: blur(80px);
    opacity: 0.6;
}

.page-main {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 2rem;
    padding-top: calc(1rem + env(safe-area-inset-top, 0px));
}

.header-content {
    max-width: 1200px;
    width: 100%;
    min-width: 0;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
    color: var(--accent);
}

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

.nav-links a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--cyan);
}

.nav-links a.nav-current {
    color: var(--accent);
    font-weight: 600;
}

.bart-link {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
    font-weight: 600;
}

.bart-link:hover {
    background: rgba(99, 102, 241, 0.35);
    color: white !important;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-header {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-header-secondary {
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.btn-header-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transform: translateY(-1px);
}

.btn-header-primary {
    background: var(--primary);
    color: white;
    font-weight: 700;
}

.btn-header-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.35rem;
    cursor: pointer;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.97);
    z-index: 9999;
    backdrop-filter: blur(12px);
}

.mobile-menu.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mobile-menu-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.75rem;
    cursor: pointer;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    line-height: 1;
}

.mobile-menu-links {
    list-style: none;
    text-align: center;
}

.mobile-menu-links li {
    margin: 1.25rem 0;
}

.mobile-menu-links a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-size: 1.35rem;
    font-weight: 600;
    transition: color 0.2s;
}

.mobile-menu-links a:hover {
    color: var(--cyan);
}

.mobile-menu-actions {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
    width: min(280px, 85vw);
}

.mobile-menu-actions .btn-header {
    text-align: center;
}

/* Sector page content */
.case-studies-sector {
    padding: calc(80px + 2.5rem) 0 3.5rem;
    padding-bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    box-sizing: border-box;
}

.back-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1.75rem;
}

.back-link,
.hub-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.back-link {
    color: rgba(165, 180, 252, 0.95);
}

.back-link:hover {
    color: var(--accent);
}

.hub-link {
    color: rgba(148, 163, 184, 0.95);
    font-weight: 500;
}

.hub-link:hover {
    color: var(--cyan);
}

.page-title {
    font-size: clamp(2rem, 4.5vw, 2.85rem);
    font-weight: 800;
    color: #f5f6ff;
    text-align: center;
    margin-bottom: 1rem;
    line-height: 1.12;
    text-shadow: 0 14px 40px rgba(15, 23, 42, 0.52);
    letter-spacing: -0.02em;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.page-subtitle {
    font-size: clamp(1rem, 2.2vw, 1.12rem);
    color: rgba(226, 232, 240, 0.82);
    text-align: center;
    margin-bottom: 2.5rem;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.65;
}

.page-subtitle a {
    color: var(--cyan);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.page-subtitle a:hover {
    color: #67e8f9;
}

.case-studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.case-studies-grid > * {
    min-width: 0;
}

.case-study-card {
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.75rem 1.6rem;
    border: 1px solid rgba(139, 92, 246, 0.22);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.case-study-card:hover {
    transform: translateY(-3px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 16px 40px rgba(99, 102, 241, 0.15);
}

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

.case-study-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
    width: 3.25rem;
    height: 3.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.45), rgba(34, 211, 238, 0.2));
}

.case-study-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f5f6ff;
    margin-bottom: 0.35rem;
}

.case-study-institution {
    color: rgba(148, 163, 184, 0.95);
    font-size: 0.92rem;
}

.case-study-description {
    color: rgba(226, 232, 240, 0.88);
    margin-bottom: 1.25rem;
    line-height: 1.7;
    font-size: 0.98rem;
}

.case-study-outcome {
    background: rgba(30, 41, 59, 0.72);
    border-radius: 12px;
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.case-study-outcome h4 {
    color: #f5f6ff;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.case-study-outcome p {
    color: rgba(226, 232, 240, 0.85);
    font-size: 0.95rem;
    line-height: 1.6;
}

.case-study-citation {
    font-size: 0.88rem;
    color: rgba(148, 163, 184, 0.95);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    padding-top: 1rem;
    line-height: 1.55;
}

.case-study-citation strong {
    color: rgba(226, 232, 240, 0.9);
}

.case-study-citation a {
    color: var(--cyan);
    text-decoration: none;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.case-study-citation a:hover {
    text-decoration: underline;
    color: #67e8f9;
}

.footer {
    position: relative;
    z-index: 2;
    background: var(--text);
    color: white;
    padding: 2rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .header {
        padding: 1rem max(1.25rem, env(safe-area-inset-right, 0px)) 1rem max(1.25rem, env(safe-area-inset-left, 0px));
    }

    .nav-links,
    .header-actions {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .container {
        padding: 0 max(1.25rem, env(safe-area-inset-right, 0px)) 0 max(1.25rem, env(safe-area-inset-left, 0px));
    }

    .mobile-menu-close {
        top: max(1.25rem, env(safe-area-inset-top, 0px));
        right: max(1.25rem, env(safe-area-inset-right, 0px));
    }

    .case-study-header {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .case-study-card {
        padding: 1.35rem 1.15rem;
    }

    .footer {
        padding: 2rem max(1rem, env(safe-area-inset-right, 0px)) calc(2rem + env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
    }
}
