/* Case Study Detail Page — Revamped Layout */
:root {
    --bg: #1e1e1e;
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.8);
    --text-subtle: rgba(255, 255, 255, 0.55);
    --border: rgba(255, 255, 255, 0.1);
    --divider: rgba(255, 255, 255, 0.12);
    --hero-border: rgba(255, 255, 255, 0.12);
    --font: 'Nunito Sans', sans-serif;
    --px: 80px;
    --nav-bg: rgba(17, 17, 17, 0.9);
    --scroll-bg-stroke: rgba(255, 255, 255, 0.12);
    --minimap-bg: #141414;
    --minimap-viewport-bg: rgba(255, 255, 255, 0.04);
    --minimap-viewport-border: rgba(255, 255, 255, 0.82);
}

:root[data-theme="light"] {
    --bg: #faf9f6;
    --text: #111111;
    --text-muted: rgba(17, 17, 17, 0.8);
    --text-subtle: rgba(17, 17, 17, 0.55);
    --border: rgba(17, 17, 17, 0.1);
    --divider: rgba(17, 17, 17, 0.12);
    --hero-border: rgba(17, 17, 17, 0.12);
    --nav-bg: rgba(250, 249, 246, 0.9);
    --scroll-bg-stroke: rgba(17, 17, 17, 0.12);
    --minimap-bg: #eae9e4;
    --minimap-viewport-bg: rgba(17, 17, 17, 0.05);
    --minimap-viewport-border: rgba(17, 17, 17, 0.82);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    cursor: url('../Image/cursor.svg') 1 0, auto;
}

a,
button,
[role="button"],
.cs-nav-back,
.cs-scroll-wrapper,
.cs-scroll-indicator,
.cs-footer-back,
.cs-minimap-track,
.cs-minimap-viewport {
    cursor: url('../Image/hover-cursor.svg') 7 0, pointer !important;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-top: 64px;
}

/* ─── LOCKED PAGE WRAPPER ─── */
body.is-locked {
    overflow: hidden;
}

.page-content.is-blurred {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

/* ─── NAV ─── */
.cs-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--px);
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.cs-nav-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    line-height: 22.4px;
    color: var(--text-subtle);
    text-decoration: none;
    transition: color 0.2s ease;
}

