/* Страница «Работы» (/work/, /ru/work/). Разметку собирает scripts/works.mjs, поведение — overrides/js/daruma-work.js.
   Шапка, кнопки, призыв и подвал — общие со страницами блога (daruma-blog.css), окно с роликом — как у шоурила
   (daruma-reel.css). Сетка карточек — как на главной: плитки 4:3 вплотную, во всю ширину, 4 → 3 → 2 → 1 колонки. */

.dw-head { padding: 88px 0 48px; }
.dw-title { margin: 0; font-size: clamp(48px, 8vw, 120px); line-height: .95; font-weight: 400; letter-spacing: -.05em; }
.dw-lead { max-width: 46ch; margin: 24px 0 56px; font-size: 18px; line-height: 1.5; color: var(--db-muted); text-wrap: pretty; }

/* ——— облако тегов: направления крупнее, теги формата под ними мельче */
.dw-cloud { display: flex; flex-direction: column; gap: 20px; }
.dw-cloud__cats, .dw-cloud__tags { display: flex; flex-wrap: wrap; gap: 10px; }
.dw-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid rgba(242, 240, 235, .28); background: transparent; color: var(--db-fg);
  font: 500 15px/1 Inter, Arial, sans-serif; letter-spacing: -.005em; white-space: nowrap; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, opacity .2s ease;
}
.dw-chip__n { font-size: 12px; font-weight: 500; color: var(--db-faint); font-variant-numeric: tabular-nums; transition: color .2s ease; }
.dw-chip--tag { height: 34px; padding: 0 14px; font-size: 13px; color: var(--db-muted); border-color: rgba(242, 240, 235, .16); }
.dw-chip--tag::before { content: '#'; color: var(--db-faint); margin-right: -4px; }
@media (hover: hover) {
  .dw-chip:hover { border-color: var(--db-fg); color: var(--db-fg); }
}
.dw-chip[aria-pressed="true"] { background: var(--db-fg); border-color: var(--db-fg); color: var(--db-bg); }
.dw-chip[aria-pressed="true"] .dw-chip__n, .dw-chip[aria-pressed="true"]::before { color: rgba(11, 11, 11, .55); }
.dw-chip[hidden] { display: none; }

/* ——— сетка работ */
.dw-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.dw-card { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #161616; }
.dw-card[hidden] { display: none; }
.dw-card.is-in { animation: dw-in .45s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes dw-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.dw-card__link { position: absolute; inset: 0; display: block; color: var(--db-fg); text-decoration: none; }
.db .dw-card__img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; transition: transform .8s cubic-bezier(.22, 1, .36, 1); }
.dw-card__link::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .35) 45%, rgba(0, 0, 0, .1) 100%);
}
.dw-card__text { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; }
.dw-card__title { font-size: 20px; line-height: 1.2; font-weight: 500; letter-spacing: -.01em; }
.dw-card__fmt, .dw-card__credits { font-size: 13px; line-height: 1.4; color: rgba(242, 240, 235, .78); }
.db .dw-card__link:focus-visible { outline-offset: -3px; }
/* состав работ — при наведении, как на главной; на телефоне виден всегда */
@media (hover: hover) and (pointer: fine) {
  .dw-card__credits { max-height: 0; opacity: 0; overflow: hidden; transform: translateY(8px); transition: max-height .5s cubic-bezier(.22, 1, .36, 1), opacity .4s ease, transform .5s cubic-bezier(.22, 1, .36, 1); }
  .dw-card__link:hover .dw-card__credits, .dw-card__link:focus-visible .dw-card__credits {
    max-height: 3em; opacity: 1; transform: none;
    transition: max-height .8s cubic-bezier(.22, 1, .36, 1), opacity .7s ease .12s, transform .8s cubic-bezier(.22, 1, .36, 1) .08s;
  }
  .dw-card__link:hover .dw-card__img { transform: scale(1.03); }
}

.dw-empty { padding: 72px 0 24px; }
.dw-empty p { margin: 0 0 24px; font-size: 18px; color: var(--db-muted); }
.dw-reset { background: transparent; color: var(--db-fg); border-color: rgba(242, 240, 235, .6); }
.dw-reset:hover, .dw-reset:focus-visible { background: var(--db-fg); color: var(--db-bg); border-color: var(--db-fg); }
.dw-empty[hidden] { display: none; }
.dw .db-cta { margin-top: 0; }

/* ролик mp4 в окне — как плеер Kinescope */
.dw-modal video { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; background: #000; }

@media (max-width: 1199px) { .dw-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 959px) {
  .dw-head { padding: 64px 0 40px; }
  .dw-lead { margin-bottom: 40px; }
}
@media (max-width: 699px) {
  .dw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dw-card__title { font-size: 17px; }
  .dw-card__text { padding: 14px 14px; }
}
/* телефон: одна колонка, кадр 16:9 (как на главной); облако — в ряд с прокруткой вбок, чтобы не занимать полэкрана */
@media (max-width: 480px) {
  .db { --db-side: 16px; }
  .dw-head { padding: 40px 0 28px; }
  .dw-lead { font-size: 16px; margin: 16px 0 28px; }
  .dw-cloud { gap: 12px; margin: 0 calc(-1 * var(--db-side)); }
  .dw-cloud__cats, .dw-cloud__tags { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 0 var(--db-side); gap: 8px; }
  .dw-cloud__cats::-webkit-scrollbar, .dw-cloud__tags::-webkit-scrollbar { display: none; }
  .dw-chip { height: 40px; padding: 0 16px; font-size: 14px; flex-shrink: 0; }
  .dw-chip--tag { height: 32px; padding: 0 12px; font-size: 13px; }
  .dw-grid { grid-template-columns: minmax(0, 1fr); }
  .dw-card { aspect-ratio: 16 / 9; }
  .dw-card__title { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .dw-card.is-in { animation: none; }
  .dw-chip, .db .dw-card__img, .dw-card__credits { transition: none; }
}
