/* 
 * Behance Visual Storytelling Format
 * CSS System for Portfolio Case Studies
 * Designed for full-bleed images and premium presentation
 */

/* ==========================================================================
   1. FULL-BLEED HERO & MEDIA
   ========================================================================== */
.cs-hero--fullbleed {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  position: relative;
  overflow: hidden;
  background-color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-hero--fullbleed img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.cs-hero--fullbleed picture {
  width: 100%;
  display: block;
}

/* ==========================================================================
   2. METADATA BAR
   ========================================================================== */
.cs-metadata {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  padding: var(--space-3xl) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4xl);
}

.cs-metadata-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.cs-metadata-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cs-metadata-value {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text-primary);
  line-height: 1.6;
}

.cs-metadata-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.cs-metadata-list li {
  position: relative;
  padding-left: var(--space-md);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text-secondary);
}

.cs-metadata-list li::before {
  content: '•';
  color: var(--accent);
  position: absolute;
  left: 0;
}

/* ==========================================================================
   3. DEVICE MOCKUPS / REAL PRODUCT SHOWCASE
   ========================================================================== */
.cs-devices {
  background-color: var(--bg-secondary);
  padding: var(--space-5xl) 0;
  position: relative;
  text-align: center;
  border-radius: var(--radius-xl);
  margin: var(--space-section) 0;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5);
}

.cs-devices--real {
  overflow: hidden;
}

.cs-devices--real .cs-section-intro {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.cs-devices--real .cs-section-intro__desc {
  margin-left: auto;
  margin-right: auto;
}

.cs-device-showcase {
  min-height: 610px;
  margin-top: var(--space-3xl);
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(2rem, 7vw, 7rem);
  padding: 0 2rem 3rem;
}

.cs-device-showcase::before {
  content: '';
  position: absolute;
  width: min(740px, 75vw);
  height: 300px;
  left: 50%;
  bottom: 3.5rem;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(55, 119, 255, 0.24), transparent 68%);
  pointer-events: none;
}

.cs-device {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 24px 36px rgba(0, 0, 0, 0.55));
  transition: transform var(--duration-normal) var(--ease-out), filter var(--duration-normal) var(--ease-out);
}

.cs-device:hover {
  filter: drop-shadow(0 30px 45px rgba(0, 0, 0, 0.7));
  transform: translateY(-10px);
}

.cs-device__screen {
  overflow: hidden;
  background: #080d1c;
  position: relative;
}

.cs-device__screen img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
}

.cs-device--laptop {
  width: min(720px, 62vw);
}

