/* QLOGIX "Quarter" - the case studies index (/case-studies/). Loaded after ../styles.css and ../sub.css.
   The page's own idea: four jobs as editorial rows, the drawing on one side and the story on the other, alternating.
   Each row reads challenge, solution, then its one result, set big. The whole row is the link to the full case
   study (the title's link is stretched over it); on hover the drawing leans in, a quarter grows from its corner and
   the title gets its bar. Prefix csi-. */

/* ---------- hero: the title across the width, then the lead and an index of the four cases ---------- */
.csi-hero { padding-bottom: clamp(56px, 7vw, 112px); }
.csi-hero__h1 { font-size: clamp(3rem, min(8.6vw, 13.5vh), 8.75rem); -webkit-hyphens: manual; hyphens: manual; } /* the full width: the homepage hero's scale */
.csi-hero__h1 em { display: block; }
.csi-hero .sp-crumbs a { position: relative; }
.csi-hero .sp-crumbs a::before { content: ""; position: absolute; inset: -10px -8px; } /* a 44px target without moving the line */
.csi-hero__foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 32px clamp(32px, 6vw, 112px); align-items: start; margin-top: clamp(30px, 4.4vw, 64px); }
.csi-hero__lead { margin-top: 0; }
.js .csi-toc[data-reveal] { transition-delay: .2s; }

.csi-toc ol { border-top: 1.5px solid var(--navy-200); }
.csi-toc li { border-bottom: 1.5px solid var(--navy-200); }
.csi-toc a { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) 24px; align-items: center; gap: 14px; min-height: 64px; padding-block: 12px; text-decoration: none; }
.csi-toc__n { font-family: var(--display); font-weight: 600; font-size: 1.0625rem; color: var(--brand-700); font-variant-numeric: tabular-nums; }
.csi-toc__t { display: grid; gap: 2px; }
.csi-toc b { font-family: var(--display); font-weight: 650; font-size: clamp(1.125rem, 1.45vw, 1.3125rem); line-height: 1.2; letter-spacing: -.015em; transition: color .3s; }
.csi-toc small { font-size: .875rem; line-height: 1.35; color: var(--muted); }
.csi-toc .arr { justify-self: center; transform: rotate(90deg); }                     /* points down the page */
@media (hover: hover) {
  .csi-toc a:hover b { color: var(--brand-700); }
  .csi-toc a:hover .arr { transform: rotate(90deg) translateX(5px); }
}

/* ---------- the four cases ---------- */
/* a pale band with the quarter corner top-left; it runs on under the closing band so that band's own corner
   (top-right) shows this ground, not the white page */
.csi-list {
  background: var(--navy-50); border-radius: var(--q) 0 0 0;
  padding-block: var(--sec) calc(var(--sec) + var(--q)); margin-bottom: calc(-1 * var(--q));
}
.csi-cases { display: grid; gap: clamp(88px, 10vw, 168px); }
.csi-case { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px clamp(32px, 5.6vw, 104px); align-items: center; }
.csi-case:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.csi-case:nth-child(even) .csi-case__fig { order: 2; }

.csi-case__fig { aspect-ratio: 5 / 4; border-radius: var(--r) var(--q) var(--r) var(--r); isolation: isolate; }
.csi-case__fig > svg { transition: transform 1.2s var(--ease); }
/* the quarter: grows from the drawing's bottom-left corner on hover, like the fill of a button */
.csi-case__q {
  position: absolute; left: 0; bottom: 0; z-index: 1; width: clamp(96px, 10vw, 148px); aspect-ratio: 1;
  border-radius: 0 100% 0 0; background: var(--brand-400); color: var(--navy-950);
  transform: scale(0); transform-origin: 0 100%; transition: transform .6s var(--ease);
}
.csi-case__q .arr { position: absolute; left: 22%; bottom: 31%; width: 28px; }

.csi-case__txt { display: grid; gap: clamp(16px, 1.8vw, 24px); align-content: center; }
.csi-case__tag { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .8125rem; font-weight: 600; letter-spacing: .04em; line-height: 1.5; color: var(--brand-700); }
.csi-case__tag span { color: var(--navy-950); font-variant-numeric: tabular-nums; white-space: nowrap; }
.csi-case__h {
  font-family: var(--display); font-weight: 750; font-size: clamp(2rem, 3.5vw, 3.5rem); line-height: 1.02; letter-spacing: -.032em;
  font-variation-settings: "opsz" 96; text-wrap: balance; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto;
}
.csi-case__h a {
  text-decoration: none; padding-bottom: .04em;
  background: linear-gradient(var(--brand-400), var(--brand-400)) 0 100% / 0 .09em no-repeat; transition: background-size .7s var(--ease);
}
.csi-case__h a::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: var(--r); } /* the whole row is the link */
.csi-case__h a:focus-visible { outline: none; }
.csi-case__h a:focus-visible::after { outline: 3px solid var(--navy-950); outline-offset: 12px; }

