/* Case-study pages: about.css (fonts, top bar, footer, reveals) plus the article layout below.
   The hero takes the project's brand colours from data/projects.js (set by src/case.js as --c-*). */
.case-page { --c-bg: #f3f2ee; --c-ink: #1b1b1f; --c-accent: #1b1b1f; --c-strong: #1b1b1f; background: #fff; }

/* Header: the project's colours from the landing page (--c-bg / --c-ink / --c-accent, set by src/case.js),
   logo and title on the left (its key phrase in the accent colour), the illustration in its circle on the right */
.case-hero {
  background: var(--c-bg); color: var(--c-ink);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center;
  padding: clamp(110px, 15vh, 150px) clamp(20px, 7vw, 120px) clamp(40px, 7vh, 72px);
}
/* The top bar keeps the header colour as the page scrolls */
.case-page .top.on-dark { background: linear-gradient(to bottom, var(--c-bg) 55%, transparent); }
/* Content is visible until the reveal script is running */
.case-page:not(.js-ready) .reveal { opacity: 1; transform: none; }
.case-logo { display: block; height: clamp(30px, 3.2vw, 44px); width: auto; margin-bottom: 1.6rem; }
.case-logo:not([src]) { visibility: hidden; }
.case-title { font: 600 clamp(2.4rem, 4.8vw, 4.6rem)/1.06 var(--serif); letter-spacing: -0.02em; color: var(--c-ink); }
.case-title em { font-style: normal; color: var(--c-accent); }
.case-label { display: block; font: 600 .72rem/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; margin: 0 0 .6rem; }
.case-art { margin: 0; }
.case-art img { display: block; width: 100%; height: auto; }

/* Summary card: label, the summary in large type, then optional facts (timeframe, role, team, scope) */
.summary-card {
  width: min(1040px, calc(100vw - 40px)); margin: 0 0 3.6rem calc(50% - min(520px, 50vw - 20px));
  background: var(--sum-bg, #e3daf7); border-radius: 32px; padding: clamp(28px, 4vw, 52px) clamp(24px, 4.6vw, 58px);
}
.summary-card .case-label { color: var(--ink); letter-spacing: .21em; margin-bottom: 1.3rem; }
.case-body .summary-text { margin: 0; font-size: clamp(1.15rem, 1.9vw, 1.55rem); line-height: 1.45; color: var(--ink); }
.summary-card dl {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 2rem 0 0; padding-top: 1.6rem;
  border-top: 1px solid rgba(0, 0, 0, .18);
}
.summary-card dt { font: 600 .72rem/1.4 var(--sans); letter-spacing: .18em; text-transform: uppercase; margin-bottom: 6px; color: var(--ink); }
.summary-card dd { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--ink); }

/* Article */
.case-body { max-width: 760px; margin: clamp(4rem, 10vh, 6.5rem) auto 0; padding: 0 20px; }
.case-body > :first-child { margin-top: 0; }
.case-body h2 { font: 600 clamp(1.9rem, 3vw, 2.6rem)/1.15 var(--serif); letter-spacing: -0.02em; margin: 3.6rem 0 1.2rem; }
.case-body h3 { font: 600 clamp(1.35rem, 2vw, 1.7rem)/1.25 var(--serif); margin: 2.6rem 0 .9rem; }
.case-body p, .case-body li { font-size: clamp(1.02rem, 1.25vw, 1.14rem); line-height: 1.75; color: var(--muted); }
.case-body p { margin-bottom: 1.2rem; }
.case-body strong, .case-lead { color: var(--ink); font-weight: 600; }
.case-body h4.case-label { color: var(--c-strong); margin: 1.8rem 0 .5rem; }
.case-body a { color: var(--link); border-radius: 4px; transition: background .2s; }
.case-body a:hover, .case-body a:focus-visible { background: var(--hover-bg); }
.case-list { padding-left: 1.3rem; margin: 0 0 1.4rem; }
.case-list li { margin-bottom: .4rem; }
.case-list li::marker { color: var(--c-strong); }
.case-quote {
  margin: 2.6rem 0; padding-left: 1.4rem; border-left: 4px solid var(--c-strong);
  font: italic 600 clamp(1.35rem, 2.2vw, 1.85rem)/1.4 var(--serif); color: var(--ink);
}

/* Figures run wider than the text column */
.case-fig, .case-video {
  width: min(1040px, calc(100vw - 40px)); margin: 2.6rem 0 2.6rem calc(50% - min(520px, 50vw - 20px));
}
.case-fig img, .case-video img { display: block; width: 100%; height: auto; border-radius: 18px; background: var(--c-bg); }   /* brand colour behind transparent artwork, as on the Canva pages */
.case-fig.is-tall { width: min(480px, 100%); margin-left: auto; margin-right: auto; }
.case-video { position: relative; display: block; border-radius: 18px; overflow: hidden; }
.case-video .play {
  position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; translate: -50% -50%; border-radius: 50%;
  background: rgba(255, 255, 255, .92); box-shadow: 0 12px 30px rgba(0, 0, 0, .25); transition: transform .3s ease;
}
.case-video .play::after { content: ""; position: absolute; left: 36px; top: 28px; border-style: solid; border-width: 14px 0 14px 22px; border-color: transparent transparent transparent var(--c-strong); }
.case-video:hover .play, .case-video:focus-visible .play { transform: scale(1.08); }

/* Next project: a card in the next project's colours */
.case-next { padding: clamp(4rem, 10vh, 7rem) clamp(20px, 7vw, 120px) 0; }
.next-card {
  display: grid; gap: .6rem; padding: clamp(28px, 4vw, 56px); border-radius: 28px; text-decoration: none;
  background: var(--n-bg, #f3f2ee); color: var(--n-ink, #1b1b1f); transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.next-title { font: 600 clamp(1.8rem, 3.6vw, 3.2rem)/1.08 var(--serif); letter-spacing: -0.02em; color: var(--n-accent, #1b1b1f); }
.next-company { font-weight: 600; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; }
.next-company span { display: inline-block; transition: translate .3s ease; }
.next-card:hover, .next-card:focus-visible { transform: translateY(-4px); }
.next-card:hover .next-company span, .next-card:focus-visible .next-company span { translate: 5px 0; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 860px) {
  .case-hero { grid-template-columns: minmax(0, 1fr); padding-top: 110px; }   /* minmax(0) so the 1100px artwork can shrink */
  .summary-card dl { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { .next-card, .next-company span, .case-video .play { transition: none; } }

/* A diagram inside a decorative frame (the Cleo prompt engineering figure): the frame image fills the box,
   the diagram sits on a white card inside it, caption below */
.case-frame { width: min(1040px, calc(100vw - 40px)); margin: 2.6rem 0 2.6rem calc(50% - min(520px, 50vw - 20px)); }
.case-frame .frame { background: var(--frame) center / cover; padding: 2.8%; border-radius: 4px; }
.case-frame .frame img { display: block; width: 100%; height: auto; background: #fff; }
.case-frame figcaption { margin-top: 1rem; text-align: center; color: rgba(27,27,31,.6); font-size: 1.05rem; }
.case-frame figcaption a { font-weight: 600; }

/* "Watch the video": a teal line under the headline and a curly purple arrow pointing on towards the video */
.case-body h2.watch-title { display: flex; align-items: flex-start; gap: .35em; }
.watch-title span { position: relative; display: inline-block; padding-bottom: .3em; }
.watch-title span::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: .14em; background: #62c9d4; }
.watch-arrow { flex: none; width: 2.5em; height: auto; margin: -.25em 0 0 .1em; overflow: visible; }
.watch-arrow path { fill: none; stroke: #c15bff; stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }
