/* Витрина работ в стилистике Нортики: белый фон, Golos Text, плотные крупные
   заголовки, серые панели, скругления 28px, чёрные и серые кнопки-пилюли,
   сине-фиолетовый градиент как акцент. Общий файл для главной и страниц кейсов. */

:root {
  --ink: #101014;
  --text: #2d2d2d;
  --muted: #55575e;
  --soft: #8a8d96;
  --gray: #f4f4f5;
  --gray-2: #ebebee;
  --line: #e5e5e5;
  --paper: #ffffff;
  --accent: #4f7df9;
  --accent-2: #7b5bfa;
  --grad: linear-gradient(135deg, #4060f0 0%, #7b5bfa 100%);
  --lime: #c3f04a;
  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 12px;
  --gutter: clamp(16px, 3.1vw, 44px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: "Golos Text", Manrope, system-ui, sans-serif;
  font-size: 16px; line-height: 1.5;
  color: var(--ink); background: var(--paper);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1440px; margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- шапка ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
}
.nav__in {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 68px;
}
.brand { font-size: 21px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.brand i { display: inline-block; width: 8px; height: 8px; margin-left: 2px; border-radius: 50%; background: var(--accent); vertical-align: -1px; }
.nav__acts { display: flex; align-items: center; gap: 8px; }

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 14px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  background: var(--gray); color: var(--ink);
  transition: background-color .2s ease, transform .2s var(--ease);
}
.pill:hover { background: var(--gray-2); }
.pill:active { transform: scale(.97); }
.pill--dark { background: var(--ink); color: #fff; }
.pill--dark:hover { background: #2a2a31; }
.pill--lg { padding: 17px 32px; font-size: 16.8px; }
.pill svg { width: 14px; height: 14px; flex: none; }
@media (max-width: 640px) { .nav__hide { display: none; } }

/* ---------- первый экран: компактный, чтобы кейсы были видны сразу ---------- */
.hero {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  gap: 14px 40px; padding-block: clamp(24px, 3.4vw, 48px) clamp(8px, 1.4vw, 20px);
}
.hero h1 {
  font-size: clamp(34px, 4.4vw, 64px); font-weight: 600;
  line-height: 1.02; letter-spacing: -.035em;
}
.hero h1 .spark { display: inline-block; width: .5em; height: .5em; vertical-align: .16em; margin-inline: .06em; }
.hero + .sec { padding-top: clamp(20px, 2.4vw, 36px); }
.hero__lead { max-width: 440px; font-size: clamp(15px, 1.15vw, 17px); line-height: 1.5; color: var(--text); }

/* ---------- заголовки разделов ---------- */
.sec { padding-block: clamp(36px, 5vw, 72px); }
.sec__head {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  gap: 10px 24px; margin-bottom: clamp(22px, 2.6vw, 36px);
}
.sec__head h2, .h2 {
  font-size: clamp(32px, 3.4vw, 48px); font-weight: 600;
  line-height: 1.08; letter-spacing: -.025em;
}
.sec__note { color: var(--muted); font-size: 15px; max-width: 420px; }

/* ---------- кейсы на главной ---------- */
.cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 820px)  { .cases { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px)  { .cases { grid-template-columns: minmax(0, 1fr); } }

.case { display: flex; flex-direction: column; gap: 14px; }
.case__img {
  position: relative; aspect-ratio: 1 / 1; border-radius: var(--r-lg);
  overflow: hidden; background: var(--c, var(--gray));
}
.case__img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s var(--ease);
}
.case__go {
  position: absolute; right: 16px; bottom: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--ink);
  opacity: 0; transform: translateY(6px) scale(.9);
  transition: opacity .25s ease, transform .35s var(--ease);
}
.case__go svg { width: 16px; height: 16px; }
.case__t { font-size: 20px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.case__d {
  margin-top: 4px; color: var(--muted); font-size: 14.5px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (hover: hover) {
  .case:hover .case__img img { transform: scale(1.04); }
  .case:hover .case__go { opacity: 1; transform: none; }
}

/* переход ко всем работам — широкая полоса под сеткой кейсов */
.case--all { grid-column: 1 / -1; }
.case--all--2 { grid-column: span 2; align-self: center; }
.case--all--1 { grid-column: span 1; align-self: center; }
.case--all--1 .case__img { flex-direction: column; align-items: flex-start; gap: 12px; }
.case--all .case__img {
  aspect-ratio: auto; display: flex; flex-direction: row; align-items: center;
  gap: 24px; padding: 28px 32px; background: var(--gray);
  transition: background-color .25s ease;
}
.case--all .case__go { position: static; margin-left: auto; }
.case--all:hover .case__img { background: var(--gray-2); }
.case--all b { font-size: clamp(44px, 4.4vw, 64px); font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.case--all span { color: var(--muted); font-size: 15px; }
.case--all .case__go { opacity: 1; transform: none; background: var(--ink); color: #fff; }
@media (max-width: 820px) { .case--all, .case--all--2, .case--all--1 { grid-column: 1 / -1; }
  .case--all--1 .case__img { flex-direction: row; align-items: center; gap: 24px; } }
@media (max-width: 560px) { .case--all .case__img { flex-direction: column; align-items: flex-start; gap: 14px; } }

/* ---------- все работы списком ---------- */
.group + .group { margin-top: clamp(34px, 4vw, 56px); }
.group__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.group__head h3 { font-size: 22px; font-weight: 600; letter-spacing: -.015em; }
.group__head em { font-style: normal; color: var(--soft); font-size: 15px; }
.group__note { color: var(--muted); font-size: 14.5px; margin: -6px 0 16px; max-width: 640px; }

.list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 760px) { .list { grid-template-columns: minmax(0, 1fr); } }

.row {
  display: flex; align-items: center; gap: 16px;
  min-height: 72px; padding: 14px 14px 14px 22px;
  border-radius: var(--r-md); background: var(--gray);
  transition: background-color .2s ease;
}
.row:hover { background: var(--gray-2); }
.row__txt { flex: 1; min-width: 0; }
.row__t, .row__d { display: block; }
.row__t { font-weight: 600; font-size: 16px; line-height: 1.3; }
.row__d {
  margin-top: 2px; color: var(--muted); font-size: 14px; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row__go {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: var(--ink);
  transition: background-color .2s ease, color .2s ease;
}
.row__go svg { width: 14px; height: 14px; }
.row:hover .row__go { background: var(--ink); color: #fff; }
.row__off {
  flex: none; font-size: 12px; font-weight: 600; color: #b3261e;
  background: #fde8e7; padding: 3px 9px; border-radius: 999px;
}

/* ---------- появление при прокрутке ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- страница кейса ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 15px; }
.back:hover { color: var(--ink); }
.back svg { width: 14px; height: 14px; }

.chero {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(28px, 4vw, 64px); align-items: center;
  padding-block: clamp(28px, 4vw, 56px) clamp(40px, 6vw, 88px);
}
@media (max-width: 900px) { .chero { grid-template-columns: 1fr; } }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 26px 0 18px; }
.tag { padding: 6px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 600; background: var(--gray); }
.tag:first-child { background: var(--ink); color: #fff; }
.chero h1 {
  font-size: clamp(46px, 6.4vw, 92px); font-weight: 600;
  line-height: 1.02; letter-spacing: -.035em;
}
.chero__lead { margin-top: 20px; max-width: 34ch; font-size: clamp(18px, 1.6vw, 22px); line-height: 1.45; color: var(--text); }
.chero__acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.chero__img { border-radius: var(--r-lg); overflow: hidden; background: var(--c, var(--gray)); aspect-ratio: 1 / 1; }
.chero__img img { width: 100%; height: 100%; object-fit: cover; }

.split {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(20px, 4vw, 64px); align-items: start;
}
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.prose p { font-size: clamp(17px, 1.35vw, 20px); line-height: 1.6; color: var(--text); }
.prose p + p { margin-top: 1em; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1000px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .steps { grid-template-columns: 1fr; } }
@media (min-width: 1001px) {
  .steps--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .steps--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.step { background: var(--gray); border-radius: var(--r-md); padding: 22px 22px 26px; }
.step__n {
  width: 42px; height: 42px; border-radius: var(--r-sm);
  display: grid; place-items: center; margin-bottom: 18px;
  background: var(--grad); color: #fff; font-weight: 600; font-size: 15px;
}
.step:nth-child(3n+2) .step__n { background: #10b981; }
.step:nth-child(3n+3) .step__n { background: var(--ink); }
.step p { font-size: 16px; line-height: 1.5; color: var(--text); }

.result {
  border-radius: var(--r-lg); background: var(--grad); color: #fff;
  padding: clamp(32px, 5vw, 72px);
  display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: clamp(20px, 4vw, 56px);
}
@media (max-width: 820px) { .result { grid-template-columns: 1fr; } }
.result p { font-size: clamp(18px, 1.7vw, 24px); line-height: 1.5; }
.result p + p { margin-top: .9em; color: rgba(255, 255, 255, .86); }
.result .pill { margin-top: 28px; background: #fff; }
.result .pill:hover { background: #eef0ff; }

.slides { display: grid; gap: clamp(14px, 2vw, 24px); max-width: 1180px; margin: 0 auto; }
.slide { border-radius: var(--r-md); overflow: hidden; background: var(--gray); border: 1px solid var(--line); }
.slide img { width: 100%; height: auto; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .pager { grid-template-columns: 1fr; } }
.pager a {
  display: flex; align-items: center; gap: 16px;
  padding: 14px; border-radius: var(--r-md); background: var(--gray);
  transition: background-color .2s ease;
}
.pager a:hover { background: var(--gray-2); }
.pager img { width: 72px; height: 72px; border-radius: var(--r-sm); object-fit: cover; flex: none; }
.pager small { display: block; color: var(--muted); font-size: 13px; }
.pager b { font-size: 18px; font-weight: 600; }
.pager a:last-child { flex-direction: row-reverse; text-align: right; }
@media (max-width: 640px) { .pager a:last-child { flex-direction: row; text-align: left; } }

/* ---------- подвал ---------- */
.foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding-block: 28px 36px; margin-top: clamp(40px, 6vw, 80px);
  border-top: 1px solid var(--line); color: var(--soft); font-size: 13.5px;
}
.foot__lnk { background: none; border: 0; padding: 0; cursor: pointer; color: var(--soft); font-size: 13.5px; }
.foot__lnk:hover { color: var(--ink); }
.foot__dot { font-size: 18px; line-height: 1; }
.foot form { display: inline; }

/* ---------- вход владельца и режим правки ---------- */
.loginbox {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 10002;
  width: min(560px, calc(100vw - 32px));
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px; box-shadow: 0 24px 60px -20px rgba(16, 16, 20, .35);
}
.loginbox__f { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.loginbox input {
  flex: 1 1 140px; min-width: 0; padding: 11px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--gray); font: inherit; font-size: 14px; color: var(--ink);
}
.loginbox input:focus { outline: none; border-color: var(--accent); background: #fff; }
.loginbox__err { width: 100%; color: #b3261e; font-size: 13px; padding-left: 6px; }

.editbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  padding: 10px var(--gutter); background: var(--ink); color: #fff; font-size: 13.5px;
}
.editbar__t { font-weight: 600; }
.editbar__b { padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; cursor: pointer; font-weight: 600; font-size: 13px; }
.editbar__b.is-on { background: #fff; color: var(--ink); }
.editbar__s { color: rgba(255,255,255,.7); }
.editbar ~ .page-shell .nav { top: 50px; }
body.editing .row { cursor: grab; }
body.editing .row:active { cursor: grabbing; }
.row.is-drag { opacity: .4; }
.row.is-over { outline: 2px dashed var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .case__img img, .case__go, .pill { transition: none !important; }
}
