/* Case study â extends portfolio-a.css. Inherits tokens & nav. */

.cs-root {}

/* === BACK CHIP === */
.cs-back-chip {
  position: fixed;
  bottom: 24px; left: 24px;
  z-index: 70;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px 10px 12px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(15,20,25,0.06);
  border-radius: 999px;
  box-shadow: 0 12px 32px -16px rgba(15,20,25,0.18), 0 1px 2px rgba(15,20,25,0.04);
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  opacity: 0; transform: translateY(12px);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s, background .25s;
}
.cs-back-chip.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.cs-back-chip:hover { background: var(--ink); color: #fff; }
.cs-back-chip:hover svg { color: #fff; }
.cs-back-chip svg { color: var(--ink-2); transition: transform .3s; }
.cs-back-chip:hover svg { transform: translateX(-2px); }

/* === HERO === */
.cs-hero {
  padding-top: 40px;
  padding-bottom: 48px;
  width: min(1320px, calc(100% - 64px));
  margin: 0 auto;
}
.cs-hero-meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
  font-size: 12px;
}
.cs-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: center;
  margin-bottom: 40px;
}
.cs-hero-text { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.cs-hero-art { width: 100%; min-width: 0; }
.cs-hero-art-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 62vh;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 32px 80px -40px rgba(15,20,25,0.4);
}
.cs-crumb {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-2); text-decoration: none;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.5);
  transition: background .2s, color .2s;
}
.cs-crumb:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.cs-crumb:hover svg { color: #fff; }
.cs-crumb svg { color: var(--ink-3); }
.cs-crumb-sep { color: var(--ink-3); }
.cs-crumb-current { color: var(--ink); }

.cs-h1 {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: clamp(44px, 5.2vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--ink);
  max-width: 12ch;
}
.cs-h1-line { display: block; margin-bottom: -0.08em; }
.cs-h1-line:last-child { margin-bottom: 0; }
.cs-h1-accent { color: var(--accent); }

.cs-hero-sub {
  max-width: 44ch;
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
}

.cs-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 32px;
  margin: 0;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cs-hero-stats > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cs-hero-stats-wide { grid-column: 1 / -1; padding-top: 12px; border-top: 1px dashed var(--line); }
.cs-hero-stats dt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}
.cs-hero-stats dd {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.5;
}

.cs-hero-hero-full { width: 100%; }

/* === IMAGE BLOCK === */
.cs-ph {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 22px 50px -28px rgba(15,20,25,0.35), 0 1px 0 rgba(255,255,255,0.04) inset;
}
.cs-ph-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.cs-ph-grid {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(8, 1fr);
  pointer-events: none;
  opacity: 1;
}
.cs-ph-grid[data-overlay="soft"] { opacity: 0.3; }
.cs-ph-grid > span {
  border-right: 1px solid rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cs-ph-cap {
  position: absolute;
  left: 16px; bottom: 14px;
  padding: 5px 10px;
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.92);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  z-index: 3;
}
.cs-ph-cap .pa-mono { color: rgba(255,255,255,0.85); }

/* === Collage === */
.cs-collage { position: relative; width: 100%; }
.cs-collage-stage { width: 100%; }
.cs-collage-chip {
  position: absolute;
  right: -16px; bottom: -20px;
  width: 96px; height: 96px;
  border-radius: 24px;
  background: #8B5CF6;
  display: grid; place-items: center;
  overflow: hidden;
  border: 4px solid var(--paper);
  box-shadow: 0 18px 40px -22px rgba(91, 33, 182, 0.5);
}
.cs-collage-chip img { width: 80%; height: 80%; object-fit: contain; }

/* === STORY (stacked: big image + focused text) === */
.cs-story {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 48px 0;
  display: flex;
  flex-direction: column;
  gap: 96px;
}
.cs-story-tinted {
  background: transparent;
}
.cs-story-dark {
  background: var(--ink);
  color: #fff;
  padding: 96px 0;
}

