/* Case-study view inside the project dialog (case.js).
   Portfolio language from styles.css (navy, cream, Mona Sans + Instrument Serif);
   each project brings only its own --cs-accent and --cs-stage. The frame stays quiet so the work leads. */

.project.is-case {
  --cs-accent: var(--lime);
  --cs-stage: var(--black);
  --cs-side: clamp(20px, 5.5vw, 120px);
  --cs-gap: clamp(16px, 2vw, 32px);
  --cs-sec: clamp(96px, 12vw, 200px);
  --cs-ink: #f1f2f5;
  --cs-ink-2: #c9ccd6;
  --cs-ink-3: #8d93a6;
  --cs-rule: rgba(241, 242, 245, 0.12);
}
.project.is-case .pj-title, .project.is-case .pj-body { display: none; }
.project.is-case .pj-bar { background: rgba(18, 26, 51, 0.9); border-bottom: 1px solid var(--cs-rule); }
.project.is-case.has-bg { background: var(--cs-bg); }
.project.is-case.has-bg .pj-bar { background: color-mix(in srgb, var(--cs-bg) 90%, transparent); }
.project.is-case.has-bg > .topo { opacity: 0; }
.project.is-case.has-bg .pj-bar .pill, .project.is-case.has-bg .pj-bar .round, .project.is-case.has-bg .cs-link { background-color: var(--cs-accent); color: var(--cs-bg); }
/* light pages: dark ink, the closing band stays dark */
.project.is-case.is-light { --cs-ink: #111111; --cs-ink-2: #3a3a3a; --cs-ink-3: #6b6864; --cs-rule: rgba(17, 17, 17, 0.14); color: #111; }
.project.is-case.is-light .pj-bar .pill, .project.is-case.is-light .pj-bar .round { background-color: #111; color: var(--cs-bg); }
.project.is-case.is-light .cs-fig img { background: transparent; }
/* hover: the fill that slides up must contrast with the text on every case colour */
.project.is-case .pj-bar .pill:hover, .project.is-case .cs-link:hover { color: #111111; }
.project.is-case .pj-bar .pill::before, .project.is-case .cs-link::before { background: #f4f3f1; }
.project.is-case.is-light .pj-bar .pill:hover, .project.is-case.is-light .cs-link:hover { color: #ffffff; }
.project.is-case.is-light .pj-bar .pill::before, .project.is-case.is-light .cs-link::before { background: var(--cs-stage, #111111); }
.project.is-case.is-light .cs-final { --cs-ink: #f1f2f5; --cs-ink-2: #c9ccd6; --cs-ink-3: #9a9eab; --cs-rule: rgba(255, 255, 255, 0.12); }
.project.is-case .cs-final { --cs-accent: var(--cs-accent-stage); }
.project.is-case.final-light .cs-final { --cs-ink: #0b0808; --cs-ink-2: #2a1f22; --cs-ink-3: #3d2a30; --cs-rule: rgba(0, 0, 0, 0.18); }
.project.is-case.final-light .cs-final::before { display: none; }
.project.is-case.is-light .cs-next:hover .cs-next-name .serif, .project.is-case.is-light .cs-next:hover .cs-next-arrow { color: var(--cs-accent); }
.pj-case { position: relative; z-index: 1; padding-bottom: 0; }
.pj-case[hidden] { display: none; }
.pj-case ::selection { background: var(--cs-accent); color: #0b0b0b; }

/* type roles */
.cs-label { font: 600 11px/1.2 var(--sans); letter-spacing: 0.09em; text-transform: uppercase; color: var(--cs-ink-3); margin: 0; }
.cs-copy { max-width: 58ch; font-size: clamp(16px, 1.1vw, 18px); line-height: 1.68; letter-spacing: 0.005em; color: var(--cs-ink-2); text-wrap: pretty; }
.cs-copy + .cs-copy { margin-top: 1em; }
.cs-lead + .cs-copy, .cs-line + .cs-copy, .cs-quote + .cs-copy { margin-top: clamp(20px, 2vw, 32px); }

/* figures */
.cs-fig { margin: 0; opacity: 0; transition: opacity 0.6s var(--ease-out); }
.cs-fig.ld { opacity: 1; }
.cs-fig img { display: block; width: 100%; height: auto; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); }
.cs-fit { object-fit: cover; }
.cs-cap { display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; font: 500 12px/1.3 var(--sans); color: var(--cs-ink-3); }
.cs-cap span:first-child { color: var(--cs-ink-2); }

/* hero: title row, then the work */
.cs-hero { padding: clamp(28px, 3.5vw, 56px) var(--cs-side) 0; }
.cs-hero-top { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: var(--cs-gap); align-items: end; }
.cs-h1 { display: grid; margin: 0; line-height: 0.86; text-wrap: balance; }
.cs-h1 > span, .cs-next-name > span { min-width: 0; }
.cs-h1 .sans { font-size: clamp(42px, 7vw, 124px); font-weight: 800; letter-spacing: -0.03em; }
.cs-h1 .serif { margin-top: 0.12em; font-size: clamp(26px, 3.3vw, 60px); line-height: 0.95; color: var(--cs-accent); }
.cs-tag { max-width: 34ch; justify-self: end; font-size: clamp(16px, 1.2vw, 19px); line-height: 1.5; color: var(--cs-ink-2); text-wrap: pretty; }
.cs-hero-media { margin-top: clamp(28px, 3vw, 48px); max-width: none !important; }
.cs-hero-media img { background: var(--cs-stage); }
.cs-open .cs-hero-media img { animation: cs-wipe 1.3s cubic-bezier(0.16, 1, 0.3, 1) both 0.15s; }
@keyframes cs-wipe {
  from { clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%); transform: scale(1.04); }
  to { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); transform: none; }
}
.cs-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--cs-gap); margin: 0; padding: 20px 0 0; }
.cs-facts dt { margin-bottom: 8px; }
.cs-facts dd { margin: 0; font-size: 15px; line-height: 1.45; color: var(--cs-ink); }
.cs-link { margin-top: 28px; }
/* small hero source: image keeps near its own size, facts stack beside it */
.cs-hero.small { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--cs-gap); align-items: end; }
.cs-hero.small .cs-hero-top { grid-column: 1 / -1; }
.cs-hero.small .cs-hero-media { grid-column: 1 / span 7; }
.cs-hero.small .cs-facts { grid-column: 9 / -1; grid-row: 2; grid-template-columns: 1fr; row-gap: 22px; padding: 0; }
.cs-hero.small .cs-link { grid-column: 9 / -1; justify-self: start; }

/* sections: sticky title rail + content */
.cs-sec { padding: var(--cs-sec) var(--cs-side) 0; }
.cs-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--cs-gap); }
.cs-h2 { grid-column: 1 / span 3; align-self: start; position: sticky; top: 104px; margin: 0; padding-top: 14px; border-top: 1px solid var(--cs-accent); font: 700 clamp(18px, 1.5vw, 24px)/1 var(--sans); font-stretch: 112%; letter-spacing: -0.01em; text-transform: uppercase; color: var(--cs-ink); }
.cs-body { grid-column: 4 / -1; padding-top: 10px; }
.cs-full { margin-top: clamp(40px, 5vw, 80px); }

/* overview */
.cs-lead { max-width: 26ch; margin: 0; font-size: clamp(24px, 2.4vw, 42px); font-weight: 450; line-height: 1.2; letter-spacing: -0.015em; color: var(--cs-ink); text-wrap: pretty; }
.cs-lead em { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.1em; letter-spacing: 0; color: var(--cs-accent); }
.cs-meta { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 3fr); gap: var(--cs-gap); margin-top: clamp(48px, 5vw, 80px); max-width: 880px; }
.cs-meta .cs-label { margin-bottom: 14px; }
.cs-meta.wide { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; }
.cs-meta.wide .cs-list { columns: 1; }
.cs-list { columns: 2; column-gap: var(--cs-gap); margin: 0; padding: 0; list-style: none; }
.cs-list li { break-inside: avoid; padding: 11px 0; border-top: 1px solid var(--cs-rule); font-size: 15px; line-height: 1.4; color: var(--cs-ink); }
.cs-meta .cs-copy { font-size: 15px; line-height: 1.5; color: var(--cs-ink); padding-top: 11px; border-top: 1px solid var(--cs-rule); }

/* concept */
.cs-statement { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: var(--cs-gap); align-items: end; }
.cs-quote { margin: 0; font-family: var(--serif); font-size: clamp(48px, 6.6vw, 124px); line-height: 0.86; letter-spacing: -0.01em; text-transform: uppercase; color: var(--cs-ink); text-wrap: balance; }
.cs-quote b, .cs-line b { font-weight: 400; font-style: italic; color: var(--cs-accent); }
.cs-wide { justify-self: center; width: 100%; }

/* identity */
.cs-stage { max-width: none !important; padding: clamp(28px, 7vw, 120px); background: var(--cs-stage); }
.cs-stage img { max-width: 1100px; margin: 0 auto; clip-path: none; }
.cs-swatches { display: flex; height: clamp(120px, 13vw, 200px); margin-top: 0; }
.cs-sw { box-shadow: inset 0 0 0 1px var(--cs-rule); display: flex; flex-direction: column; justify-content: space-between; min-width: 0; padding: 14px 16px; font: 600 11px/1.3 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; }
.cs-sw small { font: 500 12px/1 var(--sans); letter-spacing: 0.02em; opacity: 0.85; font-variant-numeric: tabular-nums; }
.cs-notes { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--cs-gap); margin: clamp(28px, 3vw, 44px) 0 0; }
.cs-notes > div { grid-column: span 4; padding-top: 12px; border-top: 1px solid var(--cs-rule); }
.cs-notes > div:first-child { grid-column: 4 / span 4; }
.cs-notes dt { margin-bottom: 8px; }
.cs-notes dd { margin: 0; font-size: 15px; line-height: 1.5; color: var(--cs-ink); max-width: 36ch; }

