/* ==============================
   СТРАНИЦА КЕЙСА (cases/solum.html)
   ============================== */

/* HERO кейса */
.case-hero {
    padding: 80px 0 64px;
    background: var(--emerald-deep);
}

.case-hero .section-eyebrow {
    margin-bottom: 24px;
}

.case-hero-title {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(26px, 3.4vw, 42px);
    line-height: 1.18;
    letter-spacing: -0.005em;
    color: var(--cream);
    max-width: none;
    white-space: nowrap;
    margin: 0 0 24px;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.case-subtitle {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(18px, 1.5vw, 22px);
    line-height: 1.5;
    color: var(--text-soft);
    max-width: 700px;
    margin: 0 0 8px;
}

.case-subtitle em {
    font-style: italic;
    color: inherit;
}

.case-divider {
    border: none;
    border-top: 1px solid rgba(180, 92, 63, 0.22);
    margin: 48px 0;
    max-width: 100%;
}

/* Метрики страницы кейса */
.case-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
}

.metric-value {
    font-family: var(--num);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    font-size: 36px;
    color: var(--gold);
    line-height: 1;
    margin-bottom: 12px;
}

.metric-value--text {
    font-size: 24px;
    font-style: italic;
    line-height: 1.2;
}

.metric-label {
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    line-height: 1.4;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

/* БЛОК С ГЛАВНЫМ СКРИНШОТОМ */
.case-hero-image {
    background: var(--emerald-deep);
    padding: 24px 0 80px;
}

/* СЛАЙДШОУ ЭКРАНОВ */
.case-slider {
    width: 100%;
}

.case-slider-viewport {
    position: relative;
    width: 100%;
    /* Родное соотношение скринов Solum — заполняет впритык, без полей */
    aspect-ratio: 1600 / 942;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--emerald-dark);
    box-shadow: 0 24px 70px rgba(120, 82, 55, 0.2);
}

.case-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.case-slide.is-active {
    opacity: 1;
}

/* Стрелки */
.case-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 253, 248, 0.82);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(60, 40, 28, 0.22);
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease, transform 0.3s ease;
    z-index: 3;
}

.case-slider-viewport:hover .case-slider-arrow {
    opacity: 1;
}

.case-slider-arrow:hover {
    background: #ffffff;
}

.case-slider-arrow svg {
    width: 22px;
    height: 22px;
}

.case-slider-arrow--prev { left: 18px; }
.case-slider-arrow--next { right: 18px; }

/* Точки */
.case-slider-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
}

.case-slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: var(--text-mute);
    opacity: 0.35;
    cursor: pointer;
    transition: opacity 0.3s ease, width 0.3s ease, background 0.3s ease;
}

.case-slider-dot.is-active {
    opacity: 1;
    width: 24px;
    border-radius: 5px;
    background: var(--gold);
}

/* Картинка слайда поверх заглушки */
.case-slide-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    z-index: 1;
}

/* Заглушка на месте будущего скриншота (пока его нет — красиво пусто) */
.case-ph {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    text-align: center;
    background:
        radial-gradient(120% 120% at 50% 0%, rgba(158, 98, 71, 0.06), transparent 60%),
        var(--emerald-dark);
}

.case-ph-mark {
    font-size: 22px;
    color: var(--gold);
    opacity: 0.7;
}

.case-ph-text {
    font-family: var(--serif);
    font-style: italic;
    font-size: 17px;
    line-height: 1.4;
    color: var(--text-mute);
    max-width: 80%;
}

/* В галерее кадр — контейнер для заглушки, картинка ложится сверху */
.case-shot-frame {
    position: relative;
}

.case-shot-frame img {
    position: relative;
    z-index: 1;
}

/* РАЗБОР КЕЙСА */
.case-section {
    background: var(--emerald-deep);
    padding: 72px 0;
}

.case-section--gallery {
    background: var(--emerald-dark);
}

/* Лид-абзац */
.case-lead {
    max-width: 760px;
    margin-bottom: 56px;
}

.case-lead .section-eyebrow {
    margin-bottom: 18px;
}

.case-lead-text {
    font-family: var(--serif);
    font-size: clamp(20px, 1.8vw, 26px);
    line-height: 1.5;
    color: var(--cream);
    letter-spacing: -0.005em;
}

/* Было / Стало */
.case-beforeafter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.case-col {
    padding: 32px 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
}

.case-col-title {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin-bottom: 22px;
}

.case-col-title--good {
    color: var(--gold);
}

.case-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.case-list li {
    position: relative;
    padding-left: 26px;
    color: var(--text-soft);
    font-size: 15.5px;
    line-height: 1.55;
}

/* Маркер «было» — тонкое тире */
.case-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 11px;
    width: 12px;
    height: 1.5px;
    background: var(--text-mute);
    opacity: 0.6;
}

/* Маркер «стало» — галочка */
.case-list--good li::before {
    content: '';
    top: 5px;
    left: 2px;
    width: 7px;
    height: 12px;
    background: none;
    border: solid var(--gold);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 1;
}

/* Заголовок секции галереи */
.case-section-head {
    margin-bottom: 44px;
}

