/* Case study pages - match mithun-m.framer.website structure */

@font-face {
  font-family: "DT Nightingale";
  src: url("https://framerusercontent.com/assets/62Yl9Y2VqTSkDHSBv2V4ZgpHCgg.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Light editorial body (case narratives) */
  --cs-bg: #f3f1ec;
  --cs-bg-dark: #090909;
  --cs-ink: #121212;
  --cs-muted: rgba(18, 18, 18, 0.62);
  --cs-label: rgba(18, 18, 18, 0.42);
  --cs-white: #f4f1ea;
  --cs-border: rgba(0, 0, 0, 0.08);
  --cs-border-dark: rgba(255, 255, 255, 0.1);
  --cs-accent: #e07a45;
  --cs-max: 1100px;
  --cs-wide: 1400px;
  --cs-gutter: 24px;
  --nav-h: 72px;
  --font-serif: "DT Nightingale", "Instrument Serif", "Playfair Display", Georgia, serif;
  --font-sans: "Inter", "Inter Variable", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body.cs-page {
  font-family: var(--font-sans);
  background: var(--cs-bg);
  color: var(--cs-ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.cs-page.theme-dark {
  --cs-bg: #090909;
  --cs-ink: #f4f1ea;
  --cs-muted: rgba(244, 241, 234, 0.68);
  --cs-label: rgba(244, 241, 234, 0.42);
  --cs-border: rgba(255, 255, 255, 0.1);
  background: var(--cs-bg);
  color: var(--cs-ink);
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

/* Reading progress */
.cs-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: #000;
  z-index: 200;
  transform-origin: 0% 50%;
  transform: scaleX(0);
  will-change: transform;
}

body.theme-dark .cs-progress {
  background: #fff;
}

/* Nav */
.cs-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(9, 9, 9, 0.72);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}

.cs-nav.scrolled {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.cs-nav .inner {
  width: min(100% - (var(--cs-gutter) * 2), var(--cs-wide));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cs-nav .logo {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #fff;
}

.cs-nav .meta {
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.cs-nav .meta a:hover {
  color: #fff;
}

.cs-nav .links {
  display: flex;
  gap: 6px;
}

.cs-nav .links a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  padding: 8px 12px;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}

.cs-nav .links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.cs-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.cs-nav-toggle span {
  width: 16px;
  height: 1.5px;
  background: #fff;
}

/* Hero - always dark */
.cs-hero {
  background: #090909;
  color: #f4f1ea;
  padding: calc(var(--nav-h) + 56px) 0 72px;
  position: relative;
  overflow: hidden;
}

.cs-hero::after {
  content: "";
  position: absolute;
  width: 50vw;
  height: 50vw;
  right: -12vw;
  top: 0;
  background: radial-gradient(circle, rgba(224, 122, 69, 0.12), transparent 65%);
  pointer-events: none;
}

.cs-hero .wrap {
  width: min(100% - 48px, var(--cs-wide));
  margin: 0 auto;
}

.cs-kicker {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 20px;
  text-transform: none;
}

.cs-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(48px, 8vw, 76px);
  line-height: 1em;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.cs-subtitle {
  font-size: clamp(18px, 2.2vw, 30px);
  font-weight: 400;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.9);
  max-width: 28ch;
  margin-bottom: 36px;
}

.cs-subtitle.wide {
  max-width: 40ch;
  font-size: clamp(16px, 1.8vw, 22px);
  color: rgba(255, 255, 255, 0.7);
}

.cs-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 48px;
  margin: 32px 0 28px;
}

.cs-meta-grid > div strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 6px;
}

.cs-meta-grid > div span {
  font-size: 18px;
  font-weight: 500;
  color: #fff;
}

.cs-site-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 2px;
  margin-bottom: 24px;
  transition: color 0.2s, border-color 0.2s;
}

.cs-site-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

/* App store row */
.cs-apps {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 48px;
  margin: 28px 0 8px;
}

.cs-apps .app-col h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.cs-apps .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.cs-apps .badges a {
  display: block;
  transition: transform 0.25s var(--ease), opacity 0.25s;
  opacity: 0.95;
}

.cs-apps .badges a:hover {
  transform: translateY(-2px) scale(1.02);
  opacity: 1;
}

.cs-apps .badges img {
  height: 42px;
  width: auto;
}

/* Hero cover — full image, no crop (v1 + shared) */
.cs-cover {
  width: min(100% - 48px, var(--cs-wide));
  margin: 40px auto 0;
  border-radius: 16px;
  overflow: visible;
  background: transparent;
}

.cs-cover img {
  width: 100%;
  height: auto;
  max-height: none;
  display: block;
  object-fit: contain;
  object-position: center center;
  background: transparent;
  transition: none;
}

.cs-cover:hover img {
  transform: none;
}

/* Hero cover inside v2 layout — no white plate, extra space below via wrap */
.cs-hero-v2 .cs-cover {
  width: 100%;
  margin: 0;
  background: transparent !important;
  border: none;
}

.cs-hero-v2 .cs-cover img {
  background: transparent !important;
}

/* Body sections */
.cs-body {
  width: min(100% - 48px, var(--cs-max));
  margin: 0 auto;
  padding: 72px 0 40px;
}

.cs-section {
  padding: 56px 0;
  border-top: 1px solid var(--cs-border);
}

.cs-section:first-child {
  border-top: none;
  padding-top: 0;
}

.cs-section-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cs-label);
  margin-bottom: 12px;
  font-variation-settings: "wght" 500;
}

