/* CellSpectrum Case Study */
:root {
    --bg: #1e1e1e;
    --text: #ffffff;
    --text-muted: rgba(255,255,255,0.8);
    --border: rgba(255,255,255,0.1);
    --placeholder-bg: #1e1e1e;
    --placeholder-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);
}

:root[data-theme="light"] {
    --bg: #faf9f6;
    --text: #111111;
    --text-muted: rgba(17, 17, 17, 0.8);
    --border: rgba(17, 17, 17, 0.1);
    --placeholder-bg: #ffffff;
    --placeholder-border: rgba(17, 17, 17, 0.12);
    --nav-bg: rgba(250, 249, 246, 0.9);
    --scroll-bg-stroke: rgba(17, 17, 17, 0.12);
}

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

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

/* Custom Hover/Click Cursor override */
a,
button,
select,
input[type="submit"],
input[type="button"],
[role="button"],
.cs-nav-back,
.cs-scroll-wrapper,
.cs-scroll-indicator,
.design-card,
.lightbox-close,
.lightbox-nav {
    cursor: url('../Image/hover-cursor.svg') 7 0, pointer !important;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* NAV */
.cs-nav {
    position: fixed; top: 0; left: 0; width: 100%;
    z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 var(--px);
    height: 64px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.cs-nav-back {
    display: flex; align-items: center; gap: 6px;
    font-size: 14px; font-weight: 500;
    color: var(--text-muted); text-decoration: none;
    transition: color 0.2s;
}
.cs-nav-back:hover { color: var(--text); }
.cs-nav-title { font-size: 13px; color: var(--text-muted); }
.cs-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
/* 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; /* Premium Green */
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 94.25;
    stroke-dashoffset: 94.25;
    transition: stroke-dashoffset 0.05s linear;
}

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

/* Tick Mark inside Circle */
.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; /* Matches green theme */
}

/* When complete: hide percent label and show tick mark */
.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 IMAGE BLOCK */
.hero-img-block {
    padding-top: 64px;
    width: 100%;
}
.hero-img-block img {
    width: 100%;
    height: 600px;
    object-fit: cover;
    display: block;
}

/* PLACEHOLDER IMAGES */
.placeholder-img {
    background: var(--placeholder-bg);
    border: 1px solid var(--placeholder-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    width: 100%;
}
.tall-placeholder { height: 480px; border-radius: 0; border-left: none; border-right: none; border-top: none; }
.small-placeholder { height: 240px; }
.large-placeholder { height: 400px; }
.xl-placeholder { height: 560px; }

/* SECTIONS */
.cs-intro {
    padding: 80px var(--px);
    max-width: 1600px;
    margin: 0 auto;
}

.cs-section {
    padding: 80px var(--px);
    max-width: 1600px;
    margin: 0 auto;
}

hr.section-line {
    border: none;
    border-top: 1px solid var(--border);
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--px);
    box-sizing: border-box;
}

.section-label {
    display: block;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.cs-title {
    font-size: 52px;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.05;
    margin-bottom: 20px;
}

.cs-subtitle {
    font-size: 20px;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 36px;
}

.cs-h2 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
}

.cs-body {
    font-size: 20px;
    color: var(--text-muted);
    line-height: 1.8;
}

/* META BAR */
.cs-meta-bar {
    display: flex;
    align-items: center;
}
.cs-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 28px;
}
.cs-meta-item:first-child { padding-left: 0; }
.cs-meta-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
}
.cs-meta-val {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.cs-meta-sep {
    width: 1px;
    height: 40px;
    background: var(--border);
    flex-shrink: 0;
}

/* TWO COL IMAGES */
.two-col-imgs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 32px 0;
}
.two-col-imgs .placeholder-img { height: 280px; }

/* HOW WE HELP */
.help-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.three-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.col-icon {
    width: 40px; height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.col-item h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 10px;
}

.col-item p {
    font-size: 20px;
    color: var(--text-muted);
    line-height: 1.75;
}

/* CONCLUSION */
.conclusion-text {
    font-size: 20px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--text-muted);
    font-style: italic;
}

/* FOOTER */
.cs-footer {
    padding: 32px var(--px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
}
.footer-back {
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.footer-back:hover { color: var(--text); }
.footer-credit { font-size: 13px; color: var(--text-muted); }

/* DESIGNS GRID */
.designs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px 24px;
    margin-top: 40px;
}

.design-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.design-img-wrapper {
    position: relative;
    width: 100%;
    height: 380px;
    border-radius: 12px;
    overflow: hidden;
    background: #161616;
    border: 1px solid var(--border);
}

.design-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.design-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
}

.view-btn {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    padding: 12px 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.3s, border-color 0.3s, transform 0.3s;
    transform: translateY(10px);
}

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

.design-card:hover .design-overlay {
    opacity: 1;
}

.design-card:hover .view-btn {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.6);
}

.design-info {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-top: 16px;
    padding: 0 4px;
}

