/* Three Dots Brands — case studies: shared pieces for the homepage reel and the /work/ page.
   Uses the shared colour and type tokens. Films are canvases drawn by assets/films.js. */

.film-wrap { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
.film, .film-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.film-wrap::after {            /* keeps type legible over any frame of the film */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(11,12,15,.97) 0%, rgba(11,12,15,.84) 36%, rgba(11,12,15,.15) 70%, transparent 100%);
}
.case-tag { display: block; font: 500 14px var(--font-d); color: var(--accent); letter-spacing: .005em; }
.case-name { display: block; margin-top: 8px; font: 600 clamp(30px, 3.4vw, 44px)/1.04 var(--font-d); letter-spacing: -.036em; text-wrap: balance; }
.reel-line { display: block; margin-top: 10px; font: 500 clamp(17px, 1.6vw, 20px)/1.3 var(--font-d); letter-spacing: -.015em; color: var(--text-2); text-wrap: balance; }

/* Sector chips */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 40px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer; white-space: nowrap;
  background-color: rgba(255,255,255,.06); color: var(--text-2); font: 500 14px var(--font-b);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 0 0 1px rgba(255,255,255,.05);
  transition: background-color .25s, color .25s, transform .12s ease-out;
}
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background-color: var(--tide); color: var(--tide-ink); box-shadow: none; }
@media (hover: hover) { .chip[aria-pressed="false"]:hover { background: rgba(255,255,255,.13); color: var(--text); } }

/* ---------- /work/ page ---------- */
.work-top .page-head { padding-bottom: clamp(24px, 3vw, 36px); }

.studies { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 56px) clamp(16px, 2.4vw, 32px); align-items: start; padding-bottom: clamp(56px, 8vw, 96px); }
.study { scroll-margin-top: calc(var(--nav-h) + 20px); min-width: 0; transition: opacity .35s var(--ease), transform .5s var(--ease); }
.study[hidden] { display: none; }
.study.is-in { opacity: 0; transform: translateY(14px); }
.study-film {
  position: relative; overflow: hidden; display: flex; align-items: flex-end;
  height: clamp(300px, 30vw, 380px); padding: clamp(22px, 2.6vw, 32px);
  border-radius: clamp(22px, 2.2vw, 28px); background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--hair-2);
}
.study-film .film { height: 78%; }
.study-film .case-body { position: relative; z-index: 1; }
.study-facts { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px clamp(14px, 2vw, 28px); margin-top: 22px; }
.study-facts b { color: var(--tide); display: block; font: 600 clamp(22px, 2.4vw, 32px)/1.05 var(--font-d); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.study-facts span { display: block; margin-top: 6px; font-size: 13.5px; line-height: 1.4; color: var(--text-3); }

.study-more { margin-top: 20px; border-top: 1px solid var(--hair); }
.study-more summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0; font: 500 15px var(--font-b); color: var(--accent); user-select: none; -webkit-user-select: none;
}
.study-more summary::-webkit-details-marker { display: none; }
.study-more summary i {
  width: 28px; height: 28px; border-radius: 50%; background: var(--fill); position: relative; flex: none;
  transition: transform .5s var(--ease), background-color .3s;
}
.study-more summary i::before, .study-more summary i::after { content: ''; position: absolute; left: 50%; top: 50%; width: 11px; height: 1.5px; margin: -.75px 0 0 -5.5px; border-radius: 2px; background: var(--text); }
.study-more summary i::after { transform: rotate(90deg); }
.study-more[open] summary i { transform: rotate(45deg); background: var(--accent); }
.study-more[open] summary i::before, .study-more[open] summary i::after { background: #000; }
.study-csi { display: grid; gap: 18px; padding: 4px 0 6px; animation: csi .5s var(--ease); }
@keyframes csi { from { opacity: 0; transform: translateY(-6px); } }
.study-csi h3 { font: 500 14px var(--font-d); color: var(--text); margin-bottom: 6px; }
.study-csi p { color: var(--text-2); font-size: 16px; line-height: 1.6; text-wrap: pretty; }
.study-role { margin: 16px 0 20px; font-size: 13px; line-height: 1.55; color: var(--text-3); }
.work-note { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid var(--hair-2); font-size: 13px; color: var(--text-3); max-width: 60em; line-height: 1.6; }

@media (max-width: 860px) {
  .studies { grid-template-columns: 1fr; }
  .study-film { height: 340px; }
}
@media (prefers-reduced-motion: reduce) { .study-csi { animation: none; } .study, .chip { transition: none; } }
