/* ==========================================================================
   KEN Infotech — Case Study Layout & Styling
   Clean, fast, non-janky layout for case study pages.
   Eliminates giant empty voids and maintains fluid responsiveness.
   ========================================================================== */

/* ---------- Premium Case Study Hero Section ---------- */
.cs-hero {
  position: relative;
  overflow: hidden;
  background: #04070f;
  color: #fff;
  isolation: isolate;
  padding-top: calc(var(--header-h, 76px) + clamp(1.5rem, 3vh, 2.75rem));
  padding-bottom: clamp(2.5rem, 5vh, 4.5rem);
}

.cs-hero::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(55% 50% at 20% 15%, rgba(37, 71, 155, 0.32), transparent 70%),
    radial-gradient(45% 45% at 80% 25%, rgba(223, 11, 138, 0.24), transparent 65%),
    radial-gradient(50% 60% at 50% 85%, rgba(89, 4, 55, 0.22), transparent 70%);
  animation: cs-hero-drift 18s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes cs-hero-drift {
  0% { transform: scale(1) translateY(0); }
  100% { transform: scale(1.08) translateY(-2%); }
}

.cs-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(85% 75% at 50% 40%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(85% 75% at 50% 40%, #000 40%, transparent 100%);
  pointer-events: none;
}

.cs-hero > * {
  position: relative;
  z-index: 1;
}

/* Breadcrumbs - Hidden to prevent overlapping fixed logo / site header */
.cs-breadcrumbs {
  display: none !important;
}

.cs-breadcrumbs a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cs-breadcrumbs a:hover {
  color: #fff;
  text-decoration: underline;
}

.cs-breadcrumbs .cs-crumb-sep {
  opacity: 0.4;
  font-size: 0.75rem;
}

.cs-breadcrumbs .cs-crumb-curr {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .cs-breadcrumbs .cs-crumb-curr {
    max-width: 180px;
  }
}

/* Hero Center Content */
.cs-hero__header {
  max-width: 960px;
  margin-inline: auto;
  text-align: center;
}

.cs-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.42rem 1.05rem;
  border-radius: var(--r-pill);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  margin-bottom: 0.5rem;
}

.cs-hero-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad-brand);
  box-shadow: 0 0 10px 2px rgba(223, 11, 138, 0.8);
  animation: cs-dot-pulse 2s infinite alternate ease-in-out;
}

@keyframes cs-dot-pulse {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.2); opacity: 1; }
}

.cs-hero__header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 1.3rem + 2.2vw, 3.25rem);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.018em;
  color: #ffffff;
  margin-top: 0.85rem;
  margin-bottom: 1.15rem;
  text-wrap: balance;
}

.cs-hero__lead {
  font-size: clamp(0.98rem, 0.92rem + 0.3vw, 1.18rem);
  line-height: 1.62;
  color: rgba(255, 255, 255, 0.82);
  max-width: 820px;
  margin-inline: auto;
  margin-bottom: 2rem;
  text-wrap: pretty;
}

/* Glassmorphism Meta Highlights */
.cs-hero-meta {
  list-style: none;
  padding: 0;
  margin: 0 auto 2.75rem;
  max-width: 1040px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.65rem, 1.5vw, 1.15rem);
}

.cs-hero-meta__item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.15rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-md);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  text-align: left;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.35s ease,
              background 0.35s ease,
              box-shadow 0.35s ease;
}

.cs-hero-meta__item:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(223, 11, 138, 0.45);
  box-shadow: 0 10px 24px -6px rgba(0, 0, 0, 0.4), 0 0 16px -2px rgba(223, 11, 138, 0.3);
}

.cs-hero-meta__label {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet-400);
  display: block;
}

.cs-hero-meta__val {
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.35;
}

