/* ============================================
   DEZIGNITE — Case Study Before/After  v2
   css/case-study.css
   ============================================ */

.cs-section {
    padding: 8rem 0;
    background: var(--color-bg-secondary, #0a0a0a);
    position: relative;
    overflow: hidden;
}

.cs-section::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 800px; height: 400px;
    background: radial-gradient(ellipse at center top,
        rgba(176, 152, 120, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

/* ── Header ── */
.cs-header { margin-bottom: 3rem; }
.cs-header .web-section-sub { max-width: 640px; }

/* ── Stats ── */
.cs-stats {
    display: flex;
    margin-bottom: 3rem;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    overflow: hidden;
}

.cs-stat {
    flex: 1;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border-right: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    transition: background 0.3s ease;
}
.cs-stat:last-child { border-right: none; }
.cs-stat:hover { background: rgba(176,152,120,0.04); }

.cs-stat-num {
    font-family: 'Poppins', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #b09878, #d4b896);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.cs-stat-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
    line-height: 1.4;
}

/* ── Browser shell ── */
.cs-browser {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 40px 80px rgba(0,0,0,0.6),
                0 0 0 1px rgba(176,152,120,0.06);
    margin-bottom: 2rem;
}

.cs-browser-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #1a1a1a;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    user-select: none;
}

.cs-dots { display: flex; gap: 6px; flex-shrink: 0; }
.cs-dot  { width: 11px; height: 11px; border-radius: 50%; }
.cs-dot-r { background: #ff5f57; }
.cs-dot-y { background: #febc2e; }
.cs-dot-g { background: #28c840; }

.cs-url-wrap {
    flex: 1;
    background: #111;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 6px;
    padding: 4px 12px;
    text-align: center;
    overflow: hidden;
}
.cs-url {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: rgba(176,152,120,0.75);
    white-space: nowrap;
    transition: color 0.3s ease;
}

.cs-tab-strip {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.cs-tab {
    background: none;
    border: 1px solid transparent;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.35);
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 5px;
    transition: all 0.2s ease;
}
.cs-tab:hover {
    color: rgba(255,255,255,0.75);
    border-color: rgba(255,255,255,0.1);
}

/* ── Viewport ── */
.cs-viewport {
    position: relative;
    height: 520px;           /* fixed visible window */
    overflow: hidden;
    background: #000;
    /* DO NOT set cursor here — let handle set it */
}

/* ── After side — iframe full width, anchored top-left ── */
.cs-after-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}
.cs-after-wrap iframe {
    display: block;
    border: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    /* width / height / transform set by JS */
}

/* ── Before side — clips on the right, image scrolls inside ── */
.cs-before-clip {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 50%;              /* JS controls this */
    overflow: hidden;        /* the clip */
    z-index: 2;
}

.cs-before-inner {
    /* Must be exactly as wide as the viewport so image fills it */
    width: 100vw;            /* overridden inline by JS if needed */
    will-change: transform;
    /* translateY controlled by JS for scrolling */
}

.cs-before-inner img {
    display: block;
    /* Fill the viewport width exactly — this is the key fix */
    width: 100vw;
    height: auto;
    /* No object-fit — let the image be its natural size */
}

/* ── Divider ── */
.cs-divider {
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    width: 2px;
    background: #fff;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(255,255,255,0.25);
}

/* ── Handle ── */
.cs-handle {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11;
    /* cursor set inline by JS to col-resize */
    box-shadow:
        0 0 0 4px rgba(255,255,255,0.2),
        0 8px 24px rgba(0,0,0,0.5);
    transition: box-shadow 0.2s ease, transform 0.1s ease;
}
.cs-handle:hover {
    box-shadow:
        0 0 0 6px rgba(255,255,255,0.25),
        0 12px 32px rgba(0,0,0,0.6);
}
.cs-handle:active {
    transform: translate(-50%, -50%) scale(0.92);
}

/* ── Labels ── */
.cs-lbl {
    position: absolute;
    top: 14px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    color: #fff;
    pointer-events: none;
    z-index: 9;
    font-family: 'Inter', sans-serif;
}
.cs-lbl-b {
    left: 14px;
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.12);
}
.cs-lbl-a {
    right: 14px;
    background: rgba(176,152,120,0.5);
    border: 1px solid rgba(176,152,120,0.3);
}

/* ── Hint ── */
.cs-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 30px;
    padding: 6px 14px;
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    font-family: 'Inter', sans-serif;
    z-index: 12;
    pointer-events: none;
    transition: opacity 0.5s ease;
    white-space: nowrap;
}

/* ── Scrollbar ── */
.cs-scroll-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 16px;
    background: #1a1a1a;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.cs-scroll-track {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.07);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}
.cs-scroll-thumb {
    position: absolute;
    top: 0; left: 0;
    width: 18%;
    height: 100%;
    background: linear-gradient(90deg, #b09878, #686048);
    border-radius: 3px;
    transition: left 0.06s linear;
}
.cs-scroll-hint {
    font-size: 10px;
    color: rgba(255,255,255,0.22);
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}

/* ── Tech tags ── */
.cs-tech-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}
.cs-tech-tag {
    padding: 0.28rem 0.9rem;
    background: rgba(176,152,120,0.06);
    border: 1px solid rgba(176,152,120,0.16);
    border-radius: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: rgba(176,152,120,0.7);
    transition: background 0.25s ease, border-color 0.25s ease;
}
.cs-tech-tag:hover {
    background: rgba(176,152,120,0.12);
    border-color: rgba(176,152,120,0.35);
}

/* ── CTAs ── */
.cs-cta-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.cs-live-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .cs-section { padding: 4rem 0; }
    .cs-viewport { height: 320px; }
    .cs-tab-strip { display: none; }
    .cs-stats { flex-wrap: wrap; }
    .cs-stat { flex: 1 1 50%; border-bottom: 1px solid rgba(255,255,255,0.06); }
    .cs-stat:nth-child(2n) { border-right: none; }
    .cs-cta-row { flex-direction: column; align-items: stretch; }
    .cs-cta-row .btn { justify-content: center; }

    /* On mobile viewport width is narrower — fix inner width */
    .cs-before-inner,
    .cs-before-inner img { width: 100%; }
}

/* ============================================
   case-study.css  — drop into css/
   ============================================ */

.cs-section {
    padding: 8rem 0;
    background: #0a0a0a;
    position: relative;
}

.cs-section::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 900px; height: 400px;
    background: radial-gradient(ellipse at top,
        rgba(176,152,120,.07) 0%, transparent 70%);
    pointer-events: none;
}