/* Text inside a story â narrow, centered, generous */
.cs-story-text {
  width: min(820px, calc(100% - 64px));
  margin: 0 auto;
}
.cs-story-text-wide { width: min(960px, calc(100% - 64px)); }
.cs-story-text p {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.55;
  letter-spacing: -0.005em;
  color: var(--ink);
  font-weight: 400;
}
.cs-story-p-light { color: rgba(255,255,255,0.92) !important; }
.cs-inline-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  transition: text-decoration-color .2s ease;
}
.cs-inline-link:hover { text-decoration-color: var(--accent); }

/* In media row (dark section) */
.cs-media {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,0.16);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 24px;
}
.cs-media-label {
  color: rgba(255,255,255,0.5);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
}
.cs-media-links { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.cs-media-links a {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: clamp(15px, 1.1vw, 17px);
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.28);
  padding-bottom: 1px;
  transition: border-color .2s ease, opacity .2s ease;
}
.cs-media-links a:hover { border-color: #fff; opacity: 0.85; }
.cs-media-links a span { color: rgba(255,255,255,0.55); }

/* Big bleed image */
.cs-story-bleed {
  width: min(1200px, calc(100% - 64px));
  margin: 0 auto;
  position: relative;
  box-sizing: border-box;
}
.cs-bleed-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 64vh;
  object-fit: contain;
  background: transparent;
  border-radius: 20px;
  padding: 0;
  box-sizing: border-box;
}
.cs-story-tinted .cs-bleed-img,
.cs-story-dark .cs-bleed-img { background: transparent; }
.cs-bleed-cap {
  display: flex; align-items: baseline; justify-content: center; gap: 9px;
  margin: 14px auto 0;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px; font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink-3);
}
.cs-bleed-cap .pa-mono {
  font-size: 11px; letter-spacing: 0.04em;
  color: var(--accent);
}
.cs-story-dark .cs-bleed-cap { color: rgba(255,255,255,0.6); }

/* Bleed collage (image + logo chip overlay) */
.cs-bleed-collage {
  position: relative;
  width: 100%;
  max-width: min(1200px, 100%);
  margin: 0 auto;
  border-radius: 20px;
  overflow: visible;
}
.cs-bleed-collage .cs-bleed-img {
  background: transparent;
  padding: 0;
  border-radius: 20px;
  max-height: 64vh;
  object-fit: cover;
}
.cs-bleed-chip {
  position: absolute;
  right: 6%; bottom: -36px;
  width: clamp(80px, 8vw, 128px);
  height: clamp(80px, 8vw, 128px);
  border-radius: 28px;
  background: #8B5CF6;
  display: grid; place-items: center;
  overflow: hidden;
  border: 6px solid var(--bg);
  box-shadow: 0 24px 56px -24px rgba(91, 33, 182, 0.5);
}
.cs-story-tinted .cs-bleed-chip { border-color: var(--beige); }
.cs-bleed-chip img { width: 78%; height: 78%; object-fit: contain; }

/* === legacy story-grid kept for non-converted bits === */

.cs-story-copy { display: flex; flex-direction: column; gap: 20px; }
.cs-story-num {
  color: var(--accent);
  font-size: 12px;
}
.cs-story-num-light { color: var(--accent-soft); }
.cs-story-copy p {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: clamp(17px, 1.2vw, 19px);
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-weight: 400;
  max-width: 48ch;
}
.cs-story-p-light { color: rgba(255,255,255,0.92) !important; }

.cs-story-img { width: 100%; }
.cs-story-img .cs-ph { box-shadow: 0 40px 100px -40px rgba(15,20,25,0.45), 0 1px 0 rgba(255,255,255,0.04) inset; }

/* === NEXT PROJECT === */
.cs-next {
  width: min(1200px, calc(100% - 80px));
  margin: 0 auto;
  padding: 100px 0;
}
.cs-next-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 28px;
  color: var(--ink-2);
}
.cs-next-cat { color: var(--ink-3); }