@media (max-width: 880px) {
  .cs-hero-meta {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .cs-hero-meta {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
  .cs-hero-meta__item {
    padding: 0.85rem 1rem;
  }
}

/* Cinematic Showcase Media Frame */
.cs-hero__stage {
  position: relative;
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
  margin-inline: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cs-hero__glow {
  position: absolute;
  inset: -16px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(223, 11, 138, 0.25), rgba(37, 71, 155, 0.22) 50%, transparent 80%);
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
  border-radius: var(--r-xl);
}

.cs-hero__frame {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-inline: auto;
  position: relative;
  z-index: 1;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 28px 70px -18px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  background: #080f1d;
  aspect-ratio: 16 / 9;
  max-height: 520px;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s ease;
}

.cs-hero__frame:hover {
  transform: translateY(-4px);
  box-shadow: 0 36px 90px -20px rgba(0, 0, 0, 0.85), 0 0 35px -5px rgba(223, 11, 138, 0.35);
}

.cs-hero__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cs-hero__frame:hover img {
  transform: scale(1.025);
}

/* ---------- Sticky Section Nav (TOC) ---------- */
.cs-toc-mount {
  position: sticky;
  top: var(--header-h);
  z-index: 45;
  margin-bottom: 1rem;
}

.cs-toc {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.05);
}

.cs-toc__track {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-block: 0.65rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}

.cs-toc__track::-webkit-scrollbar {
  display: none;
}

.cs-toc__link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  padding: 0.42rem 0.95rem;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px solid transparent;
  text-decoration: none;
  transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease;
  flex: 0 0 auto;
}

.cs-toc__num {
  font-size: 0.68rem;
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}

.cs-toc__link:hover {
  color: var(--violet-700);
  background: var(--violet-50);
  border-color: var(--violet-200);
}

.cs-toc__link.is-active {
  color: #fff;
  background: var(--grad-brand);
  box-shadow: 0 4px 12px -2px rgba(223, 11, 138, 0.4);
}

.cs-toc__link.is-active .cs-toc__num {
  opacity: 0.9;
}

/* ---------- Article Content & Rhythm ---------- */
.cs-article {
  position: relative;
  counter-reset: cs-block;
}

.cs-block {
  position: relative;
  counter-increment: cs-block;
  scroll-margin-top: calc(var(--header-h) + 70px);
}

.cs-block + .cs-block {
  margin-top: clamp(2.25rem, 4.5vw, 3.75rem);
  padding-top: clamp(2rem, 4vw, 3.25rem);
  border-top: 1px solid var(--line);
}

.cs-block::before {
  content: counter(cs-block, decimal-leading-zero);
  position: absolute;
  top: -0.15em;
  right: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.12;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

.cs-block > * {
  position: relative;
  z-index: 1;
}

.cs-block > h2 {
  font-size: clamp(1.4rem, 1.2rem + 1vw, 1.95rem);
  max-width: calc(100% - 4.5rem);
  padding-bottom: 0.65rem;
  margin-bottom: 0.75rem;
  position: relative;
}

.cs-block > h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44px;
  height: 3px;
  border-radius: 2px;
  background: var(--grad-brand);
}

@media (max-width: 480px) {
  .cs-block::before { display: none; }
  .cs-block > h2 { max-width: 100%; }
}

.cs-block h3 {
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.35rem);
  margin-top: 1.5rem;
  margin-bottom: 0.65rem;
  color: var(--ink);
}

.cs-block h4 {
  font-size: 1.05rem;
  color: var(--ink);
}

.cs-block p {
  color: var(--ink-soft);
  line-height: 1.68;
  font-size: 1rem;
}

/* ---------- Client / Project Meta Strip ---------- */
.cs-meta-row {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1rem !important;
  margin-bottom: 1.25rem !important;
}

.cs-meta-row li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--r-md);
  background: var(--grad-brand-soft);
  border: 1px solid var(--violet-200);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
  flex: 1 1 200px;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}

.cs-meta-row li:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.cs-meta-row li strong {
  order: -1;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet-700);
  font-weight: 700;
}

