/* ========================================
   CASE / PORTFOLIO
======================================== */

.case-section {
    padding: 6px 0 32px;
    background: #fbfcfb;
    perspective: 1400px;
}

.case-card,
.values-strip {
    width: min(1440px, calc(100% - 64px));
    margin-inline: auto;
}

.case-card {
    display: block;
    min-height: 1080px;
    overflow: hidden;
    border: 1px solid rgba(35, 40, 54, 0.035);
    border-radius: 31px;
    background:
        radial-gradient(circle at 18% 38%, rgba(123, 92, 255, 0.055), transparent 27rem),
        linear-gradient(115deg, #f8f8fb 0%, #f7f6fa 55%, #edf0ed 100%);
    box-shadow: 0 18px 60px rgba(41, 45, 63, 0.035);
    opacity: 0;
    transform: translateX(70px) rotateY(-7deg) rotateX(1.5deg) scale(.975);
    transform-origin: right center;
    transform-style: preserve-3d;
    will-change: opacity, transform;
    transition: opacity 1.8s cubic-bezier(.25,.1,.25,1), transform 1.8s cubic-bezier(.25,.1,.25,1);
}

.case-card.is-visible {
    opacity: 1;
    transform: translateX(0) rotateY(0) rotateX(0) scale(1);
}

.case-copy {
    position: relative;
    z-index: 3;
    max-width: 1180px;
    margin-inline: auto;
    padding: 56px 64px 34px;
    text-align: center;
}

.case-eyebrow {
    margin-bottom: 17px;
    color: #755cff;
    font-size: 0.68rem;
    font-weight: 700;
}

.case-copy h2 {
    font-family: "Manrope", sans-serif;
    font-size: clamp(2rem, 3vw, 2.8rem);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.case-title-line {
    display: block;
    width: 24px;
    height: 1px;
    margin: 21px auto 24px;
    background: #b5a8ff;
}

.case-intro {
    max-width: 720px;
    margin: 22px auto 0;
    color: #444b58;
    font-size: 0.91rem;
    line-height: 1.7;
}

.case-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    max-width: 1052px;
    margin: 34px auto 0;
    padding: 0 24px;
    list-style: none;
}

.case-results li {
    display: flex;
    align-items: center;
    gap: 17px;
    min-width: 0;
    text-align: left;
}

.case-result-icon {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border-radius: 50%;
    background: #d9f5ee;
}

.case-result-icon svg {
    width: 26px;
    fill: none;
    stroke: #19232b;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.case-results strong,
.case-results small {
    display: block;
}

.case-results strong {
    color: #121722;
    font-size: 0.82rem;
    line-height: 1.3;
    letter-spacing: 0.035em;
}

.case-results .case-result-text {
    font-size: 1rem;
}

.case-results small {
    margin-top: 5px;
    color: #555d69;
    font-size: 0.76rem;
    line-height: 1.45;
}

.case-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 36px;
    margin-top: 32px;
    padding-bottom: 7px;
    border-bottom: 0;
    font-size: 0.78rem;
    font-weight: 700;
    transition: color .25s ease, gap .25s ease, border-color .25s ease;
}

.case-link::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #72e6d0, #7b5cff);
    transform: scaleX(.28);
    transform-origin: left;
    transition: transform .35s cubic-bezier(.2,.8,.2,1);
    content: "";
}

.case-link:hover {
    gap: 44px;
    color: #6848f2;
    text-shadow: 0 5px 18px rgba(104,72,242,.18);
}

.case-link:hover::after {
    transform: scaleX(1);
}

.case-link span {
    transition: transform .25s ease;
}

.case-link:hover span {
    transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
    .dashboard,
    .process-card,
    .case-card,
    .dashboard-mini-chart polyline,
    .hero-button,
    .cta-button,
    .case-link,
    .case-link span {
        transition: none !important;
    }

    .dashboard,
    .process-card,
    .case-card {
        opacity: 1;
        translate: 0 0;
        transform: none;
    }

    .dashboard-mini-chart polyline {
        stroke-dashoffset: 0;
    }
}

