/* ============================================================================
   Cases — стили страницы кейсов (cases.html). Отдельный файл,
   чтобы не раздувать style.css главной страницы.
   ========================================================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #060B18;
    --bg-card: #0B1326;
    --bg-card-hover: #101B36;
    --text: #DCE6F5;
    --heading: #FFFFFF;
    --text-muted: #8496B8;
    --accent: #2E9BFF;
    --accent-light: #6FC3FF;
    --gradient: linear-gradient(135deg, #2E9BFF, #6FC3FF);
    --border: rgba(111, 195, 255, 0.2);
    --radius: 24px;
    --radius-sm: 14px;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    overflow-x: clip;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    overflow-x: clip;
}

h1, h2, h3, h4 {
    color: var(--heading);
}

a {
    color: var(--accent-light);
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-accent {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 8px 24px rgba(46, 155, 255, 0.35);
}

.btn-outline {
    background: transparent;
    color: var(--heading);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--accent-light);
    box-shadow: 0 8px 24px rgba(46, 155, 255, 0.2);
}

.btn-full {
    width: 100%;
}

/* ==================== HEADER ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 14px 0;
    background: rgba(18, 10, 34, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(111, 195, 255, 0.08);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--heading);
    letter-spacing: 0.02em;
}

.logo .accent {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.header-nav a {
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.header-nav a:hover {
    color: var(--heading);
}

@media (max-width: 720px) {
    .header-nav a:not(.btn) {
        display: none;
    }

    .header-nav .btn {
        display: none;
    }
}

/* ==================== HERO HUB ==================== */
.hub-hero {
    padding: 140px 0 40px;
}

.hub-eyebrow {
    display: inline-block;
    color: var(--accent-light);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.hub-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 14px;
}

.hub-subtitle {
    color: var(--text-muted);
    max-width: 640px;
    font-size: 1.05rem;
}

.hub-count {
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==================== CARDS GRID ==================== */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 10px 0 80px;
}

.case-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid rgba(111, 195, 255, 0.12);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.case-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 20px 50px rgba(46, 155, 255, 0.18);
}

.case-card-preview {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-card-hover);
}

.case-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.case-card:hover .case-card-preview img {
    transform: scale(1.04);
}

.case-card-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(10, 10, 15, 0.72);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(111, 195, 255, 0.35);
    color: var(--accent-light);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.case-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px 22px 22px;
}

.case-card-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.case-card-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
    flex: 1;
}

.case-card-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.case-card-stat {
    flex: 1;
    background: var(--bg-card-hover);
    border: 1px solid rgba(111, 195, 255, 0.12);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    text-align: center;
}

.case-card-stat-value {
    display: block;
    color: var(--accent-light);
    font-weight: 800;
    font-size: 1rem;
}

.case-card-stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    margin-top: 2px;
}

.case-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--heading);
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.case-card-link svg {
    transition: transform 0.2s ease;
}

.case-card:hover .case-card-link svg {
    transform: translateX(4px);
}

/* ==================== DETAIL PAGE (статья) ==================== */
.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 130px;
    margin-bottom: 28px;
    transition: color 0.2s ease;
}

.detail-back:hover {
    color: var(--heading);
}

.case-article {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 30px;
}

.case-article-head {
    text-align: center;
    padding: 8px 0 12px;
}

.case-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(111, 195, 255, 0.35);
    color: var(--accent-light);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.case-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.case-desc {
    color: var(--text-muted);
    font-size: 1.08rem;
    max-width: 640px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.case-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 22px;
}

.case-meta-sep {
    color: var(--accent);
}

.case-meta-item {
    font-weight: 500;
}

.case-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.case-actions .btn {
    white-space: nowrap;
    padding: 11px 18px;
    font-size: 0.88rem;
    min-height: 0;
}

@media (max-width: 720px) {
    .case-actions {
        gap: 10px;
    }

    .case-actions .btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
}

.case-article-hero {
    margin: 30px 0 44px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(111, 195, 255, 0.15);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.case-article-hero img {
    width: 100%;
    height: auto;
}

.case-lead {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--heading);
    font-weight: 500;
    margin-bottom: 48px;
}

/* ==================== SECTIONS (текст статьи) ==================== */
.case-block {
    margin-bottom: 46px;
}

.case-block-title {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 18px;
}