.cs-meta-row li::before,
.cs-meta-row li::after {
  content: none !important;
}

/* ---------- Timelines & Sub-lists ---------- */
.cs-timeline {
  margin-top: 1.35rem !important;
}

.cs-timeline .timeline__item h3,
.cs-timeline .timeline__item h4 {
  font-family: var(--font-display);
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.cs-timeline .timeline__item p {
  margin-top: 0.4rem;
}

.cs-timeline .timeline__item .tick-list {
  margin-top: 0.6rem;
}

/* Sub-list inside tick-list */
.tick-list ul.sub-list {
  list-style: disc;
  padding-left: 1.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tick-list ul.sub-list li {
  padding: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.tick-list ul.sub-list li::before,
.tick-list ul.sub-list li::after {
  content: none !important;
}

/* ---------- Outcome List ---------- */
.cs-outcome-list.tick-list {
  gap: 0 !important;
  border-top: 1px solid var(--line);
  margin-top: 1.25rem !important;
}

.cs-outcome-list.tick-list li {
  padding: 0.9rem 0.5rem 0.9rem 2.6rem;
  border-bottom: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: background-color 0.25s ease;
}

.cs-outcome-list.tick-list li::before {
  left: 0.15rem;
  top: 1.15rem;
}

.cs-outcome-list.tick-list li::after {
  left: 6.65px;
  top: 1.48rem;
}

.cs-outcome-list.tick-list li:hover {
  background: var(--violet-50);
}

.cs-outcome-list.tick-list li strong {
  font-family: var(--font-display);
  color: var(--violet-700);
}

/* ---------- Stat Panel (Outcomes Card) ---------- */
.cs-stat-panel {
  background: var(--grad-deep);
  border-radius: var(--r-xl);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  margin-top: 1.5rem !important;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.cs-stat-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(45% 60% at 15% 20%, rgba(139, 92, 246, 0.35), transparent 60%),
    radial-gradient(40% 55% at 85% 80%, rgba(59, 130, 246, 0.3), transparent 62%);
  pointer-events: none;
}

.cs-stat-panel .grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: clamp(0.75rem, 1.5vw, 1.25rem) !important;
}

@media (max-width: 820px) {
  .cs-stat-panel .grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  .cs-stat-panel .grid {
    grid-template-columns: 1fr !important;
  }
}

.cs-stat-panel .stat {
  padding: clamp(1rem, 2vw, 1.35rem) 0.85rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--r-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 110px;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s ease, border-color 0.3s ease;
}

.cs-stat-panel .stat:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

.cs-stat-panel .stat__value {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.4rem + 1vw, 2.35rem);
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
}

.cs-stat-panel .stat__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 0.45rem;
  line-height: 1.35;
}

/* ---------- Pull Quote (Conclusion) ---------- */
.cs-pullquote {
  position: relative;
  margin-block: clamp(1.75rem, 4vw, 2.75rem) !important;
  padding: clamp(1.5rem, 3.5vw, 2.25rem) clamp(1.5rem, 3.5vw, 2.25rem) clamp(1.5rem, 3.5vw, 2.25rem)
    clamp(2.75rem, 5.5vw, 3.75rem);
  border-radius: var(--r-xl);
  background: var(--grad-brand-soft);
  border: 1px solid var(--violet-200);
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 0.95rem + 0.35vw, 1.2rem);
  font-weight: 600;
  line-height: 1.55;
  color: var(--ink-soft);
  overflow: hidden;
}

.cs-pullquote::before {
  content: "\201C";
  position: absolute;
  top: -0.08em;
  left: 0.85rem;
  font-size: clamp(3rem, 6vw, 4.25rem);
  line-height: 1;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.5;
  pointer-events: none;
}

/* ---------- Back Link ---------- */
.cs-back {
  margin-top: clamp(2rem, 4vw, 3rem);
  display: inline-flex;
  font-weight: 600;
}
