/* ==========================================================================
   Case study layout
   Loaded after style.css, which holds the variables and global styles.
   ========================================================================== */
.cs {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

/* ==========================================================================
   Left column (fixed while the content scrolls)
   ========================================================================== */
.cs__left {
  position: sticky;
  top: 0;
  flex: 0 0 380px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  padding: var(--gutter);
}

.cs__top {
  margin-bottom: 40px;
}

.cs__title {
  font-size: var(--fs-xl);
  line-height: 1.25;
}

.cs__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.cs__tags li {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--pill);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

.cs__desc {
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: var(--fs-base);
}

.cs__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn,
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-btn);
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
}

.btn:hover,
.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-primary:hover {
  background: var(--btn-primary-hover);
}

/* ==========================================================================
   Right column (case study content)
   ========================================================================== */
.cs__right {
  flex: 1;
  min-width: 0;
  padding: 96px calc(var(--gutter) + 24px) 120px 0;
}

.cs__content {
  max-width: 760px;
}

.cs__content > * + * {
  margin-top: 24px;
}

.cs__section-label {
  margin-bottom: -8px;
}

.cs__heading {
  font-size: var(--fs-2xl);
  line-height: 1.2;
}

.cs__meta {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
}

.cs__lead {
  font-size: var(--fs-md);
  line-height: 1.55;
}

/* Section headings (h2); h3 is a sub-section inside a part */
.cs__content > h2:not(.cs__heading) {
  margin-top: 56px;
  font-size: var(--fs-lg);
  line-height: 1.3;
}

.cs__content > h2.cs__part {
  margin-top: 96px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-2xl);
  line-height: 1.2;
}

.cs__content > h3 {
  margin-top: 48px;
  font-size: var(--fs-md);
}

.cs__content > h2.cs__part + h3 {
  margin-top: 32px;
}

.cs__content > h2 + *,
.cs__content > h3 + * {
  margin-top: 16px;
}

/* Image placeholders */
.figure {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 320px;
  margin-top: 40px !important;
  margin-bottom: 16px;
  padding: 20px;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--card-edge);
}

.figure--sm {
  height: 240px;
}

.figure span {
  font-size: var(--fs-sm);
  color: var(--text-on-dark);
  opacity: 0.8;
}

.figure.bg-imvegan span,
.figure.bg-mapoiltools span {
  color: var(--ink);
}

/* Real images: the box takes the image's own shape instead of a fixed height.
   Usage: <div class="figure"><img src="images/x.png" alt="..." width="1520" height="950"></div> */
.figure:has(> img) {
  display: block;
  height: auto;
  padding: 0;
  overflow: hidden;
  background: none;
}

/* Screen recording floating on the case colour */
.figure.figure--video {
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  padding: 7% 8%;
}

.figure.figure--bleed {
  height: auto;
  padding: 0;
  overflow: hidden;
}

.figure--bleed > video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

.figure--video > video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 24px 56px rgba(0, 0, 0, 0.4);
}

.figure > img {
  display: block;
  width: 100%;
  height: auto;
}

/* Numbered points */
.points {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: point;
}

.points > li {
  position: relative;
  padding: 24px 0 24px 52px;
  border-top: 1px solid var(--line);
  counter-increment: point;
}

/* No divider right under stat cards, pills or a table: they already end the block */
.stats + .points > li:first-child,
.pills + .points > li:first-child,
.table-wrap + .points > li:first-child,
.note + .points > li:first-child {
  border-top: none;
}

.points > li:last-child {
  border-bottom: 1px solid var(--line);
}

.points > li::before {
  content: counter(point, decimal-leading-zero);
  position: absolute;
  top: 26px;
  left: 0;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.points strong {
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-md);
  font-weight: 500;
}

.points p {
  color: var(--text-body);
}

/* Workflow table */
.table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  background: var(--surface);
}

.table-wrap table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.table-wrap th,
.table-wrap td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--pill);
}

