/* 3up.works v2.1 — layout draft 27.11 (плотнее)
   Свободная 12-колоночная сетка с узкими полями и зазорами 10px (как у Unknown Untitled / Dirt).
   Размещение — через CSS-переменные на элементе:
   --c  колонки на десктопе (1 / 8),   --m  на мобиле (сетка 6 колонок)
   --t  отступ сверху на десктопе,      --tm на мобиле
   --h  высота плитки в vw на десктопе (картинки в одном ряду выравниваются по высоте и кадрируются)
   --hm то же на мобиле (по умолчанию — родная пропорция)
   Нажми G — покажется сетка. */

:root {
  --ink: #0b0b0b;
  --mute: #8d8d8d;
  --line: #e3e3e3;
  --bg: #fff;
  --tile: #f2f2f2;
  --pad: 12px;
  --gap: 10px;
  --cols: 12;
  --font: "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --s-meta: 12px;
  --s-body: 15px;
  --s-lead: clamp(19px, 1.65vw, 24px);
  --s-name: clamp(56px, 7.2vw, 112px);
  --case-gap: 112px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: var(--s-body);
  line-height: 1.33;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; width: 100%; height: auto; background: var(--tile); }
::selection { background: var(--ink); color: #fff; }

/* ---------- grid ---------- */
.g {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gap);
  padding: 0 var(--pad);
  align-items: start;
}
.g > * { grid-column: var(--c, 1 / -1); margin-top: var(--t, 0); }
.self-end { align-self: end; }
.self-stretch { align-self: stretch; }
.rows { row-gap: var(--gap); }

/* overlay */
.grid-overlay { position: fixed; inset: 0; z-index: 100; pointer-events: none; display: none; }
.grid-overlay .g { height: 100%; }
.grid-overlay .g span { background: rgba(255, 0, 0, .06); border-left: 1px solid rgba(255,0,0,.18); border-right: 1px solid rgba(255,0,0,.18); height: 100%; }
html.show-grid .grid-overlay { display: block; }

/* ---------- type ---------- */
.meta { font-size: var(--s-meta); line-height: 1.35; }
.k, .label, figcaption, .th {
  font-family: var(--mono); font-size: 10.5px; line-height: 1.3;
  letter-spacing: .04em; text-transform: uppercase; color: var(--mute);
}
.mute { color: var(--mute); }
.lead { font-size: var(--s-lead); line-height: 1.2; letter-spacing: -.012em; }
.name {
  font-size: var(--s-name);
  font-weight: 500;
  letter-spacing: -.05em;
  line-height: .86;
  margin-left: -.05em;
}
.num { font-variant-numeric: tabular-nums; }
.u { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s ease; }
a:hover .u, a.u:hover { background-size: 100% 1px; }
.arrow { display: inline-block; transition: transform .3s ease; }
a:hover .arrow { transform: translateX(4px); }
p + p { margin-top: .8em; }

/* ---------- tiles: картинки работ ---------- */
figure { position: relative; }
.tile > img, .tile > video { height: calc(var(--h) * 1vw); object-fit: cover; }
figcaption { margin-top: 6px; }
/* колонка из двух картинок, высота = высоте ряда */
.stack { display: flex; flex-direction: column; gap: var(--gap); height: calc(var(--h) * 1vw); }
.stack > figure { flex: 1 1 0; min-height: 0; }
.stack > figure > img, .stack > figure > video { height: 100%; object-fit: cover; }
/* колонка: текст сверху, картинка снизу */
.col { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; height: calc(var(--h) * 1vw); }

/* ---------- top bar (case pages) ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  padding-top: 12px; padding-bottom: 12px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 13px;
}
.logo { font-weight: 700; letter-spacing: -.02em; font-size: 15px; }

/* lang switch — почти незаметный */
.lang { font-size: 11px; color: #b5b5b5; letter-spacing: .04em; }
.lang button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 2px 0; }
.lang button[aria-pressed="true"] { color: var(--ink); }
.lang i { font-style: normal; margin: 0 3px; }