/* header */
.cs-header { margin-bottom: 3rem; }
.cs-header .web-section-sub { max-width: 640px; }

/* stats */
.cs-stats {
    display: flex;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 3rem;
}
.cs-stat {
    flex: 1;
    padding: 1.4rem 1.1rem;
    display: flex; flex-direction: column; gap: .35rem;
    border-right: 1px solid rgba(255,255,255,.06);
    background: rgba(255,255,255,.02);
}
.cs-stat:last-child { border-right: none; }
.cs-stat-num {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem; font-weight: 800; line-height: 1;
    background: linear-gradient(135deg, #b09878, #d4b896);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.cs-stat-label { font-size: .73rem; color: rgba(255,255,255,.33); }

/* browser shell */
.cs-browser {
    border-radius: 14px; overflow: hidden;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 40px 80px rgba(0,0,0,.6);
    margin-bottom: 2rem;
}

/* top chrome bar */
.cs-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px;
    background: #1a1a1a;
    border-bottom: 1px solid rgba(255,255,255,.06);
    user-select: none;
}
.cs-dots { display: flex; gap: 6px; }
.cs-dot  { width: 11px; height: 11px; border-radius: 50%; }
.cs-dot-r { background: #ff5f57; }
.cs-dot-y { background: #febc2e; }
.cs-dot-g { background: #28c840; }
.cs-url-pill {
    flex: 1;
    background: #111;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 6px;
    padding: 3px 10px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(176,152,120,.7);
    overflow: hidden; white-space: nowrap;
}
.cs-bar-tabs { display: flex; gap: 4px; flex-shrink: 0; }
.cs-bar-tab {
    background: none;
    border: 1px solid transparent;
    font-family: 'Inter', sans-serif;
    font-size: .73rem; font-weight: 600;
    color: rgba(255,255,255,.3);
    cursor: pointer; padding: 3px 9px; border-radius: 5px;
    transition: all .2s ease;
}
.cs-bar-tab:hover { color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.1); }

/* viewport — the visible window */
.cs-viewport {
    position: relative;
    height: 480px;
    overflow: hidden;
    background: #0a0a0a;
    cursor: default;
}

/* after side — iframe, scaled to fit */
.cs-after {
    position: absolute; inset: 0;
    overflow: hidden; z-index: 1;
}
#cs-ifr-wrap {
    /* sized by JS; translateY on this scrolls the after side */
    overflow: hidden;
    will-change: transform;
}
.cs-after iframe {
    display: block; border: none;
    opacity: 0; transition: opacity .5s ease;
    transform-origin: top left;
    /* width / height / scale set by JS; position stays static */
}

/* before side — image, width:100%, scrolls via scrollTop on this element */
.cs-before {
    position: absolute; top: 0; left: 0; bottom: 0;
    /* width controlled by JS (= pct * viewport width) */
    overflow: hidden; z-index: 2;
    background: #fff;
}
.cs-before-scroll {
    /* same width as viewport, so image fills it */
    position: absolute; top: 0; left: 0;
    width: 100vw;          /* overridden by JS to be viewport px */
    /* translateY controlled by JS */
}
.cs-before-scroll img {
    display: block;
    width: 100%;           /* scale to fit the scroll container */
    height: auto;
}

/* divider line */
.cs-divider {
    position: absolute; top: 0; bottom: 0;
    width: 2px; background: #fff;
    transform: translateX(-50%);
    z-index: 10; pointer-events: none;
}

/* drag handle */
.cs-handle {
    position: absolute; top: 50%;
    transform: translate(-50%, -50%);
    width: 44px; height: 44px; border-radius: 50%;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    z-index: 11; cursor: col-resize; touch-action: none;
    box-shadow: 0 0 0 4px rgba(255,255,255,.2), 0 6px 20px rgba(0,0,0,.5);
}
.cs-handle:active { transform: translate(-50%, -50%) scale(.9); }

/* labels */
.cs-lbl {
    position: absolute; top: 12px;
    font-size: 10px; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    padding: 3px 9px; border-radius: 4px; color: #fff;
    pointer-events: none; z-index: 9; font-family: 'Inter', sans-serif;
}
.cs-lbl-b { left: 12px; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.12); }
.cs-lbl-a { right: 12px; background: rgba(176,152,120,.5); border: 1px solid rgba(176,152,120,.3); }

/* scroll controls below viewport */
.cs-controls {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 14px;
    background: #1a1a1a;
    border-top: 1px solid rgba(255,255,255,.06);
}
.cs-scroll-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; color: rgba(255,255,255,.3);
    white-space: nowrap; flex-shrink: 0;
}
/* native range — styled to match dark theme */
.cs-scroll-range {
    flex: 1; height: 3px; cursor: pointer;
    accent-color: #b09878;
}

