/* ===========================================
   PREMIUM ARCHITECT-LEVEL DESIGN SYSTEM
   Enhanced Visual Standards & Sophistication
   =========================================== */

/* ============= ENHANCED CSS VARIABLES ============= */
:root {
    /* Premium Shadow System */
    --shadow-subtle: 0 1px 3px rgba(44, 66, 81, 0.04), 0 1px 2px rgba(44, 66, 81, 0.02);
    --shadow-soft: 0 4px 12px rgba(44, 66, 81, 0.06), 0 2px 4px rgba(44, 66, 81, 0.03);
    --shadow-medium: 0 8px 24px rgba(44, 66, 81, 0.08), 0 4px 8px rgba(44, 66, 81, 0.04);
    --shadow-strong: 0 16px 40px rgba(44, 66, 81, 0.12), 0 8px 16px rgba(44, 66, 81, 0.06);
    --shadow-elevation: 0 24px 56px rgba(44, 66, 81, 0.16), 0 12px 24px rgba(44, 66, 81, 0.08);
    
    /* Case Study Accent Colors - Subtle Sophistication */
    --accent-purplle: #8B7BA8;
    --accent-purplle-light: rgba(139, 123, 168, 0.05);
    --accent-purplle-border: rgba(139, 123, 168, 0.2);
    
    --accent-diamond: #B8926A;
    --accent-diamond-light: rgba(184, 146, 106, 0.05);
    --accent-diamond-border: rgba(184, 146, 106, 0.2);
    
    --accent-sendify: #5B7C8D;
    --accent-sendify-light: rgba(91, 124, 141, 0.05);
    --accent-sendify-border: rgba(91, 124, 141, 0.2);
    
    --accent-star: #A44747;
    --accent-star-light: rgba(164, 71, 71, 0.05);
    --accent-star-border: rgba(164, 71, 71, 0.2);
    
    --accent-posh: #D9896A;
    --accent-posh-light: rgba(217, 137, 106, 0.05);
    --accent-posh-border: rgba(217, 137, 106, 0.2);
    
    /* Default accent (overridden per case) */
    --accent-color: var(--color-olive);
    --accent-light: rgba(107, 142, 78, 0.05);
    --accent-border: rgba(107, 142, 78, 0.2);
    
    /* Enhanced Typography Scale */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */
    --text-5xl: 3rem;        /* 48px */
    
    /* Premium Transitions */
    --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-elegant: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* Vertical Rhythm - Engineered Spacing */
    --section-spacing: 120px;
    --block-spacing: 80px;
    --element-spacing: 40px;
    --micro-spacing: 20px;
}

/* ============= CASE STUDY ACCENT THEMING ============= */
#case-purplle {
    --accent-color: var(--accent-purplle);
    --accent-light: var(--accent-purplle-light);
    --accent-border: var(--accent-purplle-border);
}

#case-diamond {
    --accent-color: var(--accent-diamond);
    --accent-light: var(--accent-diamond-light);
    --accent-border: var(--accent-diamond-border);
}

#case-sendify {
    --accent-color: var(--accent-sendify);
    --accent-light: var(--accent-sendify-light);
    --accent-border: var(--accent-sendify-border);
}

#case-fox {
    --accent-color: var(--accent-star);
    --accent-light: var(--accent-star-light);
    --accent-border: var(--accent-star-border);
}

#case-poshpup {
    --accent-color: var(--accent-posh);
    --accent-light: var(--accent-posh-light);
    --accent-border: var(--accent-posh-border);
}

/* ============= PREMIUM HEADING HIERARCHY ============= */
/* H2 - Section Titles */
.case-section-title,
h2.case-title,
.section-title {
    font-size: var(--text-4xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: none;
    margin-bottom: var(--spacing-xl);
    position: relative;
    padding-bottom: var(--spacing-sm);
}

.case-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
    border-radius: var(--radius-full);
}

/* H3 - Subsection Titles */
h3,
.case-subtitle {
    font-size: var(--text-2xl);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-navy);
    margin-bottom: var(--spacing-md);
}

/* H4 - Component Titles */
h4,
.component-title {
    font-size: var(--text-xl);
    font-weight: 500;
    letter-spacing: 0.005em;
    color: var(--color-navy-light);
    margin-bottom: var(--spacing-sm);
}

/* H5 - Labels & Context */
h5,
.label-title {
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: var(--spacing-xs);
}

/* ============= BRAND LOGO STANDARDIZATION ============= */
.case-logo-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-xs) 0;
}

.case-logo {
    max-height: 48px;
    height: auto;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.7);
    transition: filter var(--transition-smooth);
}

.case-logo:hover {
    filter: grayscale(0%) opacity(1);
}

/* Logo positioning with title */
.case-header {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--element-spacing);
}

.case-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-navy);
}

/* ============= STICKY TABLE OF CONTENTS ============= */
.case-toc-wrapper {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: var(--block-spacing);
    position: relative;
}

.case-toc {
    position: sticky;
    top: 120px;
    align-self: start;
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-soft);
    border-left: 3px solid var(--accent-border);
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.case-toc-title {
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-navy-light);
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--color-beige);
}

.case-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.case-toc-item {
    margin-bottom: var(--spacing-xs);
}

.case-toc-link {
    display: block;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--text-sm);
    color: var(--color-navy-light);
    text-decoration: none;
    border-radius: var(--radius-sm);
    border-left: 2px solid transparent;
    transition: all var(--transition-smooth);
    position: relative;
}

.case-toc-link:hover {
    background: var(--accent-light);
    color: var(--accent-color);
    border-left-color: var(--accent-border);
    padding-left: var(--spacing-md);
}

