/* Click! case study components */

.hero-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
}

.hero-intro {
  max-width: 52ch;
}

.hero-phone-card {
  width: min(200px, 34vw);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
}

.hero-phone {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
}

.hero .meta-grid {
  margin-top: 2.5rem;
}

.process-rail-bar {
  margin-top: 2.5rem;
  padding: 1.75rem 0 0;
  border-top: 1px solid var(--line);
  width: 100%;
}

.process-rail-bar .wrap {
  display: flex;
  justify-content: center;
}

.process-rail-bar .process-rail {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  width: max-content;
  margin: 0;
  padding: 0;
  border: none;
}

.process-rail span {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--teal-dark);
  white-space: nowrap;
}

.process-rail span:not(:last-child)::after {
  content: "";
  flex: 0 0 2.5rem;
  width: 2.5rem;
  height: 1px;
  background: var(--line);
  margin: 0 0.75rem;
}

.process-rail span::before {
  content: "";
  display: inline-block;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  margin-right: 0.5rem;
  text-align: center;
  line-height: 1.75rem;
  font-size: 0.75rem;
  vertical-align: middle;
  color: var(--teal-dark);
  background: var(--surface);
}

.process-rail span:nth-child(1)::before { content: "1"; }
.process-rail span:nth-child(2)::before { content: "2"; }
.process-rail span:nth-child(3)::before { content: "3"; }
.process-rail span:nth-child(4)::before { content: "4"; }
.process-rail span:nth-child(5)::before { content: "5"; }

.section-intro {
  max-width: 58ch;
  color: var(--muted);
  margin-top: 0.5rem;
}

.media-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-top: 2rem;
}

.media-text.reverse {
  direction: rtl;
}

.media-text.reverse > * {
  direction: ltr;
}

.media-text img {
  width: 100%;
  height: auto;
  display: block;
}

.asset-float {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.asset-float img {
  width: min(300px, 100%);
  height: auto;
  display: block;
  filter: drop-shadow(0 20px 48px rgba(15, 23, 42, 0.14));
}

.research-asset {
  display: flex;
  flex-direction: column;
}

.research-asset img,
.wireframe-showcase img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.1);
}

/* Transparent cut-out image: no card shadow/rounding behind it */
.research-asset.bare img {
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.wireframe-showcase img {
  filter: drop-shadow(0 20px 48px rgba(15, 23, 42, 0.12));
  margin-top: 2.5rem;
}

.asset-caption {
  margin-top: 0.85rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.asset-caption a {
  font-weight: 600;
  color: var(--teal-dark);
  white-space: nowrap;
}

.hero-phone-wrap { width: min(215px, 40vw); }

/* Reusable iPhone-style mockup.
   The aspect ratio lives on the inner screen (matching the 630x1400 screenshots)
   so the frame padding never shrinks the screen into a narrower ratio that would
   crop the image's left/right edges. */
.phone-mock {
  position: relative;
  width: 100%;
  background: linear-gradient(155deg, #232b3b, #0f172a);
  border-radius: 2rem;
  padding: 0.4rem;
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.22), inset 0 0 0 1.5px rgba(255, 255, 255, 0.08);
}

.phone-mock__screen {
  width: 100%;
  aspect-ratio: 9 / 20;
  border-radius: 1.65rem;
  overflow: hidden;
  background: #efe7d8;
}

.phone-mock__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* Grid of phone mockups for the UI screens showcase */
.phone-showcase {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  justify-content: center;
  margin-top: 1.5rem;
  margin-bottom: 2.5rem;
}

.phone-item {
  margin: 0;
  width: min(210px, 42%);
  display: flex;
  flex-direction: column;
}

.phone-item .asset-caption {
  margin-top: 0.75rem;
}

/* Crop the baked-in caption text out of an image */
.research-asset.crop-caption img {
  aspect-ratio: 766 / 585;
  object-fit: cover;
  object-position: top center;
}

/* Single phone mockup floated beside prose */
.asset-float .phone-mock {
  width: min(260px, 100%);
}

/* Coverflow carousel for the high-fidelity UI screens */
.coverflow {
  position: relative;
  margin-top: 2rem;
}

.coverflow-stage {
  position: relative;
  height: 520px;
  overflow: hidden;
}

.coverflow-slide {
  position: absolute;
  top: 0;
  left: 50%;
  width: 220px;
  margin-left: -110px; /* half of width, so scaling stays centred */
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.45s ease, filter 0.45s ease;
  will-change: transform, opacity, filter;
  -webkit-tap-highlight-color: transparent;
}

.coverflow-slide .phone-mock {
  width: 100%;
}

.coverflow-slide.is-active {
  cursor: default;
}

.coverflow-nav {
  position: absolute;
  top: 260px;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 20;
  font-size: 1.35rem;
  line-height: 1;
}

.coverflow-nav:hover {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.coverflow-nav.prev { left: 0; }
.coverflow-nav.next { right: 0; }

.coverflow-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  box-shadow: none;
}

.coverflow-meta {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.coverflow-caption {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}

.coverflow-count {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-dark);
}

@media (max-width: 720px) {
  .coverflow-stage { height: 400px; }
  .coverflow-slide { width: 168px; margin-left: -84px; }
  .coverflow-nav { top: 200px; }
}

/* Conference posters: header text on the left, photos-of-me slideshow top-right */
.posters-header-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 2.75rem;
  align-items: start;
}

.posters-header-text .subsection-title {
  margin-top: 1.75rem;
}

/* Auto-advancing slideshow of photos of me at the poster sessions */
.poster-me-slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.1);
}

.poster-me-slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.poster-me-slideshow img.active {
  opacity: 1;
}