.design-num {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font);
    font-style: italic;
    opacity: 0.6;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.design-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    font-family: var(--font);
    font-style: italic;
    opacity: 0.6;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* LIGHTBOX MODAL */
.lightbox-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.96);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
}

.lightbox-modal.active {
    opacity: 1;
    visibility: visible;
}

body.lightbox-open {
    overflow: hidden;
}

.lightbox-modal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 140px;
    background: linear-gradient(to bottom, rgba(10, 10, 10, 0.8) 0%, rgba(10, 10, 10, 0) 100%);
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.lightbox-modal.active::before {
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 15, 15, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    transition: color 0.3s, background 0.3s, transform 0.3s, box-shadow 0.3s;
    z-index: 10002;
    transform: translateZ(0);
    will-change: transform;
}

.lightbox-close:hover {
    color: #ffffff;
    background: rgba(15, 15, 15, 0.95);
    transform: scale(1.05) translateZ(0);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) translateZ(0);
    will-change: transform;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 15, 15, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    transition: color 0.3s, background 0.3s, transform 0.3s, box-shadow 0.3s;
    z-index: 10001;
}

.lightbox-nav:hover {
    color: #ffffff;
    background: rgba(15, 15, 15, 0.95);
    transform: translateY(-50%) scale(1.05) translateZ(0);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

.lightbox-scroll-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 24px 120px 24px;
    box-sizing: border-box;
    z-index: 1;
}

#lightbox-img {
    width: 100%;
    max-width: 1000px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-caption-bar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateZ(0);
    will-change: transform;
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 14px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10002;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.lightbox-index {
    color: var(--text-muted);
    font-family: monospace;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

.lightbox-caption {
    color: #ffffff;
    font-weight: 500;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    :root { --px: 48px; }
    .cs-title { font-size: 40px; }
    .designs-grid { grid-template-columns: repeat(2, 1fr); }
    .design-img-wrapper { height: 360px; }
}

@media (max-width: 768px) {
    :root { --px: 24px; }
    .cs-intro { padding: 40px var(--px); }
    .cs-section { padding: 40px var(--px); }
    .cs-subtitle { font-size: 16px; }
    .cs-title { font-size: 32px; }
    .cs-h2 { font-size: 24px; }
    .cs-body { font-size: 16px; }
    .col-item p { font-size: 16px; }
    .conclusion-text { font-size: 16px; }
    .two-col-imgs { grid-template-columns: 1fr; }
    .designs-grid { grid-template-columns: 1fr; grid-template-rows: auto; grid-auto-flow: row; gap: 24px; }
    .design-img-wrapper { height: 280px; }
    .lightbox-prev { left: 16px; }
    .lightbox-next { right: 16px; }
    .lightbox-nav { width: 44px; height: 44px; }
    .lightbox-close { top: 16px; right: 16px; width: 40px; height: 40px; }
    .lightbox-scroll-container { padding: 60px 16px 100px 16px; }
    .lightbox-caption-bar { font-size: 13px; padding: 6px 14px; gap: 8px; bottom: 16px; flex-wrap: nowrap; max-width: calc(100vw - 32px); width: max-content; box-sizing: border-box; }
    .lightbox-index { white-space: nowrap !important; display: inline-block !important; flex-shrink: 0 !important; }
    .help-grid { grid-template-columns: 1fr; }
    .three-cols { grid-template-columns: 1fr; }
    .cs-meta-bar { flex-wrap: wrap; gap: 16px; }
    .cs-meta-sep { display: none; }
    .cs-meta-item { padding: 0; }
    .tall-placeholder { height: 280px; }
    .large-placeholder { height: 280px; }
    .xl-placeholder { height: 360px; }
    .footer-credit { display: none; }
    .hero-img-block img { height: 320px; }
}

/* ─── Case Study Reveal Animations ─── */
.reveal-line {
    display: block;
    overflow: hidden;
}

.reveal-line span {
    display: block;
    transform: translateY(105%);
    opacity: 0;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.2s ease;
}

.reveal-meta {
    display: block;
    overflow: hidden;
}

.reveal-meta > * {
    transform: translateY(105%);
    opacity: 0;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.2s ease;
}

/* Activated state */
.cs-intro.active .reveal-line span,
.cs-intro.active .reveal-meta > * {
    transform: translateY(0);
    opacity: 1;
}

/* Stagger delays */
.cs-intro.active .reveal-line:nth-child(1) span {
    transition-delay: 0.15s;
}
.cs-intro.active .reveal-meta:nth-child(2) > * {
    transition-delay: 0.35s;
}
.cs-intro.active .reveal-meta:nth-child(3) > * {
    transition-delay: 0.5s;
}

.hero-img-block {
    opacity: 0;
    transform: scale(0.97) translateY(30px);
    transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.5s ease;
}
.hero-img-block.active {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Scroll reveal for sections */
.cs-section {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.cs-section.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Page Loader ─── */
.page-loader {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #111111;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
}

.page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-logo {
    width: 60px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-logo svg {
    width: 60px;
    height: 48px;
    animation: loader-spin-one 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes loader-spin-one {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