.case-section-head .section-eyebrow {
    margin-bottom: 14px;
}

.case-section-title {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(26px, 2.6vw, 38px);
    color: var(--cream);
    letter-spacing: -0.01em;
}

/* Галерея экранов */
.case-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px 36px;
}

.case-shot {
    margin: 0;
}

.case-shot-frame {
    border-radius: var(--radius-card);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    aspect-ratio: 1600 / 942;
    background: var(--emerald-deep);
    transition: transform 0.45s ease, box-shadow 0.45s ease;
}

.case-shot-frame:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lift);
}

.case-shot-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.case-shot figcaption {
    margin-top: 18px;
    color: var(--text-soft);
    font-size: 14.5px;
    line-height: 1.6;
    max-width: 90%;
}

/* Hero-видео кейса: калькулятор в работе (без звука, зациклено) */
.case-hero-video {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 24px 70px rgba(120, 82, 55, 0.2);
    background: var(--emerald-dark);
    line-height: 0;
}

.case-hero-video video {
    width: 100%;
    height: auto;
    display: block;
}

/* Видеообзор — адаптивный YouTube 16:9 */
.case-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-card);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 24px 70px rgba(120, 82, 55, 0.2);
    background: #000;
}

.case-video iframe,
.case-video video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    object-fit: cover;
}

/* CTA внизу кейса */
.case-cta {
    background: var(--emerald-deep);
    padding: 20px 0 100px;
}

.case-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

/* Адаптив страницы кейса */
@media (max-width: 1023px) {
    .case-hero {
        padding: 48px 0 40px;
    }

    /* На узких экранах заголовок кейса снова переносится */
    .case-hero-title {
        white-space: normal;
    }

    .case-divider {
        margin: 32px 0;
    }

    .case-metrics {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .case-hero-image {
        padding-bottom: 60px;
    }

    .case-section {
        padding: 56px 0;
    }

    .case-beforeafter,
    .case-gallery {
        grid-template-columns: 1fr;
    }

    .case-gallery {
        gap: 32px;
    }

    .case-shot figcaption {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .case-hero {
        padding: 32px 0 32px;
    }

    .case-hero-title {
        font-size: clamp(22px, 6vw, 30px);
    }

    .metric-value {
        font-size: 30px;
    }

    .metric-value--text {
        font-size: 20px;
    }
}

/* Кнопка живого демо в шапке кейса */
.case-demo-cta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 28px;
}

/* ==============================
   ЖИВОЕ ДЕМО — панель с предпросмотром в рамке-«браузере»
   ============================== */
.demo-panel {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 48px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    padding: 48px;
}

.demo-panel-title {
    font-family: var(--serif);
    font-size: clamp(28px, 3.2vw, 38px);
    font-weight: 600;
    color: var(--cream);
    line-height: 1.12;
    margin: 14px 0 12px;
}

.demo-panel-title em {
    color: var(--gold);
}

.demo-panel-text {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    margin: 0;
}

.demo-panel-list {
    list-style: none;
    margin: 20px 0 28px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.demo-panel-list li {
    position: relative;
    padding-left: 24px;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--text-soft);
}

.demo-panel-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.68em;
    width: 13px;
    height: 1px;
    background: var(--gold);
}

.demo-panel-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.demo-panel-hint {
    font-size: 13px;
    color: var(--text-mute);
}

/* Рамка-«браузер» с живым предпросмотром */
.demo-browser {
    display: block;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: #f7f5f0;
    box-shadow: var(--shadow-lift);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.demo-browser:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.demo-browser:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

.demo-browser-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--emerald-dark);
    border-bottom: 1px solid var(--border);
}

.demo-browser-dots {
    display: flex;
    gap: 6px;
}

.demo-browser-dots i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(70, 54, 40, 0.18);
}

.demo-browser-url {
    font-size: 12px;
    letter-spacing: 0.05em;
    color: var(--text-mute);
}

.demo-browser-view {
    position: relative;
    display: block;
    height: 400px;
    overflow: hidden;
}

.demo-browser-view iframe {
    width: 1280px;
    height: 910px;
    border: 0;
    display: block;
    transform: scale(0.44);
    transform-origin: 0 0;
    pointer-events: none;
}

.demo-browser-live {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border-radius: 999px;
    background: rgba(44, 35, 24, 0.86);
    color: var(--emerald-deep);
    font-size: 12px;
    letter-spacing: 0.02em;
}

.demo-browser-live i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #97b57f;
    animation: demo-live-pulse 2s ease-in-out infinite;
}

@keyframes demo-live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
    .demo-browser-live i { animation: none; }
    .demo-browser, .demo-browser:hover { transform: none; transition: none; }
}

@media (max-width: 1023px) {
    .demo-panel {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 32px;
    }
    .demo-browser-view { height: 340px; }
    .demo-browser-view iframe { transform: scale(0.38); height: 895px; }
}

@media (max-width: 500px) {
    .demo-panel { padding: 22px; }
    .demo-browser-view { height: 250px; }
    .demo-browser-view iframe { transform: scale(0.24); height: 1042px; }
}
