/* ==========================================================================
   case-study.css — layout for the four case study pages.
   Tokens, nav, menu, buttons and footer come from style.css.
   ========================================================================== */

.cs-layout {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(2rem, 4vw, 4.5rem);
  max-width: 1180px; margin: 0 auto; padding: clamp(104px, 9vw, 150px) var(--gutter) clamp(3rem, 6vw, 6rem);
}

/* ---- sidebar ---- */
.cs-sidebar { position: sticky; top: 112px; align-self: start; }
.cs-back { display: inline-flex; align-items: center; gap: .45rem; font-family: var(--hand); font-size: 1.2rem; color: var(--berry); margin-bottom: 1.4rem; }
.cs-back:hover { color: var(--ink); }
.cs-nav { display: flex; flex-direction: column; border-left: 2px solid var(--beige); }
.cs-nav a { padding: .4rem 0 .4rem .95rem; margin-left: -2px; border-left: 2px solid transparent; font-size: .9rem; color: var(--ink-soft); transition: color .2s, border-color .2s; }
.cs-nav a:hover { color: var(--ink); }
.cs-nav a.active { color: var(--ink); font-weight: 600; border-left-color: var(--berry); }

/* ---- header ---- */
.cs-eyebrow { font-family: var(--hand); font-size: clamp(18px, 1.4vw, 24px); color: var(--berry); margin: 3.4rem 0 .5rem; line-height: 1.1; }
.cs-main > .cs-eyebrow:first-child { margin-top: 0; }
.cs-title {
  font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: -.03em; line-height: .9;
  font-size: clamp(46px, 6.6vw, 108px); max-width: 15ch; margin: 0 0 2rem; color: var(--ink);
}
.cs-hero { border-radius: clamp(16px, 1.8vw, 28px); margin-bottom: 2.5rem; overflow: hidden; background: var(--beige); }
.cs-hero img { width: 100%; height: auto; max-height: 72vh; object-fit: contain; display: block; margin: 0 auto; }

.cs-meta-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; padding-bottom: 2.4rem; border-bottom: 2px solid var(--ink); margin-bottom: 1rem; }
.cs-meta-label { display: block; font-family: var(--hand); font-size: 1.05rem; color: var(--berry); margin-bottom: .2rem; line-height: 1.1; }
.cs-meta-value { font-size: .95rem; line-height: 1.5; color: var(--ink); font-weight: 500; }

.cs-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; padding: 1.4rem; margin: 1.6rem 0 1rem; border: 2px solid var(--ink); border-radius: 18px; background: var(--lbeige); }
.cs-main .cs-summary p { margin: 0; font-size: .88rem; line-height: 1.5; color: var(--ink); }

/* ---- type in the body ---- */
.cs-main section { padding-top: 1rem; }
.cs-main h2 { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: -.025em; line-height: .95; font-size: clamp(32px, 3.7vw, 58px); max-width: 22ch; margin: 0 0 1rem; color: var(--ink); }
.cs-main h3 { font-family: var(--ui); font-weight: 600; font-size: 1.08rem; line-height: 1.3; margin: 1.6rem 0 .45rem; color: var(--ink); }
.cs-main p { font-size: clamp(16px, 1.05vw, 18px); line-height: 1.7; max-width: 64ch; margin: 0 0 1.05rem; color: var(--ink-body); }
.cs-main p strong { color: var(--ink); }
.cs-intro { font-size: clamp(18px, 1.3vw, 22px) !important; line-height: 1.5 !important; color: var(--ink) !important; }
.cs-main ul.cs-list { list-style: none; margin: 1rem 0 1.4rem; padding: 0; display: grid; gap: .8rem; max-width: 64ch; }
.cs-main ul.cs-list li { position: relative; padding-left: 2rem; line-height: 1.6; }
.cs-main ul.cs-list li::before { content: "\2726"; position: absolute; left: 0; top: .05rem; color: var(--berry); }

.cs-col-2, .cs-col-3 { display: grid; gap: 1.5rem; margin: 1.5rem 0 2rem; }
.cs-col-2 { grid-template-columns: repeat(2, 1fr); }
.cs-col-3 { grid-template-columns: repeat(3, 1fr); }
.cs-col-2 > div, .cs-col-3 > div { padding: 1.2rem 1.3rem; border: 2px solid var(--ink); border-radius: 16px; background: var(--lbeige); }
.cs-col-2 h3, .cs-col-3 h3 { margin-top: 0; }
.cs-main .cs-col-2 p, .cs-main .cs-col-3 p { font-size: .92rem; margin: 0; max-width: none; }

.tag-before, .tag-after { display: inline-block; font-family: var(--hand); font-size: 1.1rem; padding: .05rem .7rem; border-radius: 999px; margin-bottom: .3rem; }
.tag-before { background: var(--beige); color: var(--plum); }
.tag-after { background: var(--sun); color: var(--ink); }