/* challenge and solution: side by side when the column is wide enough, stacked otherwise */
.csi-case__cq { container-type: inline-size; }
.csi-case__cs { display: grid; gap: 18px; }
.csi-case__cs > div { display: grid; gap: 8px; align-content: start; padding-top: 14px; border-top: 1.5px solid var(--navy-200); }
.csi-case__cs dt { font-size: .8125rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; line-height: 1.5; color: var(--brand-700); }
.csi-case__cs dd { font-size: 1.0625rem; line-height: 1.55; color: var(--muted); }
@container (min-width: 33rem) {
  .csi-case__cs { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(20px, 2.4vw, 36px); }
}

/* the result: one figure, big, on a navy rule that starts with the logo bar */
.csi-case__res { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 28px; margin-top: clamp(4px, .8vw, 10px); padding-top: clamp(20px, 2.2vw, 28px); }
.csi-case__res::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1.5px; background: var(--navy-900); transform-origin: 0 50%; }
.csi-case__res::after { content: ""; position: absolute; left: 0; top: -2.25px; width: 34px; height: 6px; background: var(--brand-400); border-radius: 1px; }
.csi-case__res p { display: grid; gap: 8px; }
.csi-case__res b { font-family: var(--display); font-weight: 800; font-size: clamp(3.4rem, 6.2vw, 6.25rem); line-height: .86; letter-spacing: -.045em; font-variation-settings: "opsz" 96; color: var(--navy-950); }
.csi-case__res b small { margin-left: .05em; font-size: .5em; letter-spacing: -.02em; }
.csi-case__res p span { font-weight: 600; line-height: 1.3; color: var(--navy-900); }
.csi-case__go { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; margin-right: 6px; font-weight: 600; color: var(--brand-700); } /* room for the arrow's move */
.csi-case__go .arr { transition: transform .4s var(--ease); }

/* entrance: the row rises (data-reveal), its drawing starts, then the result's rule draws in */
.js .csi-case[data-reveal] .csi-case__res::before { transform: scaleX(0); transition: transform 1.1s .45s var(--ease-in-out); }
.js .csi-case.is-seen .csi-case__res::before { transform: none; }

/* hover (and keyboard focus): the drawing leans in, the quarter grows, the title gets its bar, the arrow moves on */
.csi-case:focus-within .csi-case__fig > svg { transform: scale(1.05); }
.csi-case:focus-within .csi-case__q { transform: scale(1); }
.csi-case:focus-within .csi-case__h a { background-size: 100% .09em; }
.csi-case:focus-within .csi-case__go .arr { transform: translateX(6px); }
@media (hover: hover) {
  .csi-case:hover .csi-case__fig > svg { transform: scale(1.05); }
  .csi-case:hover .csi-case__q { transform: scale(1); }
  .csi-case:hover .csi-case__h a { background-size: 100% .09em; }
  .csi-case:hover .csi-case__go .arr { transform: translateX(6px); }
}

/* ---------- closing band: the accent phrase on its own line, the live reply time under the lead ---------- */
.csi-cta .h2 em { display: block; }
.csi-cta__by { display: block; margin-top: 4px; font-weight: 700; font-variant-numeric: tabular-nums; }
.csi-cta__by:empty { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .csi-hero__foot { grid-template-columns: minmax(0, 1fr); }
  .csi-toc { max-width: 640px; }
  .csi-case, .csi-case:nth-child(even) { grid-template-columns: minmax(0, 1fr); }
  .csi-case:nth-child(even) .csi-case__fig { order: 0; }
  .csi-case__fig { aspect-ratio: 16 / 10; } /* the drawings keep what matters within y 130-670 (art/SPEC.md) */
  .csi-case__h { font-size: clamp(2rem, 5vw, 3rem); }
}
@media (max-width: 640px) {
  .csi-hero__h1 { -webkit-hyphens: auto; hyphens: auto; } /* "Herausforderungen." is wider than a phone */
  .csi-cases { gap: 72px; }
  .csi-case__fig { aspect-ratio: 4 / 3; }
  .csi-case__res { flex-direction: column; align-items: flex-start; }
  .csi-case__h a:focus-visible::after { outline-offset: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .csi-case:is(:hover, :focus-within) .csi-case__fig > svg { transform: none; }
}

@media print {
  .csi-list { border-radius: 0; margin-bottom: 0; padding-bottom: var(--sec); background: none; }
  .csi-case { break-inside: avoid; }
  .csi-case__q, .csi-case__go, .csi-toc .arr { display: none; }
  .js .csi-case[data-reveal] .csi-case__res::before { transform: none; }
}
