/* ==========================================================================
   CASE DETAIL — heyamychen.com
   Shared stylesheet for all case study pages.
   ========================================================================== */


/* --------------------------------------------------------------------------
   PAGE FOLD
   -------------------------------------------------------------------------- */

.page-fold {
  min-height: 55svh;
  display: flex;
  flex-direction: column;
}


/* --------------------------------------------------------------------------
   CASE HERO — project title pinned to bottom of fold
   -------------------------------------------------------------------------- */

.case-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--grid-margin) 4rem;
  gap: 2.5rem;
}

/* Back link + client/year eyebrow */
.case-hero__nav {
  display: flex;
  align-items: baseline;
  gap: 2rem;
}

.case-back {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking);
  line-height: var(--leading-mono);
  color: var(--color-forest);
  text-decoration: none;
  transition: color var(--duration-base) var(--easing-default);
}

.case-back:hover {
  color: var(--color-clay);
}

.case-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking);
  line-height: var(--leading-mono);
  color: var(--color-forest);
}

/* Title + subtitle grouped together */
.case-hero__content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.case-hero__title {
  font-family: var(--font-primary);
  font-size: var(--text-hero);
  font-weight: var(--weight-regular);
  line-height: calc(var(--leading-hero) * 0.9);
  letter-spacing: var(--tracking);
  color: var(--color-moss);
}

.case-hero__sub {
  font-family: var(--font-primary);
  font-size: var(--text-body-lg);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking);
  color: var(--color-forest);
  max-width: 42rem;
}

@media (max-width: 1023px) {
  .case-hero {
    padding-bottom: 3rem;
  }
}

@media (max-width: 639px) {
  .case-hero {
    padding-bottom: 2.5rem;
    gap: 1.75rem;
  }

  .case-hero__title {
    font-size: clamp(2.5rem, 12vw, 10rem);
  }
}


/* --------------------------------------------------------------------------
   PROJECT METADATA STRIP
   Four-column definition list: label above, value below.
   -------------------------------------------------------------------------- */

.section-case-meta {
  padding: 0 var(--grid-margin);
  margin-top: 2.875rem;
}

.case-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gutter);
  padding-top: 2rem;
  margin: 0;
}

.case-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.case-meta__label {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking);
  line-height: var(--leading-mono);
  color: var(--color-forest);
  opacity: 0.5;
}

.case-meta__value {
  font-family: var(--font-primary);
  font-size: var(--text-body-lg);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking);
  color: var(--color-forest);
  margin: 0;
}

@media (max-width: 1023px) {
  .case-meta-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem var(--grid-gutter);
  }
}

@media (max-width: 639px) {
  .case-meta-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding-top: 1.5rem;
  }
}


/* --------------------------------------------------------------------------
   LEAD IMAGE — full-width hero visual
   -------------------------------------------------------------------------- */

.section-case-lead {
  padding: 0 var(--grid-margin);
  margin-top: 2.875rem;
}

.case-lead__img {
  width: 100%;
  display: block;
}


/* --------------------------------------------------------------------------
   PROSE SECTIONS — 1fr / 2fr grid: eyebrow left, content right
   -------------------------------------------------------------------------- */

.section-prose {
  padding: 0 var(--grid-margin);
  margin-top: 2.875rem;
}

.prose-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--grid-gutter);
  padding-top: 3rem;
  align-items: start;
}

.prose-aside {
  padding-top: 0.25rem;   /* optical alignment with first line of prose */
  min-width: 0;
}

.prose-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking);
  line-height: var(--leading-mono);
  color: var(--color-forest);
}

.prose-body {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  min-width: 0;
}

/* Opening statement — larger size for impact */
.prose-lede {
  font-family: var(--font-primary);
  font-size: var(--text-tagline);   /* 32px */
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking);
  color: var(--color-forest);
  margin: 0;
}

/* Section heading inside prose body */
.prose-heading {
  font-family: var(--font-primary);
  font-size: var(--text-tagline);   /* 32px — matches service titles */
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking);
  color: var(--color-forest);
  margin: 0;
}

.prose-body p {
  font-family: var(--font-primary);
  font-size: var(--text-body-lg);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking);
  color: var(--color-forest);
  margin: 0;
}

.prose-body ul {
  padding-left: 1.25rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.prose-body li {
  font-family: var(--font-primary);
  font-size: var(--text-body-lg);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking);
  color: var(--color-forest);
}

.prose-body a {
  color: var(--color-clay);
  text-underline-offset: 0.2em;
}

.prose-body em {
  font-style: normal;
  text-decoration: underline;
  text-decoration-color: var(--color-forest);
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
}

/* Sub-section wrapper — groups a label + its content so they stay close
   while the outer prose-body gap (3rem) separates each sub-section. */
.prose-subsection {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Sub-heading label — mono, uppercase, slightly larger than caption to signal hierarchy */
.prose-subheading {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking);
  line-height: var(--leading-mono);
  color: var(--color-forest);
  text-transform: uppercase;
  margin: 0;
}


@media (max-width: 1023px) {
  .prose-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-top: 2rem;
  }
}

