/* Case study page. Section numbers come from a CSS counter, so hidden [ADD] sections leave no gap. */

main {
  counter-reset: sec;
}

.crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 14px 72px;
  list-style: none;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
}

.crumb li + li::before {
  content: '›';
  margin-right: 8px;
}

.crumb a:hover {
  color: var(--text);
}

.crumb [aria-current] {
  color: var(--text);
}

.head {
  padding: 88px 72px 72px;
  border-bottom: 1px solid var(--line);
}

.head .kick {
  font-size: 13px;
}

.h1 {
  margin: 18px 0 0;
  font-size: clamp(56px, 12cqi, 160px);
  line-height: 0.88;
  font-weight: 850;
  font-stretch: 118%;
  letter-spacing: -0.05em;
}

.h1 b {
  color: var(--accent);
  font-weight: 850;
}

.head .lede {
  font-size: 22px;
  max-width: 58ch;
  margin-top: 32px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 56px 0 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.facts > div {
  padding: 20px 22px;
  border-right: 1px solid var(--line);
}

.facts > div:last-child {
  border-right: 0;
}

.facts dt {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--key);
  margin-bottom: 8px;
}

.facts dd {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
}

.sec {
  padding: 96px 72px;
  counter-increment: sec;
}

.sec-head {
  margin-bottom: 24px;
}

.sec-head .n::before {
  content: counter(sec, decimal-leading-zero);
}

.h2 {
  font-size: clamp(32px, 4.8cqi, 60px);
  line-height: 1;
  max-width: 18ch;
}

.p {
  font-size: 19px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 62ch;
  margin: 20px 0 0;
}

.feat {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 56px 0 0;
  padding: 0;
  list-style: none;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.feat li {
  background: var(--panel);
  padding: 28px 26px 30px;
}

.feat .fn {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}

.feat h3 {
  margin: 14px 0 8px;
  font-size: 22px;
  font-weight: 700;
  font-stretch: 108%;
  letter-spacing: -0.01em;
}

.feat p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
}

.feat .new {
  color: var(--str);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: 8px;
  white-space: nowrap;
}

.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 36px;
  margin: 56px 0 0;
  padding: 0;
  list-style: none;
}

.node {
  position: relative;
  flex: 1 1 150px;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 18px;
}

.node:not(:last-child)::after {
  content: '→';
  position: absolute;
  top: 50%;
  right: -36px;
  width: 36px;
  text-align: center;
  transform: translateY(-50%);
  color: var(--dim);
}

.node .nn {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
}

.node b {
  display: block;
  margin: 10px 0 6px;
  font-size: 18px;
  font-weight: 700;
  font-stretch: 108%;
}

.node span:last-child {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.node.hl {
  border-color: color-mix(in srgb, var(--str) 55%, transparent);
  background: color-mix(in srgb, var(--str) 7%, var(--panel));
}

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

.shot {
  margin: 56px 0 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
}

.shot-bar {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}

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

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 56px;
}

.stat {
  border-top: 2px solid var(--accent);
  padding-top: 20px;
}

.stat .big {
  font-size: 64px;
  line-height: 1;
  font-weight: 850;
  font-stretch: 115%;
  letter-spacing: -0.04em;
}

.stat .lbl {
  display: block;
  margin-top: 12px;
  font-size: 16px;
  color: var(--muted);
}

.next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 72px;
}

.next .label {
  font-size: 14px;
  color: var(--dim);
}

.next .t {
  font-size: clamp(36px, 6.7cqi, 88px);
  font-weight: 850;
  font-stretch: 118%;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.next .t:hover {
  color: var(--accent);
}

@container site (max-width: 980px) {
  .crumb,
  .head,
  .sec,
  .next {
    padding-left: 24px;
    padding-right: 24px;
  }

  .sec {
    padding-top: 72px;
    padding-bottom: 72px;
  }

  .head .lede {
    font-size: 18px;
  }

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

  .facts > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .facts > div:last-child {
    border-bottom: 0;
  }

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

  .flow {
    flex-direction: column;
    gap: 32px;
  }

  .node {
    flex: none;
  }

  .node:not(:last-child)::after {
    top: auto;
    bottom: -32px;
    right: 0;
    left: 0;
    width: auto;
    height: 32px;
    line-height: 32px;
    transform: none;
    content: '↓';
  }

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

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