.cs-nav-back svg,
.cs-nav-back img {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

:root[data-theme="light"] .cs-nav-back img {
    filter: invert(1);
}

.cs-nav-back:hover {
    color: var(--text);
}

.cs-nav-back:hover img {
    opacity: 0.9;
}

.cs-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cs-nav-title {
    font-size: 13px;
    font-weight: 400;
    line-height: 20.8px;
    color: var(--text-subtle);
    white-space: nowrap;
}

/* NAV PROGRESS INDICATOR */
.cs-scroll-wrapper {
    position: relative;
    width: 36px;
    height: 36px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cs-scroll-indicator {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cs-scroll-indicator:hover {
    transform: scale(1.08);
}

.cs-scroll-indicator svg.progress-svg {
    position: absolute;
    width: 36px;
    height: 36px;
    transform: rotate(-90deg);
    transform-origin: center;
}

.cs-scroll-bg {
    fill: none;
    stroke: var(--scroll-bg-stroke);
    stroke-width: 2.5;
}

.cs-scroll-progress {
    fill: none;
    stroke: #10b981;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 94.25;
    stroke-dashoffset: 94.25;
    transition: stroke-dashoffset 0.05s linear;
}

.cs-scroll-percent {
    position: absolute;
    font-size: 9px;
    font-weight: 700;
    color: #10b981;
    opacity: 1;
    transform: scale(1);
    transition: transform 0.3s ease, opacity 0.3s ease;
    font-family: var(--font);
    user-select: none;
    pointer-events: none;
}

.cs-scroll-tick {
    position: absolute;
    width: 14px;
    height: 14px;
    opacity: 0;
    transform: scale(0.5);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    pointer-events: none;
    color: #10b981;
}

.cs-scroll-wrapper.complete .cs-scroll-percent {
    opacity: 0;
    transform: scale(0.5);
}

.cs-scroll-wrapper.complete .cs-scroll-tick {
    opacity: 1;
    transform: scale(1);
}

/* ─── HERO BANNER ─── */
.cs-hero {
    position: relative;
    width: 100%;
    height: 480px;
    background: #1e1e1e;
    border-bottom: 1px solid var(--hero-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cs-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    display: block;
}

.cs-hero--dimmed::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(12, 12, 14, 0.56);
    pointer-events: none;
    z-index: 1;
}

.cs-hero-title {
    position: relative;
    z-index: 2;
    font-family: var(--font);
    font-size: 60px;
    font-weight: 800;
    line-height: 54.6px;
    letter-spacing: -1.5px;
    color: #ffffff;
    text-transform: uppercase;
    text-align: center;
    padding: 0 24px;
}

/* ─── MAIN 3-COLUMN DETAIL SECTION ─── */
.cs-detail-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 60px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 80px var(--px);
}

/* Left Sticky Sidebar (290px) */
.cs-sidebar {
    width: 290px;
    flex-shrink: 0;
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.cs-meta-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.cs-meta-heading {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    text-transform: uppercase;
}

.cs-meta-text {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--text-muted);
}

.cs-meta-divider {
    width: 100%;
    height: 1px;
    background: var(--divider);
    border: none;
    flex-shrink: 0;
}

.cs-meta-divider-svg {
    display: block;
    width: 290px;
    max-width: 100%;
    height: 1px;
    flex-shrink: 0;
}

:root[data-theme="light"] .cs-meta-divider-svg {
    filter: invert(1);
}

/* Tertiary Visit Site Link */
.cs-visit-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 2px;
    transition: opacity 0.2s ease;
}

.cs-visit-link svg {
    width: 16px;
    height: 16px;
    display: block;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cs-visit-link:hover {
    opacity: 0.75;
}

.cs-visit-link:hover svg {
    transform: translate(2px, -2px);
}

/* Center Design Showcase */
.cs-showcase {
    flex: 1 1 auto;
    max-width: 798px;
    min-width: 0;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 120px;
}

.cs-showcase-img {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
}

/* Right Sticky Minimap Navigator */
.cs-minimap {
    width: 76px;
    flex-shrink: 0;
    position: sticky;
    top: 96px;
    user-select: none;
}

.cs-minimap-track {
    position: relative;
    width: 76px;
    max-height: calc(100vh - 140px);
    padding: 4px 3px 0 2px;
    overflow: hidden;
}

.cs-minimap-strip {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 71px;
    transform-origin: top left;
    will-change: transform;
}

.cs-minimap-thumb {
    display: block;
    width: 71px;
    height: auto;
    pointer-events: none;
}

.cs-minimap-viewport {
    position: absolute;
    top: 0;
    left: 0;
    width: 76px;
    height: 135px;
    background: var(--minimap-viewport-bg);
    border: 0.5px solid var(--minimap-viewport-border);
    transition: background 0.15s ease;
    will-change: transform, height;
}

.cs-minimap-track:hover .cs-minimap-viewport,
.cs-minimap-viewport.is-dragging {
    background: rgba(255, 255, 255, 0.1);
}

:root[data-theme="light"] .cs-minimap-track:hover .cs-minimap-viewport,
:root[data-theme="light"] .cs-minimap-viewport.is-dragging {
    background: rgba(17, 17, 17, 0.1);
}

/* ─── FOOTER ─── */
.cs-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 32px var(--px);
}

.cs-footer-back {
    font-size: 14px;
    font-weight: 500;
    line-height: 22.4px;
    color: var(--text-subtle);
    text-decoration: none;
    transition: color 0.2s ease;
}

.cs-footer-back:hover {
    color: var(--text);
}

.cs-footer-credit {
    font-size: 13px;
    font-weight: 400;
    line-height: 20.8px;
    color: var(--text-subtle);
    white-space: nowrap;
}

/* ─── SUBTLE LOAD REVEAL ─── */
.cs-hero,
.cs-detail-main {
    animation: csFadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cs-detail-main {
    animation-delay: 0.08s;
}

@keyframes csFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1200px) {
    :root {
        --px: 48px;
    }

    .cs-detail-main {
        gap: 36px;
    }

    .cs-sidebar {
        width: 240px;
    }

    .cs-hero-title {
        font-size: 48px;
        line-height: 1.05;
    }
}

@media (max-width: 960px) {
    :root {
        --px: 32px;
    }

    .cs-hero {
        height: 360px;
    }

    .cs-hero-title {
        font-size: 40px;
        line-height: 1.1;
    }

    .cs-detail-main {
        flex-direction: column;
        gap: 48px;
        padding: 48px var(--px);
    }

    .cs-sidebar {
        position: static;
        width: 100%;
        gap: 24px;
    }

    .cs-meta-divider-svg {
        width: 100%;
    }

    .cs-showcase {
        max-width: 100%;
        width: 100%;
    }

    .cs-minimap {
        display: none;
    }
}

@media (max-width: 600px) {
    :root {
        --px: 20px;
    }

    .cs-hero {
        height: 260px;
    }

    .cs-hero-title {
        font-size: 30px;
        letter-spacing: -0.8px;
    }

    .cs-detail-main {
        padding: 36px var(--px);
        gap: 36px;
    }

    .cs-showcase {
        gap: 60px;
    }

    .cs-meta-heading {
        font-size: 18px;
    }

    .cs-meta-text {
        font-size: 15px;
    }

    .cs-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 24px var(--px);
    }
}

