/* ==========================================================================
   Perennus — case studies (index + detail). Builds on landing.css.
   ========================================================================== */
.page-hero { padding: calc(var(--head-h) + clamp(48px, 7vw, 96px)) 0 clamp(40px, 5vw, 64px); text-align: center; }
.page-hero .wrap { display: grid; justify-items: center; max-width: 920px; }
.page-title { font-size: clamp(2.4rem, 1.2rem + 4.4vw, 4.4rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.042em; text-wrap: balance; }
.page-hero .sub { max-width: 52ch; }
.sec--flush { padding-top: 0; }
.chip--lilac { background: var(--lilac-t); color: var(--lilac-i); }
.case__art--blue { background: var(--acc-t); color: var(--acc-i); }

/* Index */
.work-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.case--lg .case__art { aspect-ratio: 16 / 9; padding: 28px; }
.case--lg .case__art b { font-size: clamp(3rem, 2rem + 3vw, 4.6rem); }
.case--lg .case__t { font-size: 1.375rem; }

/* Detail hero */
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9375rem; font-weight: 500; color: var(--fg-2); text-decoration: none; margin-bottom: 28px; padding: 4px 10px 4px 6px; border-radius: 8px; }
.crumb:hover { background: var(--wash); color: var(--fg); }
.arw--back { width: 16px; height: 16px; }
.cs__tag { margin-bottom: 18px; }
.cs__tag .chip { font-size: 0.8125rem; padding: 4px 10px; }
.cs__hero .page-title { font-size: clamp(2.2rem, 1.2rem + 3.6vw, 3.9rem); max-width: 20ch; }

.cs__stats { list-style: none; padding: 0; margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 1040px; }
.cs__stat { border-radius: 18px; padding: 24px 24px 22px; display: grid; align-content: start; gap: 2px; }
.cs__stat b { font-size: clamp(2.2rem, 1.6rem + 2vw, 3.2rem); font-weight: 700; letter-spacing: -0.045em; line-height: 1.05; }
.cs__stat s { font-size: 0.875rem; font-weight: 500; opacity: 0.75; text-decoration-color: currentColor; text-decoration-thickness: 1px; }
.cs__stat span { margin-top: 8px; font-size: 0.9375rem; line-height: 1.4; color: var(--fg-2); }
.cs__stat--blue { background: var(--acc-t); color: var(--acc-i); }
.cs__stat--green { background: var(--green-t); color: var(--green-i); }
.cs__stat--amber { background: var(--amber-t); color: var(--amber-i); }
.cs__stat--lilac { background: var(--lilac-t); color: var(--lilac-i); }

/* Body: rail + article */
.cs__body { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); padding-top: clamp(56px, 7vw, 96px); align-items: start; }
.cs__rail { position: sticky; top: calc(var(--head-h) + 24px); display: grid; gap: 16px; }
.glance { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.glance > div { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.glance dt { font-size: 0.8125rem; font-weight: 500; color: var(--fg-3); }
.glance dd { margin: 0; font-weight: 550; font-size: 0.9375rem; display: grid; }
.glance dd small { font-weight: 400; color: var(--fg-3); font-size: 0.8125rem; }
.glance__chips { display: flex !important; flex-wrap: wrap; gap: 6px; }
.rail-cta { background: var(--wash); border-radius: 16px; padding: 18px; display: grid; gap: 8px; }
.rail-cta p { font-size: 0.875rem; color: var(--fg-2); margin-bottom: 6px; }
.rail-cta b { display: block; color: var(--fg); font-size: 0.9375rem; margin-bottom: 2px; }
.rail-cta .btn { justify-content: center; }

.cs__main { max-width: 720px; display: grid; gap: clamp(48px, 6vw, 72px); }
.cs__sec > .kicker { margin-bottom: 10px; }
.cs__h { font-size: clamp(1.6rem, 1.2rem + 1.3vw, 2.25rem); font-weight: 700; letter-spacing: -0.032em; line-height: 1.12; text-wrap: balance; margin-bottom: 18px; }
.cs__sec > p { font-size: 1.0625rem; line-height: 1.65; color: var(--fg-2); }
.cs__sec > p + p { margin-top: 14px; }
.cs__note { margin-top: 18px; font-size: 0.9375rem !important; color: var(--fg-3) !important; }

.finds { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.finds li { display: grid; grid-template-columns: 32px 1fr; gap: 16px; padding: 18px 20px; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); }
.finds__n { width: 28px; height: 28px; border-radius: 50%; background: var(--red-t); color: var(--red-i); font-size: 0.8125rem; font-weight: 700; display: grid; place-items: center; }
.finds h3, .steps2 h3 { font-size: 1.0625rem; font-weight: 650; letter-spacing: -0.015em; }
.finds p, .steps2 p { margin-top: 4px; color: var(--fg-2); font-size: 0.9375rem; line-height: 1.55; }

.steps2 { list-style: none; padding: 0; margin: 0; display: grid; position: relative; }
.steps2::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 2px; background: var(--line-2); }
.steps2 li { display: grid; grid-template-columns: 14px 1fr; gap: 20px; padding: 10px 0 14px; position: relative; }
.steps2__dot { width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px var(--green); margin-top: 4px; position: relative; }
.steps2 li:last-child .steps2__dot { background: var(--green); }

.nums { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.nums li { background: var(--wash); border-radius: 14px; padding: 16px; display: grid; gap: 4px; }
.nums b { font-size: 1.625rem; font-weight: 700; letter-spacing: -0.035em; }
.nums span { font-size: 0.8125rem; color: var(--fg-2); line-height: 1.35; }
.nums .is-hot { background: var(--green-t); color: var(--green-i); }
.nums .is-hot span { color: var(--green-i); }

.ba { border-radius: 14px; box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.ba__row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, .7fr) minmax(0, .7fr) minmax(0, 1.3fr); gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); align-items: center; font-size: 0.9375rem; }
.ba__row--3, .ba__head:not(:has(span:nth-child(4))) { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); }
.ba__head { border-top: 0; background: #FBFBFA; font-size: 0.8125rem; color: var(--fg-3); font-weight: 500; }
.ba__m { font-weight: 550; }
.ba__b { color: var(--fg-3); }
.ba__a { font-weight: 700; color: var(--green-i); }
.ba__s { font-size: 0.8125rem; color: var(--fg-3); }

.delivered { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.delivered li { display: flex; gap: 10px; font-size: 0.9375rem; color: var(--fg); }
.delivered li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--green-t) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='m5.4 9.2 2.3 2.3 4.8-5' fill='none' stroke='%230D7A46' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; }

