/* Structural case-study styles. Versions set: --bg --fg --muted --line --card --font-display --font-body --font-mono --radius --maxw */
.cs { --gap: clamp(16px, 2.4vw, 28px); max-width: var(--maxw, 1180px); margin: 0 auto; padding: 0 16px 96px; color: var(--fg); font-family: var(--font-body); }
@media (min-width: 720px) { .cs { padding: 0 32px 120px; } }
.cs-back { display: inline-flex; gap: 8px; align-items: center; font: 500 14px/1 var(--font-mono); color: var(--muted); text-decoration: none; padding: 10px 0; margin-bottom: 24px; }
.cs-back:hover { color: var(--fg); }
.cs-hero { padding-top: clamp(24px, 6vw, 72px); display: grid; gap: 16px; }
.cs-kicker { display: flex; flex-wrap: wrap; gap: 8px 16px; font: 500 12px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cs-live { color: var(--live, #1d8a4c); }
.cs-title { font: var(--title-weight, 600) clamp(44px, 9vw, 120px)/.92 var(--font-display); letter-spacing: var(--title-track, -.035em); margin: 0; }
.cs-sub { font: 500 clamp(20px, 2.4vw, 28px)/1.2 var(--font-body); margin: 0; color: var(--fg); opacity: .8; }
.cs-summary { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; max-width: 62ch; margin: 8px 0 0; color: var(--fg); }
.cs-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; margin: 16px 0 0; border-top: 1px solid var(--line); }
.cs-facts div { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); }
.cs-facts dt { font: 500 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.cs-facts dd { margin: 0; font-size: 15px; line-height: 1.4; }
.cs-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.cs-tags span, .cs-link { font: 500 12px/1 var(--font-mono); padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--chip-radius, 999px); color: var(--muted); }
.cs-link { color: var(--fg); text-decoration: none; background: var(--card); }
.cs-cover { margin: clamp(28px, 5vw, 56px) 0 0; border-radius: var(--radius); overflow: hidden; background: var(--card); }
.cs-cover img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: cover; }
.cs-sec { margin-top: clamp(56px, 9vw, 120px); display: grid; gap: var(--gap); }
.cs-sec-text { display: grid; gap: 14px; max-width: 760px; }
@media (min-width: 980px) { .cs-sec-text { grid-template-columns: 300px 1fr; max-width: none; column-gap: 48px; } .cs-sec-text h2 { grid-row: span 3; } .cs-sec-text > p, .cs-sec-text > ul { grid-column: 2; max-width: 64ch; } }
.cs-sec-text h2 { font: 600 clamp(24px, 2.6vw, 32px)/1.1 var(--font-display); letter-spacing: -.02em; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.cs-num { font: 500 12px/1 var(--font-mono); color: var(--muted); letter-spacing: .06em; }
.cs-sec-text p { margin: 0; font-size: 17px; line-height: 1.65; color: var(--fg); opacity: .88; }
.cs-sec-text ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.cs-sec-text li { position: relative; padding-left: 22px; font-size: 16px; line-height: 1.55; opacity: .88; }
.cs-sec-text li::before { content: ""; position: absolute; left: 0; top: .7em; width: 10px; height: 2px; background: var(--p-accent, var(--fg)); }
.cs-imgs { display: grid; gap: var(--gap); }
.cs-imgs figure { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--card); }
.cs-imgs video { display: block; width: 100%; height: auto; }
.cs-imgs img { display: block; width: 100%; height: auto; cursor: zoom-in; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.cs-imgs figure:hover img { transform: scale(1.015); }
@media (min-width: 720px) {
  .cs-imgs--grid { grid-template-columns: repeat(2, 1fr); }
  .cs-imgs--grid figure:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
  .cs-imgs--duo { grid-template-columns: repeat(2, 1fr); align-items: start; }
  .cs-imgs--phones { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: start; }
  .cs-imgs--tall { grid-template-columns: repeat(2, 1fr); align-items: start; }
}
.cs-imgs--phones { grid-template-columns: repeat(2, 1fr); }
.cs-imgs--phones figure { background: transparent; border-radius: calc(var(--radius) * 1.4); box-shadow: 0 1px 0 var(--line), 0 20px 50px -30px rgba(0,0,0,.35); }
.cs-imgs--tall figure { max-height: 900px; overflow-y: auto; scrollbar-width: thin; }
.cs-demo { position: relative; min-height: 420px; border-radius: calc(var(--radius) + 6px); padding: clamp(8px, 2vw, 24px); background: var(--demo-bg, var(--card)); border: 1px solid var(--line); }
.cs-demo-loading { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; justify-items: center; font: 500 13px/1 var(--font-mono); color: var(--muted); }
.cs-demo-loading span { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--fg); animation: pfspin 1s linear infinite; }
@keyframes pfspin { to { transform: rotate(360deg); } }
.cs-demo-fallback img { width: 100%; border-radius: var(--radius); }
.cs-pager { margin-top: clamp(72px, 10vw, 140px); display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); border-top: 1px solid var(--line); padding-top: 24px; }
.cs-pager a { text-decoration: none; color: var(--fg); display: grid; gap: 6px; padding: 8px 0; }
.cs-pager .cs-next { text-align: right; }
.cs-pager small { font: 500 12px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cs-pager b { font: 600 clamp(20px, 3vw, 36px)/1.1 var(--font-display); letter-spacing: -.02em; }
.cs-pager a:hover b { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
/* reveal */
.cs-sec { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.cs-sec.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .cs-sec { opacity: 1; transform: none; transition: none; } }
/* lightbox */
.pf-lb { position: fixed; inset: 0; z-index: 1000; background: rgba(8,8,10,.92); display: none; align-items: center; justify-content: center; padding: 56px 16px; }
.pf-lb.on { display: flex; animation: pffade .2s ease; }
@keyframes pffade { from { opacity: 0; } }
.pf-lb img { max-width: min(1600px, 100%); max-height: 100%; object-fit: contain; border-radius: 6px; }
.pf-lb button { position: absolute; background: rgba(255,255,255,.08); color: #fff; border: 0; width: 44px; height: 44px; border-radius: 50%; font-size: 24px; cursor: pointer; }
.pf-lb button:hover { background: rgba(255,255,255,.18); }
.pf-lb-x { top: 12px; right: 12px; } .pf-lb-p { left: 12px; top: 50%; } .pf-lb-n { right: 12px; top: 50%; }

/* coach thread: chat that answers with interface */
.cs-spectrum { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px 14px; font: 500 12px/1.3 var(--font-mono); color: var(--muted); max-width: 760px; width: 100%; justify-self: end; }
.cs-spectrum i { position: relative; height: 2px; background: linear-gradient(90deg, var(--line), var(--fg) 50%, var(--line)); border-radius: 2px; }
.cs-spectrum i b { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--chat-accent, #1f8a4c); box-shadow: 0 0 0 4px rgb(31 138 76 / .25); }
.cs-spectrum em { grid-column: 2; justify-self: center; font-style: normal; color: var(--fg); }
.cs-chat { display: grid; gap: clamp(28px, 4vw, 44px); max-width: 980px; width: 100%; margin: 8px auto 0; padding: clamp(20px, 3.4vw, 40px); border-radius: calc(var(--radius) + 8px); background: var(--card); border: 1px solid var(--line); }
.cs-turn { display: grid; gap: 14px; }
.cs-you { justify-self: end; max-width: 78%; margin: 0; padding: 10px 14px; border-radius: 16px 16px 4px 16px; background: var(--fg); color: var(--bg); font-size: 15px; line-height: 1.45; }
.cs-coach { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: start; }
.cs-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 600 14px/1 var(--font-display); background: var(--chat-accent, #1f8a4c); color: #fff; }
.cs-coach-body { display: grid; gap: 10px; justify-items: start; min-width: 0; }
.cs-coach-body > p { margin: 5px 0 0; font-size: 16px; line-height: 1.5; }
.cs-card { margin: 0; max-width: 100%; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 12px 32px -18px rgb(0 0 0 / .25); background: #faf9f7; }
.cs-card img { display: block; max-width: 100%; height: auto; cursor: zoom-in; }
.cs-turn:nth-child(1) .cs-card img { width: 620px; } .cs-turn:nth-child(2) .cs-card img { width: 400px; } .cs-turn:nth-child(3) .cs-card img { width: 640px; } .cs-turn:nth-child(5) .cs-card img { width: 640px; }
.cs-cap { font-size: 13px; line-height: 1.45; color: var(--muted); max-width: 60ch; }
.cs-cap b { font: 500 11px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--fg); margin-right: 6px; }
@media (max-width: 600px) { .cs-coach { grid-template-columns: 1fr; } .cs-av { display: none; } .cs-you { max-width: 92%; } .cs-spectrum { grid-template-columns: 1fr; text-align: center; } .cs-spectrum i { order: 2; margin: 6px 0; } .cs-spectrum span:last-of-type { order: 3; } .cs-spectrum em { grid-column: 1; order: 4; } }

/* "The business": the bet, who it's for, model, team, status */
.cs-biz { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border-top: 1px solid var(--line); }
.cs-biz div { padding: 18px 20px 20px 0; border-bottom: 1px solid var(--line); }
.cs-biz dt { font: 500 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.cs-biz dd { margin: 0; font-size: 16px; line-height: 1.5; }
.cs-biz div:first-child { grid-column: 1 / -1; }
.cs-biz div:first-child dd { font: 500 clamp(20px, 2.2vw, 26px)/1.3 var(--font-display); letter-spacing: -.01em; max-width: 40ch; }
.cs-biz { border-bottom: 1px solid var(--line); } .cs-biz div:not(:first-child) { border-bottom: 0; }

/* video covers: a local loop, or a Vimeo background embed */
.cs-cover--video { background: var(--card); }
.cs-cover--video video { display: block; width: auto; max-width: 100%; height: auto; max-height: 82vh; margin: 0 auto; object-fit: contain; }
.cs-cover--embed { position: relative; aspect-ratio: 16 / 9; }
.cs-cover--embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* demo with a picture beside it, inside one container */
.cs-demo-row { display: grid; gap: clamp(12px, 2vw, 20px); border-radius: calc(var(--radius) + 6px); padding: clamp(8px, 2vw, 24px); background: var(--demo-bg, var(--card)); border: 1px solid var(--line); }
.cs-demo-row .cs-demo { border: 0; padding: 0; background: none; border-radius: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.cs-demo-aside { margin: 0; border-radius: var(--radius); overflow: hidden; min-height: 260px; }
.cs-demo-aside img { display: block; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
@media (min-width: 1180px) { .cs-demo-row { grid-template-columns: minmax(0, 760px) minmax(260px, 1fr); align-items: stretch; } }

/* Ganba: live diorama row */
.cs-diorama-row { margin-top: 16px; }
.cs-dioramas { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.cs-dioramas figure { margin: 0; border-radius: var(--radius); background: #10183A; padding: 6px 6px 12px; text-align: center; }
.cs-dioramas canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.cs-dioramas figcaption { font-size: 13px; color: #AFC0E8; margin-top: 2px; }
@media (max-width: 720px) { .cs-dioramas { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cs-dioramas figure:nth-child(n+4) { display: none; } }
