/* Витрина «Шесть» — только шапка, герой, список проектов и страница проекта.
   Палитра и правила: DESIGN.md. */

@import url("fonts/fonts.css");

:root {
  --paper: #f2efe9;
  --paper-2: #eae5db;
  --ink: #12141a;
  --ink-soft: #34373f;
  --muted: #6b6f76;
  --rule: #d5cfc3;
  --accent: #0540f2;
  --ok: #1f7a3d;
  --bad: #b3261e;

  --font-display: "Unbounded", "Golos Text", system-ui, sans-serif;
  --font-body: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1560px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ── Шапка ──────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar__in {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 32px);
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand__mark { width: 14px; height: 14px; background: var(--accent); transform: rotate(45deg); flex: none; }
.brand__text { display: grid; gap: 1px; min-width: 0; }
.brand__kicker {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .015em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 900px) {
  .brand__name { font-size: 11px; }
  .topbar__link { display: none; }
}
.topbar__link {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}
.topbar__link:hover { color: var(--ink); border-bottom-color: var(--ink); }
@media (max-width: 640px) {
    .topbar__link { font-size: 11px; }
}


/* Подпись-надзаголовок (используется на странице работы) */
.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

/* Секции страницы работы */
.section { padding-block: clamp(24px, 4vw, 56px); }

/* Ячейка строки реестра не должна раздуваться длинным названием */
.row__main { min-width: 0; }

/* ── Список проектов ────────────────────────────────────────────── */

.list { padding-block: clamp(28px, 5vw, 64px) clamp(48px, 8vw, 120px); }

.ledger { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }

.row {
  display: grid;
  grid-template-columns: clamp(72px, 8vw, 128px) minmax(0, 1fr) clamp(210px, 26vw, 360px);
  gap: clamp(12px, 2.4vw, 36px);
  align-items: center;
  padding-block: clamp(18px, 2.6vw, 32px);
  border-top: 1px solid var(--rule);
  position: relative;
  transition: background .2s var(--ease), opacity .2s var(--ease);
}
.row:first-child { border-top: 0; }
.row::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--accent);
  transform: scaleY(0); transform-origin: top;
  transition: transform .25s var(--ease);
}
.row:hover { background: #fff; }
.row:hover::before { transform: scaleY(1); }
.ledger:hover .row:not(:hover) { opacity: .5; }

.row__num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 4.2vw, 58px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.4px var(--ink);
  transition: color .2s var(--ease), -webkit-text-stroke-color .2s var(--ease);
}
.row:hover .row__num { color: var(--accent); -webkit-text-stroke-color: var(--accent); }

.row__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(20px, 2.5vw, 34px);
  line-height: 1.08;
  letter-spacing: -.01em;
  margin: 0 0 8px;
}
.row__arrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .62em;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .2s var(--ease), transform .25s var(--ease);
}
.row:hover .row__arrow, .row:focus-visible .row__arrow { opacity: 1; transform: none; }
@media (hover: none) { .row__arrow { opacity: .5; transform: none; } }

.row__brief {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 64ch;
}

.chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid var(--rule);
  color: var(--muted);
  border-radius: 2px;
  white-space: nowrap;
}
.chip--kind { border-color: var(--ink); color: var(--ink); }
.chip--live { border-color: var(--ok); color: var(--ok); }
.chip--off { border-color: var(--bad); color: var(--bad); }

.row__shot {
  position: relative;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s var(--ease), transform .3s var(--ease);
}
.row__shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.row:hover .row__shot, .row:focus-visible .row__shot { opacity: 1; transform: none; }

@media (hover: none) {
  .row__shot { opacity: 1; transform: none; }
  .ledger:hover .row:not(:hover) { opacity: 1; }
}
@media (max-width: 900px) {
  .row { grid-template-columns: 64px minmax(0, 1fr); }
  .row__shot { grid-column: 1 / -1; aspect-ratio: 16 / 9; opacity: 1; transform: none; }
}
@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; }
  .row__num { font-size: 34px; }
}

/* ── Страница проекта ───────────────────────────────────────────── */

.phead { padding-block: clamp(28px, 5vw, 64px) clamp(20px, 3vw, 36px); }
.phead__top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.phead h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(28px, 4.6vw, 62px); line-height: 1; letter-spacing: -.02em;
  margin: 0 0 18px; max-width: 20ch;
}
.phead__brief { font-size: clamp(16px, 1.4vw, 19px); color: var(--ink-soft); max-width: 70ch; margin: 0 0 24px; }
.phead__actions { display: flex; flex-wrap: wrap; gap: 10px; }


.frame { border: 1px solid var(--ink); background: #fff; overflow: hidden; }
.frame__bar {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  border-bottom: 1px solid var(--ink); font-family: var(--font-mono); font-size: 11px; color: var(--muted);
}
.frame__bar span:first-child { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.frame__open {
  margin-left: auto; color: var(--ink); text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 1px;
  transition: color 140ms ease, border-color 140ms ease;
}
.frame__open:hover { color: var(--accent); border-color: var(--accent); }
.frame iframe { display: block; width: 100%; border: 0; height: clamp(420px, 62vh, 820px); background: #fff; }
.frame__fallback { padding: 28px; }
.frame__fallback h3 { font-family: var(--font-display); font-weight: 600; margin: 0 0 10px; font-size: 20px; }
.frame__fallback p { color: var(--ink-soft); margin: 0 0 14px; max-width: 60ch; }




.back {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.back:hover { color: var(--ink); }

/* Соседние разделы одного проекта */
.siblings { padding-block: 0 clamp(40px, 6vw, 88px); }
.siblings__list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.siblings__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  background: #fff;
  font-size: 14.5px;
  transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.siblings__item .mono { font-size: 11px; color: var(--muted); }
.siblings__item:hover { border-color: var(--ink); transform: translateY(-1px); }
.siblings__arrow { color: var(--accent); }

code, kbd, .mono { font-family: var(--font-mono); font-size: .92em; }

/* ── Появление ──────────────────────────────────────────────────── */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.ledger .row { animation: rise .5s var(--ease) both; }
.ledger .row:nth-child(1) { animation-delay: .02s }
.ledger .row:nth-child(2) { animation-delay: .06s }
.ledger .row:nth-child(3) { animation-delay: .1s }
.ledger .row:nth-child(4) { animation-delay: .14s }
.ledger .row:nth-child(5) { animation-delay: .18s }
.ledger .row:nth-child(6) { animation-delay: .22s }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