.case-block-title::before {
    content: '';
    flex-shrink: 0;
    width: 28px;
    height: 4px;
    border-radius: 999px;
    background: var(--gradient);
}

.case-block p {
    color: var(--text);
    font-size: 1.02rem;
    line-height: 1.8;
    margin-bottom: 16px;
}

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

.case-results-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 26px;
}

.case-result-stat {
    flex: 1;
    min-width: 150px;
    background: var(--bg-card);
    border: 1px solid rgba(111, 195, 255, 0.15);
    border-radius: var(--radius-sm);
    padding: 18px;
    text-align: center;
}

.case-result-value {
    display: block;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.6rem;
    font-weight: 800;
}

.case-result-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 4px;
}

.case-review-inner {
    margin: 0;
    padding: 26px 28px;
    background: var(--bg-card);
    border: 1px solid rgba(111, 195, 255, 0.15);
    border-radius: var(--radius-sm);
    position: relative;
}

.case-review-inner::before {
    content: '';
    position: absolute;
    left: 0;
    top: 24px;
    bottom: 24px;
    width: 4px;
    border-radius: 999px;
    background: var(--gradient);
}

.case-review-text {
    font-size: 1.05rem;
    font-style: italic;
}

.case-review-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
}

.case-review-author {
    font-weight: 800;
    color: var(--heading);
}

.case-review-role {
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 720px) {
    .case-review-inner {
        padding: 20px;
    }
}


@media (max-width: 720px) {
    .case-lead {
        font-size: 1.12rem;
    }

    .case-block-title {
        font-size: 1.3rem;
    }
}

/* ==================== PREV / NEXT ==================== */
.case-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding-bottom: 60px;
}

.case-nav a {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid rgba(111, 195, 255, 0.12);
    border-radius: var(--radius);
    padding: 22px 24px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.case-nav a:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.case-nav-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.case-nav-title {
    color: var(--heading);
    font-weight: 700;
    font-size: 1.05rem;
}

.case-nav .case-nav-next {
    text-align: right;
}

@media (max-width: 620px) {
    .case-nav {
        grid-template-columns: 1fr;
    }
}

/* ==================== CTA / FORM ==================== */
.cta-section {
    background: linear-gradient(135deg, rgba(46, 155, 255, 0.14), rgba(111, 195, 255, 0.06));
    border: 1px solid rgba(111, 195, 255, 0.25);
    border-radius: var(--radius);
    padding: 48px 32px;
    margin-bottom: 80px;
    text-align: center;
}

.cta-title {
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
    font-weight: 800;
    margin-bottom: 10px;
}

.cta-text {
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto 28px;
}

.cta-form {
    max-width: 460px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cta-form input {
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(111, 195, 255, 0.2);
    background: var(--bg-card);
    color: var(--heading);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.cta-form input:focus {
    border-color: var(--accent);
}

.cta-form input::placeholder {
    color: var(--text-muted);
}

.cta-privacy {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 4px;
}

.cta-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    cursor: pointer;
}

.cta-consent input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--accent);
    cursor: pointer;
}

.cta-consent a {
    color: var(--accent-light, var(--accent));
    text-decoration: underline;
}

/* ==================== TOAST ==================== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
    pointer-events: none;
    background: var(--bg-card);
    border: 1px solid rgba(46, 155, 255, 0.3);
    border-radius: var(--radius-sm);
    padding: 16px 22px;
    z-index: 2000;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-width: calc(100% - 32px);
    width: max-content;
    box-sizing: border-box;
    text-align: center;
}

.toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast p {
    color: var(--heading);
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.45;
    white-space: normal;
}

/* ==================== FOOTER ==================== */
.footer {
    padding: 30px 0 40px;
    border-top: 1px solid rgba(111, 195, 255, 0.1);
}

.footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--heading);
}

/* ==================== LOADER + ANIMATIONS ==================== */
.cases-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 80px 0;
    color: var(--text-muted);
}

.spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(111, 195, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.fade-up {
    opacity: 1;
    transform: none;
}

/* ==================== SCROLL TOP ==================== */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 900;
    box-shadow: 0 8px 24px rgba(46, 155, 255, 0.35);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    transform: translateY(-4px);
}

@media (prefers-reduced-motion: reduce) {
    .fade-up {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