/* campaign pair */
.cs-pair { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--cs-gap); align-items: start; }
.cs-pair > :first-child { grid-column: 1 / span 5; }
.cs-pair > :last-child { grid-column: 7 / -1; justify-self: end; width: 100%; }
.cs-pair.offset > :first-child { margin-top: clamp(80px, 14vw, 260px); }

/* gallery: each piece places itself on the 12-column grid (col, drop) */
.cs-gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--cs-gap); row-gap: clamp(28px, 4vw, 64px); align-items: start; }
.cs-gallery .cs-fig { width: 100%; justify-self: center; }

/* merchandise */
.cs-feature { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--cs-gap); align-items: end; }
.cs-feature .cs-main { grid-column: 1 / span 6; width: 100%; }
.cs-feature .cs-aside { grid-column: 8 / -1; width: 100%; margin-bottom: clamp(40px, 8vw, 140px); }
.cs-feature.flip .cs-main { grid-column: 7 / -1; }
.cs-feature.flip .cs-aside { grid-column: 1 / span 5; grid-row: 1; }

/* on the day: dark band */
.cs-final { position: relative; overflow: hidden; margin-top: var(--cs-sec); padding-bottom: clamp(80px, 10vw, 160px); background: var(--cs-stage); }
.cs-final::before { content: ""; position: absolute; left: -10%; right: -10%; bottom: -35%; height: 65%; background: radial-gradient(55% 60% at 50% 100%, color-mix(in srgb, var(--cs-accent) 28%, transparent), transparent 72%); pointer-events: none; }
.cs-final > * { position: relative; }
.cs-final .cs-h2 { position: static; align-self: end; margin-bottom: 0.5em; }
.cs-line { margin: 0; font-family: var(--serif); font-size: clamp(48px, 6.6vw, 124px); line-height: 0.86; text-transform: uppercase; color: var(--cs-ink); text-wrap: balance; }
.cs-closing { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--cs-gap); align-items: end; }
.cs-closing .cs-lead-shot { grid-column: 1 / span 5; width: 100%; }
.cs-closing .cs-hero-shot { grid-column: 7 / -1; width: 100%; justify-self: end; }
.cs-closing .cs-solo { grid-column: 1 / -1; width: 100%; justify-self: center; }