/* Three poster miniatures below the header, standardized to equal height */
.poster-minis {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 2.25rem;
  margin-top: 4.5rem; /* dropped further down from the header */
}

.poster-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--muted);
}

.poster-mini:hover { text-decoration: none; }

/* Frame wraps the image so the hover overlay can sit on top of it */
.poster-mini-frame {
  position: relative;
  display: inline-block;
  background: var(--surface);
  border: 1px solid #cbd5e1; /* subtle grey outline */
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.poster-mini img {
  height: 450px; /* fixed, bigger height; width follows the poster's aspect ratio */
  width: auto;
  max-width: 100%;
  display: block;
}

.poster-mini:hover .poster-mini-frame,
.poster-mini:focus-visible .poster-mini-frame {
  transform: translateY(-4px);
  border-color: var(--teal);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
}

/* "View full poster" overlay to make the click affordance obvious */
.poster-mini-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.5);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.poster-mini:hover .poster-mini-overlay,
.poster-mini:focus-visible .poster-mini-overlay {
  opacity: 1;
}

.poster-mini-overlay-icon {
  font-size: 1.9rem;
  line-height: 1;
}

.poster-mini-label {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--ink);
}

/* Always-visible hint that the poster opens the full PDF */
.poster-mini-hint {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--teal-dark);
}

@media (max-width: 860px) {
  .posters-header-layout {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .poster-minis {
    gap: 1.5rem;
    margin-top: 3rem;
  }
  .poster-mini img {
    height: 300px;
  }
}

/* Focus group carousel: vertical frame matched to the 3:4 photos */
#focus-group-carousel .carousel-viewport {
  aspect-ratio: 3 / 4;
}

#focus-group-carousel .carousel-slide img {
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  object-fit: cover;
  border-radius: 12px;
}

#focus-group-carousel .thumb-btn {
  width: 88px;
}

/* Uniform portrait thumbnails: the odd landscape photo crops to fill the space */
#focus-group-carousel .thumb-btn img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}

.poster-block {
  margin-top: 2.5rem;
}

.poster-block + .poster-block {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--line);
}

.poster-meta {
  margin-bottom: 1.25rem;
  max-width: 72ch;
}

.poster-date {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.5rem;
}

.poster-meta h4 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.poster-authors {
  font-size: 0.88rem;
  color: var(--muted);
}

.poster-image img {
  width: 100%;
  max-width: 520px;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.poster-image a:hover img {
  transform: translateY(-2px);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.16);
}

.poster-link-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--teal-dark);
}

.poster-visuals {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}

.poster-visuals .poster-image img {
  max-width: 100%;
}

.poster-photo {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.poster-photo img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.1);
}

@media (max-width: 720px) {
  .poster-visuals {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.quotes-showcase {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--line);
}

.quotes-showcase img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.1);
}

.thumb-carousel .carousel-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.subsection-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 2rem;
}

.thumb-carousel.has-captions .carousel-viewport {
  aspect-ratio: 16 / 12;
}

.thumb-carousel.has-captions .carousel-slide .asset-caption {
  flex: 0 0 auto;
  padding: 0.65rem 1rem 0.25rem;
  width: 100%;
}

/* Flat carousels on section background */
.thumb-carousel,
.thumb-carousel.carousel {
  margin-top: 2rem;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.thumb-carousel .carousel-stage {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  border: none;
}

.thumb-carousel .carousel-viewport {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: none;
  border-radius: 0;
  background: transparent;
}

.thumb-carousel .carousel-viewport--tall {
  aspect-ratio: 16 / 10;
}

.thumb-carousel .carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.thumb-carousel .carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  background: transparent;
}

.thumb-carousel .carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: transparent;
  border: none;
  box-shadow: none;
}

.thumb-carousel.has-captions .carousel-slide img {
  height: auto;
  max-height: calc(100% - 2.75rem);
  flex: 1 1 auto;
}

.thumb-carousel .carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 2;
  font-size: 1.35rem;
  line-height: 1;
}

.thumb-carousel .carousel-nav:hover {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.thumb-carousel .carousel-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.thumb-carousel .carousel-nav.prev { left: 1rem; }
.thumb-carousel .carousel-nav.next { right: 1rem; }

.thumb-strip {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.thumb-btn {
  width: 132px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  opacity: 0.62;
  transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
}

.thumb-btn:hover { opacity: 0.9; }

.thumb-btn.active {
  opacity: 1;
  border-color: var(--teal);
  transform: translateY(-2px);
}

.thumb-btn img {
  width: 100%;
  height: auto;
  display: block;
}

.thumb-carousel .carousel-count {
  margin-top: 0.85rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-dark);
}

.prose ul,
.prose ol {
  margin: 0.75rem 0 0 1.15rem;
  color: var(--muted);
}

.prose li + li {
  margin-top: 0.4rem;
}

.outcome-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.outcome-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.outcome-card h3 {
  margin-bottom: 0.75rem;
}

.outcome-card p + p {
  margin-top: 1rem;
}

.outcome-card p,
.outcome-card li {
  color: var(--muted);
  font-size: 0.95rem;
}

.outcome-card ul {
  margin: 0.75rem 0 0 1.15rem;
  color: var(--muted);
}

.outcome-card li + li {
  margin-top: 0.5rem;
}

@media (max-width: 960px) {
  .hero-layout {
    grid-template-columns: 1fr;
  }

  .hero-phone-card {
    width: 180px;
  }

  .process-rail-bar .process-rail {
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    justify-content: center;
  }

  .process-rail span {
    flex: 0 1 auto;
  }

  .process-rail span:not(:last-child)::after {
    display: none;
  }

  .media-text,
  .outcome-grid {
    grid-template-columns: 1fr;
  }

  .media-text.reverse {
    direction: ltr;
  }
}