.own { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; margin-top: 24px; }
.own__box { border-radius: 16px; padding: 20px; display: grid; gap: 4px; }
.own__box b { font-size: 1.125rem; letter-spacing: -0.02em; }
.own__box span { font-size: 0.875rem; }
.own__k { font-weight: 600; opacity: .8; }
.own__box--blue { background: var(--acc-t); color: var(--acc-i); }
.own__box--green { background: var(--green-t); color: var(--green-i); }
.own__rule { writing-mode: horizontal-tb; text-align: center; max-width: 150px; font-size: 0.8125rem; font-weight: 650; color: var(--red-i); background: var(--red-t); border-radius: 10px; padding: 10px 12px; }

.tiers { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tier { border-radius: 14px; padding: 16px; display: grid; gap: 4px; background: var(--wash); }
.tier b { font-size: 1.125rem; }
.tier span { font-size: 0.875rem; color: var(--fg-2); }
.tier em { font-style: normal; font-size: 0.75rem; font-weight: 600; margin-top: 6px; }
.tier::before { content: ""; width: 12px; height: 12px; border-radius: 50%; margin-bottom: 6px; }
.tier--red { background: var(--red-t); } .tier--red::before { background: var(--red); } .tier--red em { color: var(--red-i); }
.tier--orange { background: #FFF1E6; } .tier--orange::before { background: #F07A1A; } .tier--orange em { color: #B4530A; }
.tier--yellow::before { background: var(--amber); }
.tier--acc::before { background: var(--acc); }

.cs__fig { margin: 0; background: var(--wash); border-radius: 18px; padding: clamp(10px, 2vw, 20px); }
.cs__fig img { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 0 0 1px var(--line), 0 12px 32px -18px rgba(20,16,12,.3); background: #fff; }
.cs__fig--narrow img { max-width: 420px; margin: 0 auto; }
.cs__fig figcaption { margin-top: 12px; font-size: 0.8125rem; color: var(--fg-3); text-align: center; }

.cs__quote { margin: 0; background: var(--wash); border-radius: 20px; padding: clamp(24px, 4vw, 40px); }
.cs__quote blockquote p { font-size: clamp(1.2rem, 1rem + 0.7vw, 1.5rem); font-weight: 550; letter-spacing: -0.02em; line-height: 1.4; }
.cs__quote blockquote p::before { content: "“"; } .cs__quote blockquote p::after { content: "”"; }
.cs__quote figcaption { margin-top: 20px; display: flex; align-items: center; gap: 12px; font-size: 0.9375rem; color: var(--fg-2); }
.cs__quote figcaption img, .cs__quote .q__init { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: top; flex: none; }
.cs__quote figcaption > span { display: grid; }
.cs__quote b { color: var(--fg); font-weight: 600; }
.cs__quote em { font-style: normal; color: var(--amber-i); font-size: 0.8125rem; font-weight: 500; }

.cs__take { border-left: 3px solid var(--acc); padding: 4px 0 4px 24px; }
.cs__take > p:last-child { font-size: clamp(1.2rem, 1rem + 0.8vw, 1.6rem); font-weight: 600; letter-spacing: -0.024em; line-height: 1.35; text-wrap: pretty; }
.more { padding-bottom: clamp(64px, 7vw, 96px); }
.more .cases { margin-top: 0; }

@media (max-width: 1080px) {
  .cs__body { grid-template-columns: minmax(0, 1fr); }
  .cs__rail { position: static; order: 2; }
  .cs__main { max-width: none; }
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
}
@media (max-width: 759px) {
  .work-grid, .cs__stats, .cases { grid-template-columns: minmax(0, 1fr); }
  .nums, .tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivered { grid-template-columns: minmax(0, 1fr); }
  .own { grid-template-columns: minmax(0, 1fr); }
  .own__rule { max-width: none; }
  .glance { grid-template-columns: minmax(0, 1fr); }
  .ba__row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .ba__s { grid-column: 1 / -1; margin-top: -6px; }
  .ba__head span:nth-child(4) { display: none; }
  .finds li { padding: 16px; grid-template-columns: 28px 1fr; gap: 12px; }
}

/* Colour discipline on case pages */
.cs__stat, .cs__stat--blue, .cs__stat--green, .cs__stat--amber, .cs__stat--lilac { background: var(--wash); color: var(--fg); }
.cs__stat b { color: var(--fg); }
.cs__tag .chip { background: var(--acc-t); color: var(--acc-i); }
.own__box--blue { background: var(--wash); color: var(--fg); }
.own__box--green { background: var(--wash); color: var(--fg); }
.own__box .own__k { color: var(--fg-3); opacity: 1; }
.nf { min-height: 70vh; display: grid; align-content: center; }