.table-wrap th {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.table-wrap tr:last-child td {
  border-bottom: 0;
}

.table-wrap td:first-child {
  white-space: nowrap;
  font-weight: 500;
}

/* ==========================================================================
   Locked section (password-protected cases)
   ========================================================================== */
.locked-section {
  position: relative;
  background: var(--bg-muted);
  border-radius: 20px;
  padding: 48px;
  margin-top: 48px !important;
  overflow: hidden;
  scroll-margin-top: 48px;
}

.locked-section::before {
  content: '';
  position: absolute;
  inset: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: var(--lock-overlay);
  border-radius: 20px;
  z-index: 1;
}

/* Faint stand-in lines behind the blur */
.locked-section__ghost {
  position: absolute;
  inset: 48px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.locked-section__ghost span {
  height: 12px;
  border-radius: 6px;
  background: var(--placeholder);
}

.locked-section__ghost span:nth-child(2n) { width: 82%; }
.locked-section__ghost span:nth-child(3n) { width: 64%; }

.locked-section .lock-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.lock-content svg {
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
}

.lock-content h2,
.lock-content h3 {
  margin-top: 12px !important;
  font-size: var(--fs-lg);
}

.lock-content p {
  max-width: 440px;
  margin: 12px auto 0;
  color: var(--text-body);
  font-size: var(--fs-base);
}

.lock-content .btn-primary {
  margin-top: 24px;
}

.lock-content small {
  display: block;
  margin-top: 14px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.lock-content small a {
  color: inherit;
}

/* ==========================================================================
   Tablet (768px to 1100px): narrower left column, roomier content
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1100px) {
  .cs__left {
    flex-basis: 300px;
    padding: 32px;
  }

  .cs__right {
    padding-right: 32px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .facts {
    grid-template-columns: 1fr;
  }
}

/* Short screens (landscape phones): let the left column scroll with the page */
@media (min-width: 768px) and (max-height: 600px) {
  .cs__left {
    position: relative;
    justify-content: flex-start;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }
}

/* ==========================================================================
   Mobile (below 768px)
   ========================================================================== */
@media (max-width: 767px) {
  .cs {
    display: block;
  }

  .cs__left {
    position: static;
    min-height: 0;
    max-height: none;
    padding: 32px var(--gutter) 8px;
  }

  .cs__top {
    margin-bottom: 28px;
  }

  .cs__right {
    padding: 40px var(--gutter) 80px;
  }

  .figure {
    height: 220px;
  }

  .figure--sm {
    height: 180px;
  }

  .points > li {
    padding-left: 40px;
  }

  .locked-section {
    padding: 36px 20px;
  }
}

/* ==========================================================================
   Full case study pieces
   ========================================================================== */
/* Key facts grid */
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 32px;
  margin: 32px 0 0;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.facts dt {
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.facts dd {
  margin: 4px 0 0;
  font-size: var(--fs-base);
}

/* Big numbers row */
.stats {
  display: grid;
  /* Four across when there's room, fewer when tiles would get cramped */
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stats > div {
  padding: 20px;
  border-radius: 16px;
  background: var(--surface);
}

.stats strong.stats__word {
  font-size: var(--fs-lg);
  line-height: 1.25;
}

.stats strong {
  display: block;
  font-size: var(--fs-xl);
  font-weight: 500;
  line-height: 1.1;
}

.stats span {
  display: block;
  margin-top: 8px;
  font-size: var(--fs-sm);
  line-height: 1.4;
  color: var(--text-secondary);
}

/* Small note under a table */
.cs__content > .note {
  margin-top: 12px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

/* Plain bullet list */
.list {
  margin: 14px 0 0;
  padding-left: 22px;
}

.list li {
  padding-left: 8px;
}

.list li::marker {
  color: var(--text-secondary);
}

.list li + li {
  margin-top: 10px;
}

/* A paragraph after a list gets the normal paragraph gap */
.list + p {
  margin-top: 24px;
}

.points p + p {
  margin-top: 10px;
}

/* Password gate */
.gate {
  max-width: 520px;
  margin-top: 18vh;
  padding: 48px;
  border-radius: 20px;
  background: var(--bg-muted);
  text-align: center;
}

.gate[hidden] {
  display: none;
}

.gate > svg {
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
}

.gate h2 {
  margin-top: 12px;
  font-size: var(--fs-lg);
}

.gate > p {
  margin-top: 12px;
  color: var(--text-body);
  font-size: var(--fs-base);
}

.gate__form {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.gate__form input {
  flex: 1;
  min-width: 0;
  padding: 11px 18px;
  border: 1px solid var(--field-border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-base);
}

.gate__form input:focus {
  outline: 2px solid var(--text);
  outline-offset: 1px;
}

.gate__form button {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.gate__form button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.gate > .gate__error {
  margin-top: 12px;
  font-size: var(--fs-sm);
  color: var(--error);
}

.gate small {
  display: block;
  margin-top: 20px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.gate small a {
  color: inherit;
}

@media (max-width: 767px) {
  .facts {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gate {
    margin-top: 16px;
    padding: 32px 20px;
  }

  .gate__form {
    flex-direction: column;
  }
}

.lock-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.lock-actions .btn-primary {
  margin-top: 0;
}

.cs__content:focus {
  outline: none;
}

/* ==========================================================================
   Personas → buying paths illustration (Industrial commerce case)
   ========================================================================== */
.paths {
  margin: 40px 0 0;
  padding: 28px;
  border-radius: 20px;
  background: var(--bg-muted);
  box-shadow: inset 0 0 0 1px var(--line);
}

.paths__personas,
.paths__endings {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.paths__personas { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.paths__endings  { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.paths__persona,
.paths__ending {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 16px;
  border-radius: 14px;
  background: var(--surface);
}

.paths__ending { padding: 20px; }

.paths__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 14px;
  border-radius: 9px;
  background: var(--pill);
  color: var(--text-secondary);
}

.paths__icon svg { width: 18px; height: 18px; }

.paths__label {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}

.paths__name,
.paths__title {
  margin-top: 4px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
}

.paths__name  { font-size: var(--fs-base); }
.paths__title { font-size: var(--fs-md); }

.paths__role,
.paths__text {
  margin-top: 2px;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--text-secondary);
}

.paths__tag {
  margin-top: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg-muted);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}

.paths__links {
  display: block;
  width: 100%;
  height: 48px;
}

.paths__links path {
  fill: none;
  stroke: var(--text-secondary);
  stroke-opacity: 0.45;
  stroke-width: 1.2;
  stroke-dasharray: 4 5;
  vector-effect: non-scaling-stroke;
}

/* Tiny screen hints, all in greys */
.paths__steps,
.paths__toggle,
.paths__map {
  margin-top: 18px;
}

.paths__steps {
  display: flex;
  gap: 5px;
}

.paths__steps i {
  width: 14px;
  height: 4px;
  border-radius: 2px;
  background: var(--pill);
}

.paths__steps i.is-done { background: var(--text-secondary); opacity: 0.55; }

.paths__toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-muted);
}

.paths__toggle b {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--text-secondary);
}

.paths__toggle b:first-child {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.paths__map {
  position: relative;
  width: 100%;
  height: 44px;
  border-radius: 8px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 14px 14px,
    var(--bg-muted);
}

.paths__map i {
  position: absolute;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-secondary);
  color: var(--surface);
  font-size: var(--fs-xs);
  font-style: normal;
  line-height: 1;
}

.paths__map i:nth-child(1) { left: 18%; top: 8px; }
.paths__map i:nth-child(2) { left: 48%; top: 19px; }
.paths__map i:nth-child(3) { left: 74%; top: 6px; }

.paths__for {
  margin-top: auto;
  padding-top: 16px;
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}

.paths__for::before { content: "For "; }

@media (max-width: 640px) {
  .paths { padding: 16px; }
  .paths__personas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paths__endings { grid-template-columns: 1fr; margin-top: 12px; }
  .paths__links { display: none; }
}