.cs-section h2 {
  font-size: clamp(26px, 3.2vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--cs-ink);
}

.cs-section h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 28px 0 10px;
  color: var(--cs-ink);
}

.cs-section p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--cs-muted);
  max-width: 62ch;
  margin-bottom: 14px;
}

.cs-section p em,
.cs-section p .quote-inline {
  color: var(--cs-ink);
  font-style: italic;
}

.cs-section ul.bullets {
  margin: 12px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cs-section ul.bullets li {
  position: relative;
  padding-left: 18px;
  color: var(--cs-muted);
  font-size: 16px;
  line-height: 1.5;
}

.cs-section ul.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cs-label);
}

/* Media frames - light surface so black callout/annotation labels stay legible */
.cs-media {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #eef0f2;
  border: 1px solid rgba(0, 0, 0, 0.08);
  cursor: zoom-in;
  position: relative;
}

.cs-media img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  background: #eef0f2;
  transition: transform 0.7s var(--ease);
}

.cs-media:hover img {
  transform: scale(1.01);
}

.cs-media-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0 0;
}

body.theme-dark .cs-media,
body.theme-dark .cs-media img {
  background: #eef0f2;
  border-color: rgba(255, 255, 255, 0.12);
}

/* White annotation callouts need a dark canvas */
.cs-media.media-annot-white-label,
.cs-media.media-annot-white-label img {
  background: #0d0d0d !important;
  border-color: rgba(255, 255, 255, 0.14);
}

.cs-media.media-annot-dark-label,
.cs-media.media-annot-dark-label img {
  background: #d8dde2 !important;
}

.cs-media.media-annot-light-canvas,
.cs-media.media-annot-light-canvas img {
  background: #f5f5f5 !important;
}

.cs-lightbox img {
  background: #0d0d0d;
}

/* Blueprint / feature cards */
.cs-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 28px 0;
}

.cs-cards.cs-cards-2 {
  grid-template-columns: repeat(2, 1fr);
}

.cs-card {
  background: #fff;
  border: 1px solid var(--cs-border);
  border-radius: 16px;
  padding: 22px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

body.theme-dark .cs-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--cs-border-dark);
}

.cs-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.cs-card .num {
  font-size: 12px;
  color: var(--cs-label);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.cs-card h4 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--cs-ink);
}

.cs-card p {
  font-size: 14px;
  color: var(--cs-muted);
  margin: 0;
  max-width: none;
  line-height: 1.55;
}

/* Persona tags (text fallback when image not used) */
.cs-personas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

.cs-persona {
  background: #fff;
  border: 1px solid var(--cs-border);
  border-radius: 16px;
  padding: 24px;
}

body.theme-dark .cs-persona {
  background: rgba(255, 255, 255, 0.03);
}

.cs-persona h4 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.cs-persona .q {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 300;
  line-height: 1.35;
  margin-bottom: 14px;
  color: var(--cs-ink);
}

.cs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cs-tags span {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--cs-border);
  color: var(--cs-muted);
}

/* Metrics */
.cs-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 28px 0;
}

.cs-metric {
  background: #fff;
  border: 1px solid var(--cs-border);
  border-radius: 16px;
  padding: 28px;
  transition: transform 0.35s var(--ease);
}

body.theme-dark .cs-metric {
  background: rgba(255, 255, 255, 0.03);
}

.cs-metric:hover {
  transform: translateY(-2px);
}

.cs-metric .big {
  font-size: clamp(40px, 5vw, 46px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
  color: var(--cs-ink);
}

.cs-metric .title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.cs-metric p {
  font-size: 14px;
  margin: 0;
  max-width: none;
}

/* Before / After */
.cs-ba {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 20px 0;
}

.cs-ba .ba {
  border-radius: 14px;
  padding: 20px;
  border: 1px solid var(--cs-border);
  background: #fff;
}

body.theme-dark .cs-ba .ba {
  background: rgba(255, 255, 255, 0.03);
}

.cs-ba .ba.before {
  background: #fff8f8;
}

.cs-ba .ba.after {
  background: #f4fbf6;
}

body.theme-dark .cs-ba .ba.before {
  background: rgba(255, 80, 80, 0.06);
}

body.theme-dark .cs-ba .ba.after {
  background: rgba(80, 200, 120, 0.06);
}

.cs-ba .ba h5 {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cs-label);
  margin-bottom: 8px;
  font-weight: 600;
}