.cs-next-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  padding: 32px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  transition: transform .4s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .4s;
}
.cs-next-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-soft);
  box-shadow: 0 28px 56px -32px rgba(15,20,25,0.25);
}
.cs-next-thumb {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 5 / 4;
}
.cs-next-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.cs-next-card:hover .cs-next-img { transform: scale(1.04); }
.cs-next-thumb-label {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: clamp(28px, 3.4vw, 44px);
  letter-spacing: -0.025em;
  mix-blend-mode: screen;
}
.cs-next-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
}
.cs-next-copy { display: flex; flex-direction: column; gap: 10px; }
.cs-next-h {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ink);
}
.cs-next-copy p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 42ch;
}
.cs-next-cta {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 6px;
  font-weight: 500;
  font-size: 14px;
  color: var(--accent);
}
.cs-next-card:hover .cs-next-cta svg { transform: rotate(-45deg); }
.cs-next-cta svg { transition: transform .35s cubic-bezier(.2,.8,.2,1); }

/* === Responsive === */

/* Tablet landscape & small desktop */
@media (max-width: 1100px) {
  .cs-hero { width: calc(100% - 48px); padding-top: 32px; }
  .cs-hero-grid { gap: 40px; }
  .cs-hero-art-img { max-height: 56vh; }
  .cs-story-bleed { width: calc(100% - 48px); }
  .cs-story-text { width: calc(100% - 48px); }
  .cs-story-text-wide { width: calc(100% - 48px); }
}

/* Tablet portrait */
@media (max-width: 900px) {
  .cs-hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .cs-hero-art-img {
    max-height: 52vh;
    width: 100%;
  }
  .cs-h1 { font-size: clamp(40px, 7vw, 60px); max-width: 14ch; }
  .cs-hero-stats { grid-template-columns: 1fr 1fr; gap: 16px 24px; padding: 20px 0; }
  .cs-story { padding: 32px 0; gap: 64px; }
  .cs-story-dark { padding: 72px 0; }
  .cs-next-card { grid-template-columns: 1fr; gap: 28px; }
  .cs-back-chip { bottom: 16px; left: 16px; padding: 8px 14px 8px 10px; font-size: 12.5px; }
  .cs-bleed-img { max-height: 56vh; }
  .cs-bleed-collage .cs-bleed-img { max-height: 56vh; }
  .cs-bleed-chip { right: 12px; bottom: -24px; }
  /* Make floating nav links wrap nicely on tablet */
  .pa-nav { margin: 0 16px; }
  .pa-nav-inner { padding: 6px 8px; }
  .pa-mark-name { display: none; }
}

/* Small mobile */
@media (max-width: 600px) {
  .cs-hero { width: calc(100% - 32px); padding-top: 24px; padding-bottom: 32px; }
  .cs-hero-meta { flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
  .cs-crumb-current { word-break: break-word; }
  .cs-h1 { font-size: clamp(36px, 9vw, 48px); max-width: none; }
  .cs-hero-sub { font-size: 16px; }
  .cs-hero-stats { grid-template-columns: 1fr; gap: 14px; padding: 18px 0; }
  .cs-hero-stats dd { font-size: 14px; }
  .cs-hero-art-img { max-height: 44vh; border-radius: 16px; }
  .cs-story { padding: 24px 0; gap: 48px; }
  .cs-story-bleed { width: calc(100% - 24px); }
  .cs-story-text,
  .cs-story-text-wide { width: calc(100% - 32px); }
  .cs-story-dark { padding: 56px 0; }
  .cs-bleed-img { border-radius: 14px; max-height: 50vh; }
  .cs-bleed-collage .cs-bleed-img { border-radius: 14px; }
  .cs-bleed-chip { width: 64px; height: 64px; border-radius: 18px; border-width: 4px; right: 8px; bottom: -18px; }
  .cs-next { padding: 56px 0; }
  .cs-next-h { font-size: 28px; }
  .cs-back-chip { display: none; } /* hidden on small mobile to free up screen */
}