/* ---------- hero placeholder ---------- */
.hero {
  position: relative;
  height: 84vh; min-height: 600px; max-height: 960px;
  padding: 12px var(--pad);
}
.hero__corner { position: absolute; font-size: 13px; line-height: 1.35; }
.hero__corner.tl { top: 12px; left: var(--pad); }
.hero__corner.tr { top: 12px; right: var(--pad); text-align: right; }
.hero__corner.bl { bottom: 16px; left: var(--pad); max-width: 340px; }
.hero__corner.br { bottom: 16px; right: var(--pad); text-align: right; }
.hero__corner.tl .logo { font-size: 13px; }
.hero__stage {
  position: absolute; left: 50%; top: 50%;
  width: min(42vw, 600px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px dashed #d9d9d9;
  display: grid; place-items: center;
  color: #c4c4c4; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
}
.hero__stage::before, .hero__stage::after { content: ""; position: absolute; background: #ececec; }
.hero__stage::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.hero__stage::after { top: 50%; left: 0; right: 0; height: 1px; }
.hero__stage span { position: relative; z-index: 1; background: #fff; padding: 4px 8px; }

/* ---------- section label (как у Dirt: мелкий моно-капс + линия) ---------- */
.sec { border-top: 1px solid var(--ink); padding-top: 8px; }

/* ---------- index: таблица проектов (Dries Bos / Studio Lathe) ---------- */
.index { padding-bottom: 0; }
.index__head, .index__row {
  display: grid; grid-template-columns: subgrid; grid-column: 1 / -1;
  align-items: baseline;
}
.index__head { padding: 26px 0 8px; }
.index__row { padding: 11px 0 10px; border-top: 1px solid var(--line); font-size: 15px; }
.index__row:last-child { border-bottom: 1px solid var(--line); }
.index__head > *, .index__row > * { grid-column: var(--c); }
.index__row .t { font-weight: 500; }
.index__row .arrow { justify-self: end; }
.index__row:hover { background: #fafafa; }
.index__row:hover .t .u { background-size: 100% 1px; }

/* ---------- case in feed ---------- */
.case { padding-top: var(--case-gap); }
.case:first-of-type { padding-top: 64px; }
.case__head { align-items: end; padding-bottom: 10px; }
.case__head > .hd { border-top: 1px solid var(--ink); grid-column: 1 / -1; height: 0; margin-bottom: 10px; }
.case__head .name { padding-bottom: .02em; }
.case__head .cell { font-size: 13px; line-height: 1.3; padding-bottom: .5em; }
.case__head .cell .k { display: block; margin-bottom: 3px; }
.case .more { font-size: 15px; white-space: nowrap; }
.case .txt { font-size: var(--s-body); }

/* ---------- case page ---------- */
.cp-head { padding-top: 40px; }
.cp-head .name { font-size: clamp(72px, 13.5vw, 210px); }
.cp-meta { border-top: 1px solid var(--ink); padding-top: 8px; margin-top: 18px; }
.cp-meta > div { font-size: 13px; line-height: 1.3; }
.cp-meta .k { display: block; margin-bottom: 3px; }
.cp-block { margin-top: 10px; }
.cp-text { padding-top: 72px; padding-bottom: 80px; }
.cp-text p + p { margin-top: .8em; }
.cp-credits { font-size: 13px; }
.cp-credits dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); }
.cp-credits dd { margin-bottom: 12px; }

.next { padding-top: 96px; padding-bottom: 10px; }
.next .name { font-size: clamp(56px, 9vw, 140px); padding-bottom: .08em; }
.next a:hover .name { font-style: italic; }

/* ---------- footer ---------- */
.foot { padding-top: 120px; padding-bottom: 16px; }
.foot .big { font-size: clamp(40px, 5.6vw, 84px); font-weight: 500; letter-spacing: -.045em; line-height: .95; }
.foot .big a { display: inline-block; }
.foot .small { font-size: 12px; padding-top: 72px; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  :root { --pad: 10px; --gap: 8px; --cols: 6; --s-body: 15px; --s-meta: 11px; --case-gap: 72px; }
  .g > * { grid-column: var(--m, 1 / -1); margin-top: var(--tm, 0); }
  .d-only { display: none !important; }
  .tile > img, .tile > video { height: auto; }
  .tile[style*="--hm"] > img, .tile[style*="--hm"] > video { height: calc(var(--hm) * 1vw); }
  .stack, .col { height: auto; }
  .stack > figure > img, .stack > figure > video { height: auto; }
  .hero { height: 82svh; min-height: 540px; padding: 10px var(--pad); }
  .hero__corner { font-size: 12px; }
  .hero__corner.tl, .hero__corner.tr { top: 10px; }
  .hero__corner.bl { bottom: 14px; max-width: 62%; }
  .hero__corner.br { bottom: 14px; }
  .hero__stage { width: 80vw; transform: translate(-50%, -56%); }
  .index__head { padding-top: 18px; }
  .index__row { font-size: 14px; padding: 10px 0 9px; }
  .case:first-of-type { padding-top: 48px; }
  .case__head { row-gap: 10px; }
  .case__head .cell { padding-bottom: 0; }
  .cp-head { padding-top: 24px; }
  .cp-meta { row-gap: 12px; }
  .cp-text { padding-top: 40px; padding-bottom: 48px; }
  .next { padding-top: 64px; }
  .foot { padding-top: 88px; }
  .foot .small { padding-top: 48px; row-gap: 8px; }
  .bar { padding-top: 10px; padding-bottom: 10px; }
}
@media (min-width: 761px) { .m-only { display: none !important; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.case__head .name a:hover { font-style: italic; }
.case__head .cell { white-space: nowrap; }
@media (max-width: 760px) { .case__head .cell { white-space: normal; } }
@media (max-width: 760px) {
  .index__head > *, .index__row > * { grid-column: var(--m, var(--c)); }
  .stack { flex-direction: row; }
  .stack > figure { flex: 1 1 0; }
}
.next > .meta { grid-column: 1 / -1; border-top: 1px solid var(--ink); padding-top: 8px; }
.next > .meta, .foot .g:first-child > .meta { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; }
.foot .g:first-child > .meta { grid-column: 1 / -1; border-top: 1px solid var(--ink); padding-top: 8px; margin-bottom: 14px; }
/* совместимость: страницы Почты и Мира пока на разметке v1 */
.case__meta { border-top: 1px solid var(--ink); padding-top: 8px; padding-bottom: 14px; }
.case__meta > div { font-size: 13px; line-height: 1.3; }
.case__meta .k { display: block; margin-bottom: 3px; }
