/* =====================================================
   Schola Case Study Styles
   ===================================================== */

/* Case Study Hero */
.case-hero {
    min-height: 55vh;
    display: flex;
    align-items: flex-end;
    padding-top: var(--nav-h);
    padding-bottom: 4rem;
    position: relative;
    overflow: hidden;
}
.case-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 15% 80%, rgba(16, 185, 129, 0.09) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 85% 15%, rgba(163, 230, 53, 0.06) 0%, transparent 50%),
        radial-gradient(circle, rgba(0,0,0,0.05) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 28px 28px;
    pointer-events: none;
}
body.dark-mode .case-hero-bg {
    background:
        radial-gradient(ellipse 80% 60% at 15% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 85% 15%, rgba(204, 255, 0, 0.05) 0%, transparent 50%),
        radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 28px 28px;
}

.case-hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 1.5rem;
    transition: color var(--dur) var(--ease);
}
.back-link:hover { color: var(--text); }

.case-hero-content .case-tags {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.case-hero-content h1 {
    font-size: clamp(3rem, 7vw, 5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.0;
    color: var(--text);
    margin-bottom: 1rem;
}

.case-subtitle {
    font-size: 1.125rem;
    color: var(--text-2);
    line-height: 1.68;
    max-width: 560px;
    margin-bottom: 1.5rem;
}

.case-terms-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-3);
    transition: color var(--dur) var(--ease);
}
.case-terms-link:hover { color: var(--text); }

/* Case Section */
.case-section { padding: 5rem 0 7rem; }
.case-container { max-width: 820px; }

/* Overview stats */
.case-overview {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 4rem;
}
.overview-stat {
    display: flex;
    flex-direction: column;
    padding: 0.25rem 3rem 0.25rem 0;
}
.overview-stat:not(:last-child) { padding-right: 3rem; }
.overview-stat strong {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1.1;
}
.overview-stat span {
    font-size: 0.8rem;
    color: var(--text-3);
    font-weight: 500;
    margin-top: 0.2rem;
}
.overview-sep {
    width: 1px;
    height: 36px;
    background: var(--border);
    margin-right: 3rem;
}

/* Body */
.case-body { display: flex; flex-direction: column; gap: 4rem; }

.case-intro h2,
.case-features-grid h2,
.case-why h2 {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text);
    margin-bottom: 1rem;
}
.case-intro p,
.case-why p {
    font-size: 1.0625rem;
    color: var(--text-2);
    line-height: 1.72;
    margin-bottom: 1rem;
}
.case-intro p:last-child,
.case-why p:last-child { margin-bottom: 0; }

/* Feature blocks */
.case-feature {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 1.75rem;
    padding: 2.25rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
}
.case-feature-icon {
    width: 44px; height: 44px;
    border-radius: var(--r-sm);
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    color: var(--acc-text);
    flex-shrink: 0;
}
.case-feature-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #527a00;
    margin-bottom: 0.375rem;
}
body.dark-mode .case-feature-label { color: var(--accent); }

.case-feature h3 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.case-feature > .case-feature-content > p {
    font-size: 0.9375rem;
    color: var(--text-2);
    margin-bottom: 1.25rem;
    line-height: 1.65;
}

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    font-size: 0.9375rem;
    color: var(--text-2);
    line-height: 1.55;
}
.feature-list li svg {
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 0.2rem;
}
body.dark-mode .feature-list li svg { color: #ccff00; }
.feature-list li svg path,
.feature-list li svg polyline { stroke: currentColor; }

/* Key Features grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1.5rem;
}
.feature-chip {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-2);
}
.feature-chip svg { color: var(--text-3); flex-shrink: 0; }

/* Terms page */
.terms-hero {
    padding: calc(var(--nav-h) + 3.5rem) 0 3rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-2);
}
.terms-hero h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    color: var(--text);
    margin-bottom: 0.625rem;
    margin-top: 1.25rem;
}
.terms-hero p {
    font-size: 0.9375rem;
    color: var(--text-3);
}

.terms-body {
    padding: 4rem 0 6rem;
}
.terms-content {
    max-width: 720px;
}
.terms-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 3rem 0 0.875rem;
    padding-left: 1.125rem;
    border-left: 3px solid var(--accent);
}
.terms-content h2:first-of-type { margin-top: 0; }
.terms-content p {
    font-size: 1rem;
    color: var(--text-2);
    line-height: 1.75;
    margin-bottom: 1rem;
}
.terms-content ul {
    padding-left: 1.25rem;
    margin-bottom: 1rem;
}
.terms-content li {
    font-size: 1rem;
    color: var(--text-2);
    line-height: 1.72;
    margin-bottom: 0.375rem;
}

/* Screenshots */
.case-screenshot {
    margin-top: 2rem;
    border-radius: var(--r);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}
.case-screenshot img {
    width: 100%;
    height: auto;
    display: block;
}

.case-feature .case-screenshot {
    grid-column: 1 / -1;
}

@media (min-width: 769px) {
    .case-feature.has-screenshot {
        grid-template-columns: 1fr 1fr;
        align-items: center;
        gap: 3rem;
    }
    .case-feature.has-screenshot .case-screenshot {
        grid-column: auto;
        margin-top: 0;
    }
    .case-feature.has-screenshot.image-left .case-screenshot {
        order: -1;
    }
}

.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.screenshot-item {
    border-radius: var(--r);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.3s var(--ease);
}
.screenshot-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.screenshot-item img {
    width: 100%;
    height: auto;
}

.case-hero-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 2rem;
    border-radius: var(--r-sm);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.case-hero-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive */
@media (max-width: 768px) {
    .case-feature { grid-template-columns: 1fr; gap: 1rem; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .case-overview { gap: 1.5rem; }
    .overview-sep { display: none; }
    .overview-stat { padding-right: 0; }
}
@media (max-width: 480px) {
    .features-grid { grid-template-columns: 1fr; }
}