.cs-device--laptop .cs-device__lid {
  position: relative;
  padding: 1.2% 1.2% 2%;
  background: linear-gradient(145deg, #667080, #171c28 34%, #080a10 80%);
  border: 1px solid #7e8795;
  border-bottom: 0;
  border-radius: 18px 18px 7px 7px;
}

.cs-device--laptop .cs-device__screen {
  aspect-ratio: 1530 / 732;
  border-radius: 8px 8px 3px 3px;
  border: 1px solid #03050a;
}

.cs-device__camera {
  position: absolute;
  top: 0.55rem;
  left: 50%;
  width: 4px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #080b11;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.cs-device--laptop .cs-device__base {
  height: 16px;
  position: relative;
  background: linear-gradient(#525b69, #171b24 52%, #080a0e);
  border-radius: 0 0 9px 9px;
  border: 1px solid #788392;
  border-top: 1px solid #a8b0bb;
}

.cs-device--laptop .cs-device__base::after {
  content: '';
  position: absolute;
  width: 18%;
  height: 4px;
  top: 3px;
  left: 41%;
  border-radius: 0 0 5px 5px;
  background: #090b10;
}

.cs-device--phone {
  width: 184px;
  padding: 8px;
  border-radius: 30px;
  background: linear-gradient(145deg, #8e9aa9, #242a35 24%, #0a0d13 75%);
  border: 1px solid #aab4c1;
  transform: rotate(4deg) translateY(-2px);
}

.cs-device--phone:hover {
  transform: rotate(4deg) translateY(-12px);
}

.cs-device-side {
  width: 220px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.cs-device--phone .cs-device__screen {
  aspect-ratio: 492 / 715;
  border-radius: 22px;
  border: 1px solid #02050a;
}

.cs-device__speaker {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 50%;
  width: 36px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 10px;
  background: #070a0f;
}

.cs-device__home-indicator {
  position: absolute;
  z-index: 2;
  bottom: 13px;
  left: 50%;
  width: 42px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.8);
}

.cs-device-note {
  max-width: 220px;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
  text-align: left;
  background: rgba(11, 16, 29, 0.78);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
}

.cs-device-note img {
  width: 76px;
  height: 32px;
  object-fit: contain;
  object-position: left center;
  background: #1362e9;
  border-radius: 5px;
}

.cs-device-note__label {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cs-device-note strong {
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: var(--fs-body-lg);
  line-height: 1.2;
}

.cs-device-note p {
  margin: var(--space-sm) 0 0;
  color: var(--text-secondary);
  font-size: var(--fs-small);
  line-height: 1.5;
}

/* ==========================================================================
   4. REAL BRAND WORK
   ========================================================================== */
.cs-brand-work {
  position: relative;
  overflow: hidden;
}

.cs-brand-work::before {
  content: '';
  position: absolute;
  width: 520px;
  height: 520px;
  top: 15%;
  right: -260px;
  border-radius: 50%;
  background: rgba(22, 102, 239, 0.16);
  filter: blur(20px);
  pointer-events: none;
}

.cs-brand-feature {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(300px, 1fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  margin: var(--space-4xl) 0;
  padding: clamp(1.25rem, 3vw, 3rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(120deg, rgba(20, 30, 56, 0.9), rgba(7, 11, 22, 0.7));
}

.cs-brand-feature__image {
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 40%, rgba(35, 119, 255, 0.26), transparent 60%), #070b15;
}

.cs-brand-feature__image img {
  width: min(100%, 310px);
  max-height: 540px;
  display: block;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
}

.cs-brand-feature__copy {
  max-width: 470px;
}

.cs-brand-feature__logo {
  width: 112px;
  height: 42px;
  display: block;
  object-fit: contain;
  object-position: left center;
  background: #1362e9;
  border-radius: 6px;
  margin-bottom: var(--space-2xl);
}

.cs-brand-feature__copy h4 {
  margin: 0 0 var(--space-md);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  line-height: 1.15;
}

.cs-brand-feature__copy p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-relaxed);
}

.cs-brand-feature__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.cs-brand-feature__stats span {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
}

.cs-brand-feature__stats strong {
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: var(--fs-h4);
}

.cs-work-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

.cs-work-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.cs-work-card--tall {
  grid-row: span 2;
}

.cs-work-card img {
  width: 100%;
  aspect-ratio: 1080 / 1350;
  display: block;
  object-fit: cover;
  transition: transform var(--duration-normal) var(--ease-out);
}

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

.cs-work-card figcaption {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cs-work-card figcaption span {
  color: var(--accent);
}

/* ==========================================================================
   4. BENTO GRID
   ========================================================================== */
.cs-bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin: var(--space-section) 0;
}

.cs-bento-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  transition: all var(--duration-normal) var(--ease-out);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.cs-bento-card:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-elevated);
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.cs-bento-icon {
  font-size: var(--fs-h2);
  margin-bottom: var(--space-sm);
}

.cs-bento-title {
  font-family: var(--font-heading);
  font-size: var(--fs-h4);
  color: var(--text-primary);
  margin: 0;
}

.cs-bento-desc {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ==========================================================================
   5. IMAGE SLICES (SEAMLESS)
   ========================================================================== */
.cs-slice {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 0;
}

.cs-slice img {
  width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   6. COLOR BLOCKING
   ========================================================================== */
.cs-block {
  padding: var(--space-section) 0;
  margin: var(--space-section) 0;
  border-radius: var(--radius-2xl);
}

.cs-block--dark {
  background-color: var(--bg-secondary);
}

.cs-block--elevated {
  background-color: var(--bg-elevated);
}

.cs-block--accent {
  background-color: var(--accent);
  color: var(--bg-primary);
}

.cs-block--accent .cs-metadata-label,
.cs-block--accent .cs-metadata-value,
.cs-block--accent .cs-bento-title,
.cs-block--accent .cs-bento-desc {
  color: var(--bg-primary);
}

/* ==========================================================================
   7. DENSE GRID
   ========================================================================== */
.cs-grid-dense {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
  margin: var(--space-section) 0;
}

.cs-grid-dense img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
  transition: transform var(--duration-fast) var(--ease-out);
}

.cs-grid-dense img:hover {
  transform: scale(1.02);
}

/* ==========================================================================
   8. RESULTS METRICS
   ========================================================================== */
.cs-results {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: var(--space-2xl);
  padding: var(--space-4xl) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: var(--space-section) 0;
}

.cs-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
}

.cs-metric-number {
  font-family: var(--font-heading);
  font-size: var(--fs-display);
  color: var(--accent);
  line-height: 1;
  font-weight: 700;
}

.cs-metric-label {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ==========================================================================
   9. THANK YOU / NEXT PROJECT
   ========================================================================== */
.cs-thankyou {
  text-align: center;
  padding: var(--space-section) 0;
  background-color: var(--bg-secondary);
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
}

.cs-thankyou h2 {
  font-family: var(--font-heading);
  font-size: var(--fs-h1);
  color: var(--text-primary);
  margin: 0;
}

/* ==========================================================================
   10. LIVE LINK BUTTON
   ========================================================================== */
.cs-live-link-container {
  text-align: center;
  margin: var(--space-3xl) 0;
}

.cs-live-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-2xl);
  background-color: var(--accent);
  color: var(--bg-primary);
  font-family: var(--font-heading);
  font-size: var(--fs-body-lg);
  font-weight: 600;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.cs-live-link:hover {
  background-color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-lg);
}

/* ==========================================================================
   11. TESTIMONIAL
   ========================================================================== */
.cs-testimonial {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  margin: var(--space-section) auto;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.cs-testimonial-stars {
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 2px;
}

.cs-testimonial-quote {
  font-size: var(--fs-body);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
  font-style: italic;
  font-family: var(--font-body);
  margin: 0;
}

.cs-testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.cs-testimonial-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-subtle);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: var(--fs-small);
  color: var(--accent);
  border: 1px solid var(--border-hover);
}