/* tech tags + ctas */
.cs-tech-row { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 2.5rem; }
.cs-tech-tag {
    padding: .25rem .85rem;
    background: rgba(176,152,120,.06); border: 1px solid rgba(176,152,120,.16);
    border-radius: 20px; font-family: 'JetBrains Mono', monospace;
    font-size: .7rem; color: rgba(176,152,120,.7);
}
.cs-cta-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* responsive */
@media (max-width: 768px) {
    .cs-section { padding: 4rem 0; }
    .cs-viewport { height: 300px; }
    .cs-bar-tabs { display: none; }
    .cs-stats { flex-wrap: wrap; }
    .cs-stat { flex: 1 1 50%; border-bottom: 1px solid rgba(255,255,255,.06); }
    .cs-stat:nth-child(2n) { border-right: none; }
    .cs-cta-row { flex-direction: column; align-items: stretch; }
    .cs-cta-row .btn { justify-content: center; }
}

/* ============================================
   case-study.css  — drop into css/
   ============================================ */

.cs-section {
    padding: 8rem 0;
    background: #0a0a0a;
    position: relative;
}

.cs-section::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 900px; height: 400px;
    background: radial-gradient(ellipse at top,
        rgba(176,152,120,.07) 0%, transparent 70%);
    pointer-events: none;
}

/* header */
.cs-header { margin-bottom: 3rem; }
.cs-header .web-section-sub { max-width: 640px; }