/* ---- figures ---- */
.cs-flow-row { margin-bottom: 2.75rem; }
.cs-flow-img { border-radius: clamp(12px, 1.4vw, 22px); overflow: hidden; background: var(--beige); margin-bottom: 1.1rem; }
.cs-flow-img img, .cs-img-full { width: 100%; height: auto; display: block; }
.cs-img-full { border-radius: clamp(12px, 1.4vw, 22px); margin: 1.4rem 0 1.8rem; background: var(--beige); }
.cs-flow-copy p { margin: 0; }
figure.cs-figure { margin: 1.6rem 0 2.2rem; }
figure.cs-figure img { width: 100%; height: auto; display: block; border-radius: clamp(12px, 1.4vw, 22px); background: var(--beige); border: 2px solid var(--ink); }
figure.cs-figure figcaption { font-family: var(--hand); font-size: 1.1rem; color: var(--ink-soft); margin-top: .6rem; }
.cs-figure-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cs-figure-pair figure.cs-figure { margin: 0; }

.cs-quote { border-left: 4px solid var(--berry); padding: .2rem 0 .2rem 1.3rem; margin: 1.6rem 0; font-family: var(--display); font-weight: 500; font-size: clamp(24px, 2.4vw, 38px); line-height: 1.08; max-width: 30ch; color: var(--ink); text-transform: none; }

.cs-diagram-box { background: var(--beige); border-radius: 18px; padding: 1.5rem; margin: 1.5rem 0 2rem; }
.cs-diagram-caption { display: block; font-family: var(--hand); font-size: 1.1rem; color: var(--plum); margin-bottom: .9rem; }
.cs-diagram-row { display: flex; flex-wrap: wrap; gap: .7rem; }
.cs-diagram-chip { background: var(--cream); border: 2px solid var(--ink); border-radius: 12px; padding: .55rem 1rem; font-size: .88rem; font-weight: 500; color: var(--ink); }
.cs-diagram-chip--accent { background: var(--sun); }

/* big numbers */
.cs-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.6rem 0 2rem; }
.cs-stat { border: 2px solid var(--ink); border-radius: 18px; padding: 1.3rem 1.2rem; background: var(--lbeige); text-align: center; }
.cs-stat:nth-child(2) { background: var(--sun); }
.cs-stat .n { display: block; font-family: var(--display); font-weight: 600; font-size: clamp(44px, 5vw, 80px); line-height: .9; letter-spacing: -.03em; color: var(--ink); }
.cs-stat p { margin: .5rem 0 0 !important; font-size: .85rem !important; line-height: 1.35 !important; max-width: none !important; }

