@font-face {
  font-family: "Suisse Intl";
  src: url("fonts/SuisseIntl-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: block;
}

:root {
  --margin: 10px;          /* общий отступ по краям сайта */
  --pad: 10px;             /* внутренний отступ левой белой части */
  --gap: 10px;             /* зазор в сетке и вокруг разделителя */
  --left-w: 25.4%;         /* ширина левой колонки от ширины окна */
  --cols: 4;               /* колонок в сетке */
  --rule: 1px;             /* толщина разделителя */
  --fs: 14px;
  --lh: 1.15;
  --tracking: -0.02em;
  --ink: #000000;
  --mute: #aaaaaa;
  --paper: #ffffff;
  --veil: 0.92;            /* непрозрачность подложки попапа */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Suisse Intl", -apple-system, sans-serif;
  font-weight: 500;
  font-size: var(--fs);
  line-height: var(--lh);
  letter-spacing: var(--tracking);
  -webkit-font-smoothing: antialiased;
  padding: var(--margin);
}

/* ─────────────────────────────  каркас  ───────────────────────────── */

.page {
  display: flex;
  height: 100%;
}

.left {
  width: var(--left-w);
  flex: 0 0 var(--left-w);
  background: var(--paper);
  padding: var(--pad);
  display: flex;
  flex-direction: column;
}

.divider {
  flex: 0 0 auto;
  width: var(--rule);
  background: var(--ink);
  margin: 0 var(--gap);
}

.right {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}

/* ─────────────────────────────  левая колонка  ───────────────────────────── */

.nav {
  display: flex;
  justify-content: space-between;
  padding-bottom: 2px;
  border-bottom: var(--rule) solid var(--ink);
}

.nav a {
  color: var(--mute);
  text-decoration: none;
}

.nav a.is-active { color: var(--ink); }

.left-top {
  display: flex;
  padding-top: var(--pad);
}

/* две подколонки без внутреннего зазора */
.left-top .intro,
.left-top .portrait { width: 50%; }

.intro p + p { margin-top: var(--pad); }

.portrait {
  display: block;
  background: #eee;
  align-self: flex-start;
}

.portrait img,
.portrait video {
  display: block;
  width: 100%;
  height: auto;
}

.left-bottom { margin-top: auto; }
.left-bottom p + p { margin-top: 1em; }

/* ─────────────────────────────  сетка  ───────────────────────────── */

.grid-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.grid-scroll::-webkit-scrollbar { display: none; }

.grid {
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
}

.grid-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.tile {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: #ededed;
  cursor: pointer;
  overflow: hidden;
}

.tile > * {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.tile img,
.tile video { object-fit: cover; }

/* временная разметка заглушек — уйдёт вместе с реальным контентом */
.tile .stub {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mute);
  background: #ededed;
}

/* ─────────────────────────────  попап  ───────────────────────────── */

.popup {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, var(--veil));
  display: none;
  flex-direction: column;
  color: var(--paper);
}

.popup.is-open { display: flex; }

.popup-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex: 0 0 auto;
}

.popup-bar.is-bottom { margin-top: auto; }

.popup-close {
  display: flex;
  gap: 8px;
  align-items: center;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.popup-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap);
  padding: var(--gap) 0;
}
.popup-scroll::-webkit-scrollbar { display: none; }

.popup-item {
  width: 55%;
  background: #1a1a1a;
  flex: 0 0 auto;
}

.popup-item > * {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ─────────────────────────────  панель настройки  ───────────────────────────── */

.tuner {
  position: fixed;
  top: 0;
  right: 0;
  width: 260px;
  height: 100%;
  background: #fff;
  border-left: 1px solid var(--ink);
  padding: 12px;
  overflow-y: auto;
  display: none;
  z-index: 50;
}

.tuner.is-open { display: block; }

.tuner h2 { font-size: inherit; margin-bottom: 10px; }
.tuner label { display: block; margin-bottom: 10px; color: #555; }
.tuner input[type="range"] { width: 100%; }
.tuner button {
  font: inherit;
  letter-spacing: inherit;
  padding: 6px 10px;
  border: 1px solid var(--ink);
  background: #fff;
  cursor: pointer;
}
.tuner pre {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  white-space: pre-wrap;
  margin-top: 10px;
  color: #555;
}
