/* ============================================================
   CASE STUDY — Persustain
   Layout + content styles specific to persustain.html.
   Loaded ALONGSIDE style.css.
   ============================================================ */

.case-wrap {
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) clamp(16px, 4vw, 48px) 80px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 56px;
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

/* ---- LEFT TOC ---- */
.case-toc {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
}
.case-toc::-webkit-scrollbar { width: 4px; }
.case-toc::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

.case-head { margin-bottom: 28px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.case-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.case-title-side {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 22px;
  color: var(--ink);
  margin-top: 6px;
  letter-spacing: -0.3px;
}
.case-sub-side {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 4px;
}

.toc-nav { display: flex; flex-direction: column; gap: 22px; }

.toc-section-label {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 10px;
}
.toc-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
}

.toc-group ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column;
  gap: 2px;
}
.toc-link {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 0;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-mute);
  text-decoration: none;
  transition: color 0.2s;
}
.toc-link:hover { color: var(--ink-soft); }
.toc-link.active { color: var(--ink); }
.toc-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-mute);
  background: transparent;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  margin-left:8px;
}
.toc-link:hover .toc-dot { border-color: var(--ink-soft); }
.toc-link.active .toc-dot {
  background: #2061E8;
  border-color: #2061E8;
  box-shadow: 0 0 0 4px rgba(32, 97, 232, 0.14);
  margin-left:8px;
}

/* ---- CENTER CONTENT ---- */
.case-content {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.case-hero { margin-bottom: 40px; }

.case-eyebrow-main {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.case-hero-image {
  width: 100%;
  margin: 0 0 80px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(20,20,25,0.04);
}
.case-hero-image img { width: 100%; height: auto; display: block; }

.case-h1 {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -1.2px;
  color: var(--ink);
  margin-bottom: 20px;
}
.case-lede {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.45;
  color: var(--ink-soft);
  margin-bottom: 36px;
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 24px;
}
.meta-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.meta-value {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
}

.case-section {
  margin-bottom: 56px;
  scroll-margin-top: 100px;
}
.case-h2 {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin-bottom: 18px;
}
.case-content p {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.case-content p strong { color: var(--ink); font-weight: 600; }
.case-content p em { font-style: italic; color: var(--ink); }
.muted-label {
  font-family: var(--font-mono) !important;
  font-size: 12px !important;
  color: var(--ink-mute) !important;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 22px !important;
  margin-bottom: 8px !important;
}

.case-insight {
  margin-top: 40px;
  padding-left: 20px;
  border-left: 2px solid var(--line);
}
.insight-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  margin-bottom: 12px;
}
.case-quote {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.6;
  font-style: italic;
  color: var(--ink);
}

/* lists */
.case-list { list-style: none; padding: 0; margin: 0 0 16px 0; }
.case-list li {
  font-family: var(--font-ui);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  padding-left: 22px;
  position: relative;
  margin-bottom: 10px;
}
.case-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.55em;
  width: 6px; height: 6px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-mute);
  background: transparent;
}
.case-list li strong { color: var(--ink); font-weight: 600; }
.case-list li em { font-style: italic; color: var(--ink); }
ol.case-list { counter-reset: c; }
ol.case-list li { counter-increment: c; padding-left: 30px; }
ol.case-list li::before {
  content: counter(c);
  width: auto; height: auto;
  border: none; background: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mute);
  top: 0.35em;
}

/* ---- figures ---- */
.case-figure { margin: 28px 0 32px; }
.figure-placeholder {
  background: var(--paper-2);
  border: 1px dashed var(--line);
  border-radius: 12px;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}
.figure-caption {
  font-family: var(--font-mono) !important;
  font-size: 12px !important;
  color: var(--ink-mute) !important;
  margin-top: 10px !important;
  text-align: center;
}
.case-figure-img {
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.case-figure-img img { width: 100%; height: auto; display: block; }

/* ---- HMW challenge callout ---- */
.case-hmw {
  margin: 24px 0 8px;
  padding: 26px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.case-hmw .hmw-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 12px;
}
.case-hmw p {
  font-family: var(--font-body) !important;
  font-weight: 400;
  font-size: clamp(20px, 2.6vw, 26px) !important;
  line-height: 1.32 !important;
  letter-spacing: -0.4px;
  color: var(--ink) !important;
  margin: 0 !important;
}

/* ---- lifecycle chain ---- */
.case-lifecycle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 22px 0 28px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
}
.lc-step {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  padding: 7px 13px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: nowrap;
}
.lc-arrow { font-family: var(--font-mono); font-size: 14px; color: var(--ink-mute); }