/* code blocks (QA case study) */
.cs-code { background: var(--ink); color: var(--cream); border-radius: 16px; padding: 1.1rem 1.3rem 1.3rem; margin: 1.4rem 0 1.8rem; overflow-x: auto; }
.cs-code .cap { display: block; font-family: var(--hand); font-size: 1.05rem; color: var(--sun); margin-bottom: .7rem; }
.cs-code pre { margin: 0; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .82rem; line-height: 1.6; white-space: pre; color: #f3dfe9; }
.cs-code .c { color: #bfa0b3; }

/* the typographic hero used where there is no screenshot */
.cs-bigword { font-family: var(--display); font-weight: 700; font-size: clamp(120px, 22vw, 340px); line-height: .78; letter-spacing: -.05em; color: var(--beige); text-transform: uppercase; margin: -.6rem 0 1.2rem; user-select: none; }

/* ---- next case study ---- */
.next-case { background: var(--ink); color: var(--cream); padding: max(8vw, 72px) var(--gutter); border-radius: 0 0 clamp(20px, 3vw, 48px) clamp(20px, 3vw, 48px); position: relative; overflow: hidden; }
.next-case .eyebrow { color: var(--sun); }
.next-case h2 { color: var(--cream); margin: .4rem 0 1.6rem; max-width: 14ch; }
.next-case p { color: var(--cream-soft); max-width: 40ch; margin: 0 0 1.6rem; font-size: clamp(16px, 1.2vw, 20px); }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .cs-layout { grid-template-columns: minmax(0, 1fr); padding-top: 104px; }
  .cs-main { min-width: 0; }
  .cs-sidebar { position: static; }
  .cs-nav { display: none; }               /* section links are hidden on small screens; only "Back" remains */
  .cs-meta-row { grid-template-columns: 1fr 1fr; gap: 1.4rem 1rem; }
  .cs-summary { grid-template-columns: 1fr 1fr; }
  .cs-col-3 { grid-template-columns: 1fr; }
  .cs-col-2 { grid-template-columns: 1fr; }
  .cs-stats { grid-template-columns: 1fr; }
  .cs-figure-pair { grid-template-columns: 1fr; }
  .cs-title { max-width: none; }
}
@media (max-width: 400px) {
  .cs-meta-row, .cs-summary { grid-template-columns: 1fr; }
}

/* two typefaces: labels and captions in Inter */
.cs-back { font-family: var(--ui); font-weight: 600; font-size: .95rem; }
.cs-eyebrow, .cs-meta-label, .cs-diagram-caption, .cs-code .cap {
  font-family: var(--ui); font-weight: 600; font-size: clamp(11.5px, .82vw, 13.5px); letter-spacing: .1em; text-transform: uppercase; }
.cs-meta-label { margin-bottom: .35rem; }
.tag-before, .tag-after { font-family: var(--ui); font-weight: 600; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; padding: .2rem .7rem; }
figure.cs-figure figcaption { font-family: var(--ui); font-size: .88rem; }

/* VC Henrietta headings: sentence case, scaled for its width */
.cs-title, .cs-main h2 { font-weight: 700; text-transform: none; letter-spacing: -.012em; }
.cs-title { font-size: clamp(34px, 4.6vw, 78px); line-height: 1.02; max-width: 18ch; }
.cs-main h2 { font-size: clamp(25px, 2.7vw, 42px); line-height: 1.08; }
.art-title { font-size: clamp(32px, 3.8vw, 58px); max-width: 20ch; }
.cs-main.art h2 { font-size: clamp(24px, 2.4vw, 36px); }
.cs-main .cs-quote { font-size: clamp(21px, 1.9vw, 30px); line-height: 1.2; }
.cs-stat .n { font-size: clamp(34px, 3.4vw, 58px); }
.cs-bigword { font-size: clamp(100px, 16vw, 260px); }
.cs-main p { font-size: clamp(15px, .98vw, 17px); }
.cs-main p, .cs-main li { font-family: var(--body); font-size: clamp(16px, 1.05vw, 18px); line-height: 1.7; }
.cs-main p.cs-eyebrow, .cs-main p.art-byline, .cs-main figcaption, .cs-main .tag-before, .cs-main .tag-after { font-family: var(--ui); }

/* ---- payslip: my role ---- */
.cs-role { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; margin: 1.4rem 0 1rem; }
.cs-role > div { padding: 1.2rem 1.3rem; border: 2px solid var(--ink); border-radius: 16px; background: var(--lbeige); }
.cs-main .cs-role ul.cs-list { margin: .4rem 0 0; }
.cs-main .cs-role li { font-size: .95rem; }

/* ---- payslip: mobile screens (built in HTML/CSS) ---- */
.ms-tag { display: inline-block; font-family: var(--ui); font-weight: 600; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; background: var(--sun); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: .2rem .8rem; margin: .4rem 0 1.4rem; }
.ms-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.2rem 1.6rem; margin: 0 0 2.4rem; }
.ms-shot { margin: 0; }
.ms-shot figcaption { font-family: var(--body); font-size: .9rem; line-height: 1.5; color: var(--ink-body); margin-top: .9rem; max-width: 34ch; }
.ms-shot figcaption b { color: var(--ink); }
.ms-phone { position: relative; width: 100%; max-width: 290px; aspect-ratio: 9 / 18; background: #111; border-radius: 38px; padding: 10px; box-shadow: 0 18px 40px -18px rgba(59,30,51,.45); }
.ms-notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 84px; height: 20px; background: #111; border-radius: 12px; z-index: 2; }
.ms-screen { height: 100%; background: #F4F6FA; border-radius: 29px; overflow: hidden; padding: 44px 13px 14px; display: flex; flex-direction: column; gap: 9px; font-family: var(--body); color: #1F2937; font-size: 11px; line-height: 1.35; }
.ms-screen b { font-weight: 600; }
.ms-top { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 4px; }
.ms-top .ms-tl:first-child { grid-column: 1 / 3; }
.ms-tl { font-weight: 700; font-size: 14px; }
.ms-back { font-size: 20px; line-height: 1; color: #0F92DA; }
.ms-month { font-size: 10.5px; background: #fff; border: 1px solid #E5E7EB; border-radius: 999px; padding: 3px 9px; }
.ms-hero { background: #fff; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 3px; border: 1px solid #E5E7EB; }
.ms-lbl { font-size: 9.5px; color: #6B7280; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.ms-big { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.ms-chip { align-self: flex-start; font-size: 9.5px; font-weight: 600; border-radius: 999px; padding: 2px 8px; }
.ms-chip.warn { background: #F2D8A8; color: #6B4A0E; }
.ms-chip.ok { background: #B4DEC6; color: #1C5E3C; }
.ms-card { background: #fff; border: 1px solid #E5E7EB; border-radius: 12px; padding: 9px 11px; display: flex; flex-direction: column; gap: 2px; }
.ms-row-flex { flex-direction: row; align-items: center; gap: 10px; }
.ms-donut { flex: none; width: 42px; height: 42px; border-radius: 50%; background: conic-gradient(#0F92DA calc(var(--p) * 1%), #F2D8A8 0); -webkit-mask: radial-gradient(circle, transparent 54%, #000 56%); mask: radial-gradient(circle, transparent 54%, #000 56%); }
.ms-small { font-size: 10px; color: #6B7280; margin: 0; display: block; }
.ms-c { text-align: center; }
.ms-li { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 22px; }
.ms-li span { color: #374151; }
.ms-li i { font-style: normal; font-size: 9px; color: #9CA3AF; }
.ms-head { background: #fff; border: 1px solid #E5E7EB; border-radius: 12px; padding: 8px 11px; }
.ms-total { border-top: 2px solid #1F2937; padding-top: 7px; font-size: 12.5px; }
.ms-total b { font-weight: 700; }
.ms-acc { background: #fff; border: 1px solid #E5E7EB; border-radius: 12px; padding: 8px 11px; min-height: 40px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.ms-acc.open { border-color: #0F92DA; box-shadow: 0 0 0 2px rgba(15,146,218,.18); }
.ms-link { font-size: 10px; font-weight: 600; color: #0F92DA; }
.ms-btn { margin-top: auto; background: #0F92DA; color: #fff; text-align: center; font-weight: 600; border-radius: 11px; padding: 10px; font-size: 11.5px; }
.ms-btn.ghost { margin-top: 0; background: transparent; color: #0F92DA; border: 1.5px solid #0F92DA; }
.ms-btn + .ms-btn { margin-top: 0; }
.ms-seg { display: grid; grid-template-columns: 1fr 1fr; background: #F0F2F6; border-radius: 9px; padding: 3px; font-size: 10.5px; text-align: center; font-weight: 600; color: #6B7280; }
.ms-seg .on { background: #E2F5FC; color: #0F92DA; border-radius: 7px; padding: 4px; }
.ms-seg span { padding: 4px; }
.ms-pt { background: #fff; border: 1px solid #E5E7EB; border-radius: 12px; padding: 8px 10px; display: flex; justify-content: space-between; gap: 6px; min-height: 44px; align-items: center; }
.ms-pt > div:first-child { display: flex; flex-direction: column; gap: 1px; }
.ms-r { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.ms-steps { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 4px; }
.ms-steps span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; background: #E5E7EB; color: #6B7280; }
.ms-steps span.done { background: #0F92DA; color: #fff; }
.ms-steps span.now { background: #fff; color: #0F92DA; border: 2px solid #0F92DA; }
.ms-steps i { width: 34px; height: 2px; background: #D1D5DB; }
.ms-sum { background: #E2F5FC; border-color: #A9DDF3; }
.ms-field { display: flex; flex-direction: column; gap: 4px; }
.ms-input { background: #fff; border: 1.5px solid #0F92DA; border-radius: 10px; padding: 9px 10px; color: #6B7280; min-height: 56px; }

/* ---- payslip: design system ---- */
.ds-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin: 1.4rem 0 2.4rem; }
.ds-card { padding: 1.2rem 1.3rem; border: 2px solid var(--ink); border-radius: 16px; background: var(--lbeige); display: flex; flex-direction: column; gap: .55rem; }
.ds-wide { grid-column: 1 / -1; }
.ds-wide .cs-diagram-row { margin-top: .2rem; }
.ds-tok { display: grid; grid-template-columns: 22px auto 1fr; align-items: center; gap: .6rem; font-family: var(--body); font-size: .85rem; }
.ds-tok i { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid rgba(59,30,51,.25); }
.ds-tok code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .8rem; color: var(--ink); background: var(--cream); border-radius: 6px; padding: .1rem .4rem; }
.ds-tok span { color: var(--ink-soft); }
.ds-type { display: flex; flex-direction: column; font-family: var(--body); color: #1F2937; padding-bottom: .4rem; border-bottom: 1px dashed rgba(59,30,51,.2); }
.ds-type small, .ds-space small { font-size: .78rem; color: var(--ink-soft); }
.ds-space { display: flex; align-items: flex-end; flex-wrap: wrap; gap: .45rem; }
.ds-space i { display: block; height: 22px; background: #0F92DA; border-radius: 3px; }
.ds-space small { width: 100%; }

@media (max-width: 900px) {
  .cs-role, .ds-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .ms-grid { grid-template-columns: 1fr; justify-items: center; }
  .ms-shot { max-width: 290px; }
}

.cs-main .ms-screen p.ms-small { font-family: var(--body); font-size: 10px; line-height: 1.4; margin: 0; max-width: none; color: #6B7280; }
.ds-type small, .ds-space small, .ds-tok span { font-family: var(--body); }