.case-toc-link.active {
    background: var(--accent-light);
    color: var(--accent-color);
    border-left-color: var(--accent-color);
    font-weight: 600;
    padding-left: var(--spacing-md);
}

/* Mobile TOC - Convert to accordion */
@media (max-width: 968px) {
    .case-toc-wrapper {
        grid-template-columns: 1fr;
    }
    
    .case-toc {
        position: relative;
        top: 0;
        margin-bottom: var(--spacing-lg);
    }
}

/* ============= STYLED CONTENT CONTAINERS ============= */
.styled-container,
.case-challenge,
.case-diagnosis,
.case-solution,
.case-impact {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: var(--element-spacing);
    margin-bottom: var(--element-spacing);
    box-shadow: var(--shadow-soft);
    border-left: 4px solid var(--accent-border);
    position: relative;
}

.styled-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: var(--accent-light);
    border-radius: var(--radius-md);
    pointer-events: none;
}

/* ============= UNIFORM IMPACT TILES SYSTEM ============= */
.impact-grid,
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin: var(--element-spacing) 0;
}

.impact-card,
.kpi-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    box-shadow: var(--shadow-soft);
    border-top: 3px solid var(--accent-color);
    transition: all var(--transition-smooth);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 140px;
}

.impact-card:hover,
.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
    border-top-color: var(--accent-color);
}

.impact-number,
.kpi-value {
    font-size: var(--text-4xl);
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent-color);
    margin-bottom: var(--spacing-xs);
    line-height: 1;
}

.impact-label,
.kpi-label {
    font-size: var(--text-sm);
    color: var(--color-navy-light);
    font-weight: 500;
    line-height: 1.4;
}

.kpi-icon {
    font-size: var(--text-2xl);
    color: var(--accent-color);
    margin-bottom: var(--spacing-sm);
    opacity: 0.8;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .impact-grid,
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* ============= SYSTEM ARCHITECTURE FLOW VISUALIZATION ============= */
.architecture-flow {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin: var(--element-spacing) 0;
    flex-wrap: wrap;
    justify-content: center;
}

.flow-node {
    background: var(--color-white);
    border: 2px solid var(--accent-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    min-width: 160px;
    text-align: center;
    box-shadow: var(--shadow-subtle);
    transition: all var(--transition-smooth);
    position: relative;
}

.flow-node:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
    border-color: var(--accent-color);
    background: var(--accent-light);
}

.flow-node strong {
    display: block;
    font-size: var(--text-lg);
    color: var(--accent-color);
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
}

.flow-node p,
.flow-node small {
    font-size: var(--text-sm);
    color: var(--color-navy-light);
    margin: 0;
}

/* Flow arrow connector */
.flow-arrow {
    font-size: var(--text-2xl);
    color: var(--accent-border);
    font-weight: 300;
}

.flow-arrow::before {
    content: '→';
}

/* Mobile: stack vertically */
@media (max-width: 768px) {
    .architecture-flow {
        flex-direction: column;
    }
    
    .flow-arrow::before {
        content: '↓';
    }
}

/* ============= PREMIUM CHART STYLING ============= */
.performance-chart,
.stress-test-chart {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: var(--element-spacing);
    margin: var(--element-spacing) 0;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-beige);
}

.performance-chart h4,
.stress-test-chart h4 {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    font-size: var(--text-xl);
    color: var(--color-navy);
}

/* Chart canvas container */
canvas {
    max-width: 100%;
    height: auto !important;
}

/* ============= PARTNERSHIP & LOGO DISPLAY ============= */
.partnership-badges,
.platform-logos {
    display: flex;
    align-items: center;
    gap: var(--element-spacing);
    flex-wrap: wrap;
    margin: var(--element-spacing) 0;
}

.partnership-badge {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-soft);
    transition: all var(--transition-smooth);
    flex: 1;
    min-width: 280px;
}

.partnership-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.partner-logo {
    max-height: 48px;
    height: auto;
    width: auto;
    object-fit: contain;
    filter: grayscale(100%);
    transition: filter var(--transition-smooth);
}

.partnership-badge:hover .partner-logo {
    filter: grayscale(0%);
}

/* ============= PUBLICATION HIGHLIGHT CTA ============= */
.publication-highlight {
    background: linear-gradient(135deg, var(--accent-light), var(--color-white));
    border: 2px solid var(--accent-border);
    border-radius: var(--radius-md);
    padding: var(--element-spacing);
    margin: var(--element-spacing) 0;
    box-shadow: var(--shadow-medium);
}

.publication-card {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.publication-card h6 {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--color-navy);
    margin: 0;
}

.publication-card p {
    font-size: var(--text-base);
    color: var(--color-navy-light);
    line-height: 1.6;
}

.publication-card .btn {
    align-self: flex-start;
    background: var(--accent-color);
    color: white;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    box-shadow: var(--shadow-soft);
}

.publication-card .btn:hover {
    background: var(--color-navy);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* ============= GLOBAL POLISH & CONSISTENCY ============= */
section {
    padding: var(--section-spacing) 0;
}

/* Consistent border radius */
.card,
.tile,
.box,
.container {
    border-radius: var(--radius-md);
}

/* Unified animation duration */
* {
    transition-duration: var(--transition-smooth);
}

/* Prevent layout shift */
img,
canvas,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Smooth hover states */
a,
button,
.interactive {
    transition: all var(--transition-smooth);
}

/* ============= RESPONSIVE REFINEMENTS ============= */
@media (max-width: 768px) {
    :root {
        --section-spacing: 80px;
        --block-spacing: 48px;
        --element-spacing: 32px;
    }
    
    .case-logo {
        max-height: 36px;
    }
}