/* ---- hi-fi walkthrough: image + explanation ---- */
.case-walk {
  display: flex;
  flex-direction: column;
  gap: 56px;
  margin: 28px 0 8px;
}
.walk-step {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.walk-copy { position: sticky; top: 100px; }
.walk-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.walk-title {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin-bottom: 14px;
}
.walk-copy p {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
}
.walk-copy p em { font-style: italic; color: var(--ink); }
.walk-media {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(20,20,25,0.04);
}
.walk-media img { width: 100%; height: auto; display: block; }

/* ---- demo video ---- */
.case-video {
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  line-height: 0;
}
.case-video video { width: 100%; height: auto; display: block; }

/* ---- RIGHT PROGRESS TICKS ---- */
.case-progress {
  position: sticky;
  top: 15vh;
  height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.progress-ticks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  padding: 8px 0;
  margin-top: 80px;
}
.tick {
  width: 26px;
  height: 10px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
}
.tick::before {
  content: '';
  display: block;
  width: 14px;
  height: 1.5px;
  background: var(--line);
  border-radius: 1px;
  transition: background 0.2s ease, width 0.2s ease;
}
.tick:hover::before { background: var(--ink-mute); width: 18px; }
.tick.near::before { background: var(--ink-mute); width: 18px; }
.tick.active::before { background: #2061E8; width: 24px; }

/* ---- responsive ---- */
@media (max-width: 1100px) {
  .case-wrap { grid-template-columns: 220px minmax(0, 1fr); }
  .case-progress { display: none; }
}
@media (max-width: 820px) {
  .case-wrap { grid-template-columns: 1fr; gap: 32px; }
  .case-toc {
    position: relative;
    top: 0;
    max-height: none;
    overflow: visible;
    border-bottom: 1px solid var(--line);
    padding-bottom: 24px;
  }
  .walk-step { grid-template-columns: 1fr; gap: 20px; }
  .walk-copy { position: static; }
}
@media (max-width: 560px) {
  .case-lifecycle { padding: 18px 16px; }
  .lc-step { font-size: 12px; padding: 6px 10px; }
}

/* ---- hi-fi scattered flow: alternating image + text ---- */
.hifi-flow {
  display: flex;
  flex-direction: column;
  gap: clamp(56px, 8vw, 110px);
  margin: 32px 0 8px;
}
.hifi-block { position: relative; }

/* side layouts: image + text in two columns */
.layout-side {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: center;
}
.layout-side.text-left  { grid-template-columns: 0.8fr 1.2fr; }
.layout-side.text-right { grid-template-columns: 1.2fr 0.8fr; }

/* top layout: text stacked above a wide centered image */
.layout-top { display: block; }
.layout-top .hifi-copy {
  text-align: center;
  max-width: 60ch;
  margin: 0 auto 24px;
}
.layout-top .hifi-media { width: 100%; }

.hifi-title {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(20px, 2.6vw, 26px);
  letter-spacing: -0.3px;
  color: var(--ink);
  margin-bottom: 12px;
}
.hifi-copy p {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
}
.hifi-media {
  margin: 0;
}
.hifi-media img { width: 100%; height: auto; display: block; }

@media (max-width: 720px) {
  .layout-side,
  .layout-side.text-left,
  .layout-side.text-right { grid-template-columns: 1fr; gap: 18px; }
  /* keep image below text on mobile regardless of desktop order */
  .layout-side.text-right .hifi-media { order: 2; }
  .layout-side.text-right .hifi-copy { order: 1; }
  .layout-top .hifi-copy { text-align: left; margin-bottom: 18px; }
}

/* ---- case footer (thanks + back link) ---- */
.case-foot {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.case-foot p {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-mute);
  margin-bottom: 6px;
}
.case-foot a {
  color: var(--ink);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.case-foot a:hover { color: var(--ink-soft); }
.case-foot a:visited { color: var(--ink); }

@media (max-width: 820px) {
  .case-wrap { grid-template-columns: 1fr; gap: 32px; }
  .case-toc { display: none; }
}