.cs-testimonial-name {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-small);
  color: var(--text-primary);
}

.cs-testimonial-role {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ==========================================================================
   12. NAVIGATION (PREV/NEXT)
   ========================================================================== */
.cs-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--border);
  margin-top: var(--space-section);
}

.cs-nav-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  text-decoration: none;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.cs-nav-link:hover {
  opacity: 0.7;
}

.cs-nav-link span {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.cs-nav-link h4 {
  font-family: var(--font-heading);
  font-size: var(--fs-h4);
  color: var(--text-primary);
  margin: 0;
}

.cs-nav-link.next {
  text-align: right;
  align-items: flex-end;
}

/* ==========================================================================
   13. BRAND CONTEXT / STORYTELLING
   ========================================================================== */
.cs-context {
  padding: var(--space-section) 0;
}

.cs-context__label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  margin-bottom: var(--space-lg);
}

.cs-context__heading {
  font-family: var(--font-heading);
  font-size: var(--fs-h2);
  color: var(--text-primary);
  line-height: var(--lh-heading);
  margin-bottom: var(--space-xl);
  max-width: 800px;
}

.cs-context__body {
  font-family: var(--font-body);
  font-size: var(--fs-body-lg);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
  max-width: 700px;
}

.cs-context__body + .cs-context__body {
  margin-top: var(--space-lg);
}

.cs-context__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  margin-top: var(--space-2xl);
}

.cs-context__grid-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.cs-context__grid-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
}

.cs-context__grid-value {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text-primary);
  line-height: var(--lh-body);
}

/* Section label used above images */
.cs-section-intro {
  text-align: left;
  margin-bottom: var(--space-2xl);
}

.cs-section-intro__title {
  font-family: var(--font-heading);
  font-size: var(--fs-h2);
  color: var(--text-primary);
  margin: 0 0 var(--space-sm) 0;
}

.cs-section-intro__desc {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text-secondary);
  line-height: var(--lh-body);
  max-width: 600px;
  margin: 0;
}

/* ==========================================================================
   14. RESPONSIVE
   ========================================================================== */
@media (max-width: 992px) {
  .cs-metadata {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .cs-bento {
    grid-template-columns: repeat(2, 1fr);
  }

  .cs-context__grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .cs-device-note {
    right: auto;
  }

  .cs-brand-feature {
    gap: var(--space-2xl);
  }

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

@media (max-width: 768px) {
  .cs-bento {
    grid-template-columns: 1fr;
  }
  
  .cs-results {
    flex-direction: column;
    gap: var(--space-3xl);
  }
  
  .cs-testimonial {
    padding: var(--space-2xl);
  }
  
  .cs-testimonial-quote {
    font-size: var(--fs-h4);
  }
  
  .cs-nav {
    flex-direction: column;
    gap: var(--space-2xl);
    text-align: center;
  }
  
  .cs-nav-link.next {
    align-items: center;
    text-align: center;
  }

  .cs-device-showcase {
    min-height: 0;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-2xl);
    padding: 0 0 var(--space-xl);
  }

  .cs-device--laptop {
    width: 100%;
  }

  .cs-device--phone {
    width: 150px;
    margin: 0;
  }

  .cs-device-side {
    width: 100%;
    display: grid;
    grid-template-columns: 150px minmax(220px, 1fr);
    align-items: end;
    gap: var(--space-lg);
  }

  .cs-device-note {
    max-width: none;
    min-width: 0;
  }

  .cs-brand-feature {
    grid-template-columns: 1fr;
    margin: var(--space-3xl) 0;
  }

  .cs-brand-feature__image {
    min-height: 390px;
  }

  .cs-brand-feature__copy {
    max-width: none;
  }

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

@media (max-width: 480px) {
  .cs-metadata {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .cs-device-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
    gap: var(--space-lg);
  }

  .cs-device--laptop {
    grid-column: 1 / -1;
  }

  .cs-device--phone {
    width: 132px;
    justify-self: center;
    margin: 0;
  }

  .cs-device-side {
    grid-column: 1 / -1;
    grid-template-columns: 132px minmax(0, 1fr);
    width: 100%;
  }

  .cs-device-note {
    padding: var(--space-md);
  }

  .cs-device-note img {
    width: 64px;
    height: 28px;
  }

  .cs-device-note p {
    font-size: var(--fs-xs);
  }

  .cs-brand-feature {
    padding: var(--space-md);
  }

  .cs-brand-feature__image {
    min-height: 330px;
    padding: var(--space-md);
  }

  .cs-work-grid {
    gap: var(--space-sm);
  }

  .cs-work-card figcaption {
    padding: var(--space-sm);
    font-size: 0.58rem;
  }
}