/* next project */
.cs-next { position: relative; display: block; width: 100%; padding: clamp(72px, 9vw, 140px) var(--cs-side) clamp(88px, 10vw, 160px); border-top: 1px solid var(--cs-rule); text-align: left; }
.cs-next .cs-label { display: block; margin-bottom: 20px; }
.cs-next-name { display: grid; line-height: 0.86; }
.cs-next-name .sans { font-size: clamp(40px, 7vw, 124px); font-weight: 800; letter-spacing: -0.03em; }
.cs-next-name .serif { margin-top: 0.1em; font-size: clamp(26px, 3.3vw, 60px); color: var(--cs-ink-3); transition: color 0.4s var(--ease-out); }
.cs-next-arrow { position: absolute; right: var(--cs-side); bottom: clamp(88px, 10vw, 160px); width: clamp(36px, 4vw, 64px); height: auto; color: var(--cs-ink-3); transition: transform 0.5s var(--ease-out), color 0.4s; }
.cs-next:hover .cs-next-name .serif, .cs-next:focus-visible .cs-next-name .serif { color: var(--lime); }
.cs-next:hover .cs-next-arrow { transform: translateX(8px); color: var(--lime); }

@media (max-width: 900px) {
  .cs-hero-top { grid-template-columns: 1fr; }
  .cs-hero.small { display: block; }
  .cs-hero.small .cs-facts { grid-template-columns: 1fr 1fr; padding-top: 20px; }
  .cs-tag { justify-self: start; margin-top: 8px; }
  .cs-facts { grid-template-columns: 1fr 1fr; row-gap: 22px; }
  .cs-row { display: block; }
  .cs-h2 { position: static; margin-bottom: 28px; }
  .cs-body { padding-top: 0; }
  .cs-statement, .cs-meta, .cs-meta.wide { grid-template-columns: 1fr; row-gap: 32px; }
  .cs-notes > div, .cs-notes > div:first-child { grid-column: span 6; }
  .cs-pair > :first-child { grid-column: 1 / span 6; }
  .cs-pair > :last-child { grid-column: 7 / -1; }
  .cs-feature .cs-main { grid-column: 1 / span 7; }
  .cs-feature .cs-aside { grid-column: 8 / -1; margin-bottom: 0; }
  .cs-closing .cs-lead-shot { grid-column: 1 / span 6; }
  .cs-closing .cs-hero-shot { grid-column: 7 / -1; }
}
@media (max-width: 600px) {
  .cs-list { columns: 1; }
  .cs-swatches { flex-wrap: wrap; height: auto; }
  .cs-sw { flex: 1 1 50% !important; height: 104px; }
  .cs-gallery > * { grid-column: 1 / -1 !important; margin-top: 0 !important; }
  .cs-notes, .cs-pair, .cs-feature, .cs-closing { display: grid; grid-template-columns: 1fr; row-gap: 28px; }
  .cs-notes > div, .cs-notes > div:first-child, .cs-pair > *, .cs-feature > *, .cs-closing > * { grid-column: 1 / -1 !important; margin: 0 !important; justify-self: stretch; }
  .cs-stage { padding: 16px; }
  .cs-next-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-fig { opacity: 1; transition: none; }
  .cs-open .cs-hero-media img { animation: none; }
}