.case-showcase {
    position: relative;
    z-index: 1;
    min-height: 700px;
    min-width: 0;
    margin-top: 18px;
    overflow: hidden;
}

.case-showcase::after {
    position: absolute;
    right: -72px;
    bottom: -48px;
    width: 180px;
    height: 420px;
    border-radius: 50%;
    background: linear-gradient(115deg, rgba(30, 73, 42, .4), rgba(76, 117, 67, .08));
    filter: blur(18px);
    pointer-events: none;
    transform: rotate(-11deg);
    content: "";
}

.case-laptop {
    position: absolute;
    right: 50%;
    bottom: 58px;
    width: min(900px, 76%);
    filter: drop-shadow(0 28px 28px rgba(15, 18, 21, 0.22));
    transform: translateX(50%) perspective(1000px) rotateX(var(--laptop-rotate-x, 0deg)) rotateY(var(--laptop-rotate-y, 0deg)) translate3d(var(--laptop-x, 0px), var(--laptop-y, 0px), 0);
    transform-origin: center bottom;
    will-change: transform;
    transition: transform .18s ease-out, filter .3s ease;
}

.case-showcase:hover .case-laptop {
    filter: drop-shadow(0 34px 34px rgba(15,18,21,.27));
}

.case-laptop-screen {
    position: relative;
    overflow: hidden;
    overscroll-behavior-x: none;
    overscroll-behavior-y: auto;
    aspect-ratio: 1.55;
    border: 15px solid #080909;
    border-bottom-width: 19px;
    border-radius: 22px 22px 8px 8px;
    background: #f7f6f2;
}

.case-laptop-screen::before {
    position: absolute;
    top: -10px;
    left: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #2d3031;
    content: "";
}

.case-laptop-screen::after {
    position: absolute;
    z-index: 5;
    top: -45%;
    left: -62%;
    width: 54%;
    height: 190%;
    background: linear-gradient(105deg, transparent, rgba(255,255,255,.035) 35%, rgba(255,255,255,.22) 50%, rgba(255,255,255,.04) 65%, transparent);
    pointer-events: none;
    transform: skewX(-13deg);
    content: "";
    animation: laptop-reflection 6s ease-in-out infinite;
}

.case-site {
    display: block;
    max-width: none;
    border: 0;
    background: #fff;
    overscroll-behavior-x: none;
    overscroll-behavior-y: auto;
    pointer-events: auto;
    touch-action: pan-y;
}

.case-site-desktop {
    width: 1440px;
    height: 1100px;
    zoom: .468;
}