.cs-ba .ba p {
  margin: 0;
  font-size: 14px;
  color: var(--cs-ink);
  max-width: none;
}

/* Decision blocks (TAG) */
.cs-decision {
  margin: 36px 0;
  padding: 28px;
  border-radius: 18px;
  border: 1px solid var(--cs-border);
  background: rgba(255, 255, 255, 0.5);
}

body.theme-dark .cs-decision {
  background: rgba(255, 255, 255, 0.03);
}

.cs-decision .label {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--cs-label);
  margin-bottom: 12px;
  font-family: ui-monospace, monospace;
}

.cs-decision h2 {
  font-size: clamp(22px, 2.8vw, 28px);
  margin-bottom: 14px;
}

/* Execution sub-blocks */
.cs-exec-block {
  margin: 40px 0;
  padding-top: 8px;
}

.cs-exec-block h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

/* Contact CTA */
.cs-cta {
  background: #090909;
  color: #f4f1ea;
  padding: 88px 24px 72px;
  text-align: center;
  margin-top: 40px;
}

.cs-cta h2 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.cs-cta p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 17px;
  margin-bottom: 28px;
}

.cs-cta .contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 24px;
  margin-bottom: 24px;
}

.cs-cta .contacts a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.cs-cta .contacts a:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.4);
}

.cs-cta .socials {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.cs-cta .socials a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.7);
  transition: background 0.2s, color 0.2s;
}

.cs-cta .socials a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.cs-cta .socials svg {
  width: 18px;
  height: 18px;
}

.cs-footer {
  background: #090909;
  color: rgba(244, 241, 234, 0.4);
  text-align: center;
  font-size: 12px;
  padding: 0 24px 36px;
}

.cs-section-label {
  font-family: var(--font-mono);
}

/* Reveal on scroll (Motion drives these; class is a marker) */
.cs-reveal {
  opacity: 0;
  will-change: opacity, transform;
}

.cs-reveal.in {
  /* completed via Motion */
}

/* Lightbox */
.cs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.3s;
}

.cs-lightbox.open {
  display: flex;
  opacity: 1;
}

.cs-lightbox img {
  max-width: min(96vw, 1400px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.96);
  transition: transform 0.35s var(--ease);
}

.cs-lightbox.open img {
  transform: scale(1);
}

.cs-lightbox .close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 22px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.cs-lightbox .close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Sticky section label (desktop) */
.cs-sticky-label {
  display: none;
}

@media (min-width: 1100px) {
  .cs-section.has-sticky {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 40px;
    align-items: start;
  }

  .cs-section.has-sticky .cs-sticky-label {
    display: block;
    position: sticky;
    top: calc(var(--nav-h) + 32px);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cs-label);
    font-weight: 500;
  }

  .cs-section.has-sticky > .cs-section-label {
    display: none;
  }
}

/* Back to works */
.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 28px;
  transition: color 0.2s, gap 0.2s;
}

.cs-back:hover {
  color: #fff;
  gap: 12px;
}

/* Responsive */
@media (max-width: 900px) {
  .cs-cards,
  .cs-cards.cs-cards-2,
  .cs-personas,
  .cs-metrics,
  .cs-ba {
    grid-template-columns: 1fr;
  }

  .cs-nav .meta {
    display: none;
  }
}

@media (max-width: 720px) {
  :root {
    --cs-gutter: 16px;
    --nav-h: 64px;
  }

  .cs-nav .links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: rgba(23, 23, 23, 0.98);
    flex-direction: column;
    padding: 12px 16px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    gap: 4px;
  }

  .cs-nav .links.open {
    display: flex;
  }

  .cs-nav .links a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .cs-nav-toggle {
    display: flex;
    width: 44px;
    height: 44px;
  }

  .cs-hero {
    padding-top: calc(var(--nav-h) + 28px);
    padding-bottom: 40px;
  }

  .cs-body {
    width: min(100% - (var(--cs-gutter) * 2), var(--cs-max));
    padding: 40px 0 32px;
  }

  .cs-section {
    padding: 32px 0;
  }

  .cs-cover {
    width: min(100% - (var(--cs-gutter) * 2), var(--cs-wide));
    margin: 24px auto 0;
  }
}
