/* Case study pages: a stamped entry on a paper sheet.
   Loaded after site.css. */

.cs-top { background: linear-gradient(180deg, #cfdede, var(--sky)); }

.cs-progress {
  position: fixed;
  z-index: 50;
  left: 0; right: 0; top: 0;
  height: 3px;
  pointer-events: none;
  --p: 0;
}
.cs-progress span {
  position: absolute;
  inset: 0;
  background: var(--ver);
  transform-origin: left;
  transform: scaleX(var(--p));
}
.cs-progress svg {
  position: absolute;
  top: -9px;
  left: calc(var(--p) * 100% - 12px);
  width: 20px;
  height: 20px;
  transform: rotate(35deg);
  filter: drop-shadow(0 2px 2px rgba(27, 37, 40, .3));
}
@media (prefers-reduced-motion: reduce) { .cs-progress { display: none; } }

.cs-head {
  position: relative;
  background: linear-gradient(180deg, var(--sky) 0%, #e3eae7 100%);
  padding: clamp(16px, 4vw, 40px) 0 clamp(56px, 9vw, 100px);
}
.cs-head__inner { max-width: calc(820px + var(--gutter) * 2); }
.cs-head__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.cs-head__row .stamp { font-size: .64rem; }
.cs-head__row .stamp strong { font-size: 1.15rem; }
.cs-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--mono);
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
}
.cs-back:hover { text-decoration: underline; text-underline-offset: 4px; }
.cs-head .label { margin-bottom: 10px; color: var(--slate-3); }
.cs-title {
  font-size: clamp(2rem, 1.3rem + 3.4vw, 3.5rem);
  font-weight: 450;
  line-height: 1.08;
  letter-spacing: -.018em;
  font-variation-settings: "SOFT" 60, "WONK" 1;
}
.cs-standfirst {
  margin: 18px 0 0;
  font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem);
  line-height: 1.5;
  color: var(--slate-4);
  max-width: 40rem;
}
.cs-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 0;
  color: var(--ink-2);
}
.cs-meta img { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--card); box-shadow: var(--shadow-1); }
.cs-meta .mono { font-size: .72rem; letter-spacing: .06em; }

.sheet {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: calc(clamp(56px, 9vw, 100px) * -1 + 24px) auto 0;
  padding: clamp(28px, 5vw, 60px) clamp(20px, 5vw, 64px) clamp(28px, 5vw, 52px);
  background: var(--card);
  box-shadow: var(--shadow-3);
  border-radius: 2px;
}
.sheet.tape::before { width: 110px; margin-left: -55px; top: -12px; }

.cs-intro {
  margin: 0 0 1.6em;
  padding: 0 0 1.4em;
  border-bottom: 2px dashed rgba(27, 37, 40, .16);
  font-style: italic;
  font-size: 1.12rem;
  color: var(--ink-2);
}

.prose { font-size: clamp(1.06rem, 1rem + .25vw, 1.16rem); line-height: 1.72; }
.prose p { margin: 0 0 1.15em; max-width: 38em; }
.prose a { color: var(--ver-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose h2 {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 2.1em 0 .8em;
  font-size: clamp(1.35rem, 1.15rem + .9vw, 1.7rem);
  font-weight: 500;
  line-height: 1.2;
}
.prose h2:first-child { margin-top: 0; }
.prose__plain { padding-top: 1.2em; border-top: 2px dashed rgba(27, 37, 40, .16); }
.prose__n {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-top: -3px;
  border: 2px solid var(--ver);
  border-radius: 50%;
  color: var(--ver-ink);
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 500;
  transform: rotate(-8deg);
}

.cs-ext { max-width: 280px; margin: 2em 0 0; }
.cs-disclosure {
  margin: 2.4em 0 0;
  padding-top: 1.2em;
  border-top: 1px solid rgba(27, 37, 40, .14);
  font-size: .88rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.cs-pager {
  display: grid;
  gap: 16px;
  max-width: 820px;
  margin: clamp(36px, 6vw, 60px) auto 0;
}
@media (min-width: 640px) { .cs-pager { grid-template-columns: 1fr 1fr; } }
.cs-pager__card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 92px;
  padding: 18px 20px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  border-radius: 10px;
  box-shadow: var(--shadow-2);
  border-left: 5px solid var(--slate-2);
  transform: rotate(-.5deg);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.cs-pager__card.is-next { text-align: right; border-left: 0; border-right: 5px solid var(--ver); transform: rotate(.5deg); }
.cs-pager__card:hover { transform: rotate(0) translateY(-3px); box-shadow: var(--shadow-3); }
.cs-pager__card.is-empty { visibility: hidden; }
.cs-pager__title { font-size: 1.15rem; font-weight: 520; line-height: 1.25; }
.cs-all { max-width: 820px; margin: 12px auto clamp(56px, 9vw, 96px); text-align: center; }

.foot--small { padding-top: clamp(48px, 7vw, 80px); }

/* Hub */
.cs-head--hub { padding-bottom: clamp(56px, 8vw, 90px); }
.hub { padding-top: clamp(40px, 6vw, 72px); }
.hub .entry { min-height: 190px; }