@media (max-width: 639px) {
  .section-prose {
    margin-top: 2rem;
  }
}


/* --------------------------------------------------------------------------
   RESEARCH STATS — four large numbers with labels
   -------------------------------------------------------------------------- */

.research-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin: 0.5rem 0;
}

.research-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.research-stat__num {
  font-family: var(--font-primary);
  font-size: var(--text-card-title);   /* clamp(2rem, 4.63vw, 4rem) */
  font-weight: var(--weight-regular);
  line-height: 1;
  letter-spacing: var(--tracking);
  color: var(--color-forest);
  margin: 0;
}

.research-stat__label {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking);
  line-height: var(--leading-mono);
  color: var(--color-forest);
  margin: 0;
}

@media (max-width: 1023px) {
  .research-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 2rem;
  }
}

@media (max-width: 639px) {
  .research-stats {
    gap: 1.25rem 1.5rem;
  }
}


/* --------------------------------------------------------------------------
   IMAGE SECTIONS — flexible grid of case study visuals
   -------------------------------------------------------------------------- */

.section-case-images {
  padding: 0 var(--grid-margin);
  margin-top: 2rem;
}

.case-image-grid {
  display: grid;
  gap: var(--grid-gutter);
}

.case-image-grid--1col { grid-template-columns: 1fr; }
.case-image-grid--2col { grid-template-columns: 1fr 1fr; }
.case-image-grid--3col { grid-template-columns: 1fr 1fr 1fr; }

/* Two phone screenshots side by side — constrained so phones stay phone-sized */
.case-image-pair {
  display: flex;
  gap: var(--grid-gutter);
  align-items: flex-start;
  max-width: 600px;
}

.case-image-pair .case-figure {
  flex: 1;
  min-width: 0;
}

/* Standalone row of phone screenshots — natural size, not stretched to column width */
.case-phones {
  display: flex;
  gap: var(--grid-gutter);
  align-items: flex-start;
}

.case-phones .case-figure {
  flex: 0 1 260px;
  min-width: 0;
}

/* Constrained figure — for images that read better at a smaller size */
.case-figure--constrained {
  max-width: 460px;
}

.prose-body .case-figure {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.case-figure {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.case-figure__img {
  width: 100%;
  display: block;
}

.case-caption {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking);
  line-height: var(--leading-mono);
  color: var(--color-forest);
  opacity: 0.6;
}

@media (max-width: 1023px) {
  .case-image-grid--3col {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 639px) {
  .case-image-grid--2col,
  .case-image-grid--3col {
    grid-template-columns: 1fr;
  }

  /* Keep phone pair side by side, centered, at a phone-appropriate size */
  .case-image-pair {
    max-width: 100%;
    justify-content: center;
  }

  .case-image-pair .case-figure {
    flex: 0 1 190px;
  }

  /* Phone row centered */
  .case-phones {
    justify-content: center;
  }

  .case-phones .case-figure {
    flex: 0 1 calc(50% - var(--grid-gutter) / 2);
  }

  /* Constrained figures (e.g. haptic diagram) centered and capped */
  .case-figure--constrained {
    max-width: 325px;
    margin-left: auto;
    margin-right: auto;
  }
}


/* --------------------------------------------------------------------------
   CLIENT QUOTE — used in Outcomes section
   -------------------------------------------------------------------------- */

.case-quote {
  font-family: var(--font-primary);
  font-size: var(--text-tagline);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking);
  color: var(--color-forest);
  margin: 0;
}

.case-quote__attr {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking);
  line-height: var(--leading-mono);
  color: var(--color-forest);
  opacity: 0.6;
  margin: 0;
}


/* --------------------------------------------------------------------------
   CASE CAROUSEL — contained horizontal scroll, one item + peek
   -------------------------------------------------------------------------- */

.case-carousel {
  overflow: hidden;
}

.case-carousel__track {
  display: flex;
  gap: var(--grid-gutter);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
}

.case-carousel__track:active {
  cursor: grabbing;
}

.case-carousel__track::-webkit-scrollbar {
  display: none;
}

.case-carousel__item {
  flex: 0 0 calc((100% - var(--grid-gutter)) / 1.2);
  scroll-snap-align: start;
}

.case-carousel__img {
  width: 100%;
  display: block;
  background-color: var(--color-placeholder);
}

/* Portrait images — show 2.5 items at once */
.case-carousel--portrait .case-carousel__item {
  flex: 0 0 calc((100% - var(--grid-gutter) * 2) / 2.5);
}



/* --------------------------------------------------------------------------
   OUTCOMES SECTION
   -------------------------------------------------------------------------- */

.section-outcomes {
  margin-bottom: 5rem;
}

.outcome-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.outcome-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--color-rule);
}

.outcome-item:last-child {
  border-bottom: 1px solid var(--color-rule);
}

.outcome-award {
  font-family: var(--font-primary);
  font-size: var(--text-body-lg);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking);
  line-height: var(--leading-body);
  color: var(--color-forest);
}

.outcome-detail {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking);
  line-height: var(--leading-mono);
  color: var(--color-forest);
}

@media (max-width: 639px) {
  .section-outcomes {
    margin-bottom: 3rem;
  }
}