/* stats */
.cs-stats {
    display: flex;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 3rem;
}
.cs-stat {
    flex: 1;
    padding: 1.4rem 1.1rem;
    display: flex; flex-direction: column; gap: .35rem;
    border-right: 1px solid rgba(255,255,255,.06);
    background: rgba(255,255,255,.02);
}
.cs-stat:last-child { border-right: none; }
.cs-stat-num {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem; font-weight: 800; line-height: 1;
    background: linear-gradient(135deg, #b09878, #d4b896);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.cs-stat-label { font-size: .73rem; color: rgba(255,255,255,.33); }

/* browser shell */
.cs-browser {
    border-radius: 14px; overflow: hidden;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 40px 80px rgba(0,0,0,.6);
    margin-bottom: 2rem;
}

/* top chrome bar */
.cs-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px;
    background: #1a1a1a;
    border-bottom: 1px solid rgba(255,255,255,.06);
    user-select: none;
}
.cs-dots { display: flex; gap: 6px; }
.cs-dot  { width: 11px; height: 11px; border-radius: 50%; }
.cs-dot-r { background: #ff5f57; }
.cs-dot-y { background: #febc2e; }
.cs-dot-g { background: #28c840; }
.cs-url-pill {
    flex: 1;
    background: #111;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 6px;
    padding: 3px 10px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(176,152,120,.7);
    overflow: hidden; white-space: nowrap;
}
.cs-bar-tabs { display: flex; gap: 4px; flex-shrink: 0; }
.cs-bar-tab {
    background: none;
    border: 1px solid transparent;
    font-family: 'Inter', sans-serif;
    font-size: .73rem; font-weight: 600;
    color: rgba(255,255,255,.3);
    cursor: pointer; padding: 3px 9px; border-radius: 5px;
    transition: all .2s ease;
}
.cs-bar-tab:hover { color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.1); }

/* viewport — the visible window */
.cs-viewport {
    position: relative;
    height: 480px;
    overflow: hidden;
    background: #0a0a0a;
    cursor: default;
}

/* after side — iframe, scaled to fit */
.cs-after {
    position: absolute; inset: 0;
    overflow: hidden; z-index: 1;
}
#cs-ifr-wrap {
    /* sized by JS; translateY on this scrolls the after side */
    overflow: hidden;
    will-change: transform;
}
.cs-after iframe {
    display: block; border: none;
    opacity: 0; transition: opacity .5s ease;
    transform-origin: top left;
    /* width / height / scale set by JS; position stays static */
}

/* before side — image, width:100%, scrolls via scrollTop on this element */
.cs-before {
    position: absolute; top: 0; left: 0; bottom: 0;
    /* width controlled by JS (= pct * viewport width) */
    overflow: hidden; z-index: 2;
    background: #fff;
}
.cs-before-scroll {
    /* same width as viewport, so image fills it */
    position: absolute; top: 0; left: 0;
    width: 100vw;          /* overridden by JS to be viewport px */
    /* translateY controlled by JS */
}
.cs-before-scroll img {
    display: block;
    width: 100%;           /* scale to fit the scroll container */
    height: auto;
}

/* divider line */
.cs-divider {
    position: absolute; top: 0; bottom: 0;
    width: 2px; background: #fff;
    transform: translateX(-50%);
    z-index: 10; pointer-events: none;
}

/* drag handle */
.cs-handle {
    position: absolute; top: 50%;
    transform: translate(-50%, -50%);
    width: 44px; height: 44px; border-radius: 50%;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    z-index: 11; cursor: col-resize; touch-action: none;
    box-shadow: 0 0 0 4px rgba(255,255,255,.2), 0 6px 20px rgba(0,0,0,.5);
}
.cs-handle:active { transform: translate(-50%, -50%) scale(.9); }

/* labels */
.cs-lbl {
    position: absolute; top: 12px;
    font-size: 10px; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    padding: 3px 9px; border-radius: 4px; color: #fff;
    pointer-events: none; z-index: 9; font-family: 'Inter', sans-serif;
}
.cs-lbl-b { left: 12px; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.12); }
.cs-lbl-a { right: 12px; background: rgba(176,152,120,.5); border: 1px solid rgba(176,152,120,.3); }

/* scroll controls below viewport */
.cs-controls {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 14px;
    background: #1a1a1a;
    border-top: 1px solid rgba(255,255,255,.06);
}
.cs-scroll-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; color: rgba(255,255,255,.3);
    white-space: nowrap; flex-shrink: 0;
}
/* native range — styled to match dark theme */
.cs-scroll-range {
    flex: 1; height: 3px; cursor: pointer;
    accent-color: #b09878;
}

/* tech tags + ctas */
.cs-tech-row { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 2.5rem; }
.cs-tech-tag {
    padding: .25rem .85rem;
    background: rgba(176,152,120,.06); border: 1px solid rgba(176,152,120,.16);
    border-radius: 20px; font-family: 'JetBrains Mono', monospace;
    font-size: .7rem; color: rgba(176,152,120,.7);
}
.cs-cta-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* responsive */
@media (max-width: 768px) {
    .cs-section { padding: 4rem 0; }
    .cs-viewport { height: 300px; }
    .cs-bar-tabs { display: none; }
    .cs-stats { flex-wrap: wrap; }
    .cs-stat { flex: 1 1 50%; border-bottom: 1px solid rgba(255,255,255,.06); }
    .cs-stat:nth-child(2n) { border-right: none; }
    .cs-cta-row { flex-direction: column; align-items: stretch; }
    .cs-cta-row .btn { justify-content: center; }
}