.case-laptop-base {
    width: 112%;
    height: 19px;
    margin-left: -6%;
    border-radius: 2px 2px 45% 45%;
    background: linear-gradient(#dfe0e0, #858989 65%, #d4d5d5);
}

.mock-nav {
    display: flex;
    height: 62px;
    align-items: center;
    padding: 0 28px;
    border-bottom: 1px solid #dddcd8;
    color: #111;
    font-size: 0.48rem;
}

.mock-nav b { line-height: .85; letter-spacing: .06em; }
.mock-nav > span { margin-left: auto; }
.mock-nav i { margin-left: 25px; padding: 8px 13px; border: 1px solid #ae822d; border-radius: 5px; font-style: normal; }

.mock-hero {
    height: 250px;
    padding: 50px 0 0 52px;
    background:
        linear-gradient(90deg, rgba(249,248,244,.98) 0 48%, rgba(249,248,244,.2) 71%),
        linear-gradient(135deg, #e6e3de 0 58%, #555452 59% 64%, #bcbab5 65% 70%, #333 71% 75%, #d9d5cf 76%);
}

.mock-hero h3 { font-size: clamp(1rem, 2vw, 2rem); line-height: 1.08; letter-spacing: -.04em; }
.mock-hero p { width: 250px; margin: 17px 0; color: #3b3b38; font-size: .56rem; line-height: 1.5; }
.mock-hero span, .phone-content > span { display: inline-block; padding: 9px 13px; border-radius: 3px; background: #c79739; color: white; font-size: .48rem; }
.mock-services { display: grid; grid-template-columns: repeat(4, 1fr); padding: 17px 27px; text-align: center; font-size: 1.05rem; }
.mock-services small { display: block; margin-top: 7px; font-size: .43rem; }

.case-phone {
    position: absolute;
    z-index: 3;
    right: calc(50% - 445px);
    bottom: 45px;
    width: 205px;
    height: 455px;
    overflow: hidden;
    border: 8px solid #0a0a0a;
    border-radius: 30px;
    background: #071019;
    color: #fff;
    box-shadow: 0 18px 34px rgba(0, 0, 0, .25), inset 0 0 0 1px #555;
    transform: translate3d(var(--phone-x, 0px), var(--phone-y, 0px), 0) rotate(var(--phone-rotate, 0deg));
    will-change: transform;
    transition: transform .22s ease-out, box-shadow .3s ease;
    overscroll-behavior-x: none;
    overscroll-behavior-y: auto;
    touch-action: pan-y;
}

.case-showcase:hover .case-phone {
    box-shadow: 0 25px 42px rgba(0,0,0,.3), inset 0 0 0 1px #666;
}

@keyframes laptop-reflection {
    0%, 18% { left: -62%; opacity: 0; }
    28% { opacity: .65; }
    48% { left: 125%; opacity: .15; }
    100% { left: 125%; opacity: 0; }
}

.case-phone-speaker { position: absolute; z-index: 3; top: 5px; left: 50%; width: 48px; height: 5px; border-radius: 8px; background: #161819; transform: translateX(-50%); }
.case-site-mobile {
    position: relative;
    z-index: 1;
    width: 390px;
    height: 940px;
    transform: scale(.408);
    transform-origin: top left;
    pointer-events: auto;
    touch-action: auto;
}

.case-before {
    width: min(1040px, calc(100% - 64px));
    margin: 28px auto 32px;
    padding: 42px;
    border: 1px solid rgba(35, 40, 54, .045);
    border-radius: 31px;
    background:
        radial-gradient(circle at 12% 18%, rgba(114, 230, 208, .07), transparent 22rem),
        radial-gradient(circle at 90% 82%, rgba(123, 92, 255, .065), transparent 24rem),
        rgba(248, 248, 251, .72);
    box-shadow: 0 18px 55px rgba(41, 45, 63, .045);
    opacity: 0;
    transform: translateX(-64px) scale(.988);
    transform-origin: left center;
    transition: opacity 1.8s cubic-bezier(.25,.1,.25,1), transform 1.8s cubic-bezier(.25,.1,.25,1);
}

.case-before.is-visible {
    opacity: 1;
    transform: translateX(0) scale(1);
}

@media (min-width: 761px) {
    .case-before {
        margin-bottom: 0;
        padding-bottom: 18px;
    }
}

.case-before-copy {
    margin-bottom: 26px;
    text-align: center;
}

.case-before-eyebrow {
    margin: 0 0 17px;
    color: #6e55dc;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .16em;
}

.case-before h2 {
    margin: 0;
    color: #181b24;
    font-family: "Manrope", sans-serif;
    font-size: clamp(2rem, 3vw, 2.8rem);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -.045em;
}

.case-before h3,
.case-after-heading {
    margin: 26px 0 0;
    color: #181b24;
    font-family: "Manrope", sans-serif;
    font-size: clamp(1.55rem, 2.4vw, 2.05rem);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -.025em;
}

.case-after-heading {
    position: relative;
    z-index: 2;
    margin-top: 32px;
    text-align: center;
}

.case-before-note {
    max-width: 650px;
    margin: 18px auto 0;
    color: #66707a;
    font-size: .78rem;
    line-height: 1.6;
}

.case-preview-hint {
    margin: 0 auto 16px;
    color: #66707a;
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .015em;
    text-align: center;
}

.case-preview-hint-after {
    margin-top: 30px;
    margin-bottom: 0;
}

.case-preview-hint-after + .case-showcase {
    margin-top: 0;
}

.case-preview-hint-after + .case-showcase .case-laptop {
    top: 16px;
    bottom: auto;
}

.case-before-browser {
    overflow: hidden;
    border: 1px solid rgba(35, 40, 54, .09);
    border-radius: 16px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 14px 36px rgba(41, 45, 63, .075);
}

.case-before-browser-bar {
    display: flex;
    height: 48px;
    align-items: center;
    gap: 7px;
    padding: 0 16px;
    border-bottom: 1px solid rgba(26, 31, 42, .1);
    background: rgba(241, 243, 245, .82);
}

.case-before-browser-bar > span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c7cbd0;
}

.case-before-browser-bar > span:first-child { background: #ed7166; }
.case-before-browser-bar > span:nth-child(2) { background: #e8bb56; }
.case-before-browser-bar > span:nth-child(3) { background: #67bd72; }

.case-before-browser-bar div {
    width: min(480px, 60%);
    margin-inline: auto;
    padding: 6px 14px;
    border: 1px solid rgba(26, 31, 42, .08);
    border-radius: 7px;
    background: #fff;
    color: #7a818a;
    font-size: .68rem;
    text-align: center;
}

.case-before-scroll {
    height: 460px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: none;
    overscroll-behavior-y: auto;
    scrollbar-color: #aeb4bb #f1f2f4;
    touch-action: pan-y;
}

.case-before-scroll img {
    display: block;
    width: 100%;
    height: auto;
}
.phone-nav { display: flex; height: 58px; align-items: center; justify-content: space-between; padding: 13px 13px 0; font-size: .48rem; }
.phone-nav b { line-height: .9; letter-spacing: .06em; }
.phone-content { padding: 32px 13px 28px; }
.phone-content h3 { font-size: 1.27rem; line-height: 1.1; letter-spacing: -.04em; }
.phone-content p { margin: 17px 0; color: #d0d4d6; font-size: .53rem; line-height: 1.55; }
.phone-footer { height: 100px; padding: 20px 13px; background: #f4f3ef; color: #101010; font-size: .68rem; font-weight: 700; }

/* ========================================
   VALUES
======================================== */

.values-strip {
    order: 7;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 30px;
    padding: 35px 40px;
    border-radius: 31px;
    background:
        radial-gradient(circle at 8% 50%, rgba(114, 230, 208, .13), transparent 18rem),
        radial-gradient(circle at 88% 55%, rgba(123, 92, 255, .12), transparent 21rem),
        #f7f7fc;
}

.values-strip article {
    display: grid;
    grid-template-columns: 61px 1fr;
    gap: 20px;
    min-width: 0;
    padding: 0 27px;
    border-right: 1px solid rgba(35, 39, 53, .08);
}

.values-strip article:first-child { padding-left: 0; }
.values-strip article:last-child { padding-right: 0; border-right: 0; }
.value-icon { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #e9f9f5, #ece6ff); color: #7656ff; font-size: 1.65rem; }
.value-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.values-strip h3 { margin: 4px 0 14px; font-size: .92rem; }
.values-strip p { color: #505866; font-size: .75rem; line-height: 1.65; }

@media (max-width: 1100px) {
    .case-card { min-height: 1030px; }
    .case-copy { padding: 48px 40px 24px; }
    .case-showcase { min-height: 660px; margin-top: 14px; }
    .case-laptop { width: 84%; }
    .case-phone { right: 4%; width: 185px; height: 415px; }
    .case-site-desktop { zoom: .48; }
    .values-strip { grid-template-columns: repeat(2, 1fr); gap: 30px 0; }
    .values-strip article:nth-child(2) { border-right: 0; }
}

@media (max-width: 680px) {
    .case-card, .values-strip { width: calc(100% - 32px); }
    .case-card { transform: translateX(35px) rotateY(-4deg) scale(.985); }
    .case-card.is-visible { transform: translateX(0) rotateY(0) scale(1); }
    .case-card { min-height: 980px; }
    .case-copy { padding: 38px 24px 20px; }
    .case-results { grid-template-columns: 1fr; gap: 18px; max-width: 390px; margin-inline: auto; }
    .case-showcase { min-height: 420px; margin-top: 18px; }
    .case-laptop { right: 50%; bottom: 48px; width: 96%; }
    .case-site-desktop { zoom: .2; }
    .mock-nav { height: 40px; padding: 0 14px; }
    .mock-nav > span { display: none; }
    .mock-hero { height: 175px; padding: 30px 0 0 25px; }
    .mock-hero p { width: 180px; }
    .case-phone { right: 2%; bottom: 32px; width: 125px; height: 285px; border-width: 5px; border-radius: 20px; }
    .case-site-mobile { transform: scale(.262); }
    .case-before { width: calc(100% - 32px); margin: 20px auto 24px; padding: 28px 16px; border-radius: 24px; }
    .case-after-heading { margin-top: 28px; }
    .case-before-note { margin-top: 16px; }
    .case-before-browser { border-radius: 13px; }
    .case-before-browser-bar { height: 40px; padding-inline: 12px; }
    .case-before-browser-bar div { width: 62%; }
    .case-before-scroll { height: 340px; }
    .phone-nav { height: 41px; padding: 8px 8px 0; }
    .phone-content { padding: 19px 8px 16px; }
    .phone-content h3 { font-size: .82rem; }
    .phone-content p { margin: 10px 0; font-size: .38rem; }
    .phone-content > span { padding: 6px 8px; font-size: .34rem; }
    .phone-footer { height: 62px; padding: 12px 8px; font-size: .48rem; }
    .values-strip { grid-template-columns: 1fr; padding: 31px 24px; }
    .values-strip article, .values-strip article:first-child, .values-strip article:last-child { padding: 0 0 27px; border-right: 0; border-bottom: 1px solid rgba(35, 39, 53, .08); }
    .values-strip article:last-child { padding-bottom: 0; border-bottom: 0; }
}

/* Bakgrundslager och premiumdjup */
.case-section {
    position: relative;
    isolation: isolate;
}

.case-section::before {
    position: absolute;
    z-index: -1;
    top: 15%;
    right: -10%;
    width: 620px;
    height: 620px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(123,92,255,.11), rgba(114,230,208,.035) 45%, transparent 70%);
    filter: blur(25px);
    pointer-events: none;
    content: "";
}

.case-card {
    box-shadow:
        0 14px 32px rgba(41,45,63,.055),
        0 45px 90px rgba(41,45,63,.105),
        inset 0 1px 0 rgba(255,255,255,.9);
}

.values-strip {
    border: 1px solid rgba(255,255,255,.8);
    box-shadow:
        0 12px 28px rgba(54,48,85,.045),
        0 30px 65px rgba(54,48,85,.075),
        inset 0 1px 0 rgba(255,255,255,.9);
}

.value-icon {
    border: 1px solid rgba(255,255,255,.85);
    background: linear-gradient(145deg, #f2fffc, #e8e1ff);
    box-shadow: 0 10px 24px rgba(111,82,224,.13), inset 0 1px 0 #fff;
}

@media (prefers-reduced-motion: reduce) {
    .case-laptop,
    .case-phone {
        transition: none !important;
        transform: none !important;
    }

    .case-laptop-screen::after {
        display: none;
        animation: none !important;
    }
}
