/* onesoul | design — графитовая гамма, шрифты студии, один акцент.
   Яркое на сайте — только сами работы и цвета, снятые с них пипеткой. */
@font-face { font-family: 'NM Serif'; src: url(fonts/nm-serif.woff) format('woff'); font-display: swap; }
@font-face { font-family: 'Onest'; src: url(fonts/onest.woff) format('woff'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Martian'; src: url(fonts/martian.woff) format('woff'); font-display: swap; }

:root {
  --bg: #111112;
  --deep: #0c0c0d;
  --card: #18181a;
  --raised: #222224;
  --line: rgba(237, 237, 237, .08);
  --line-2: rgba(237, 237, 237, .14);
  --fg: #ededed;
  --fg-2: #a1a1a6;
  --muted: #86868c;
  --accent: #ff6f61;          /* «Коралл» из палитр блога */
  --ease: cubic-bezier(.22, 1, .36, 1);

  --serif: 'NM Serif', 'Times New Roman', serif;
  --sans: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Martian', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
p { margin: 0; }
img, video { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: #111; }

.wrap { width: min(1360px, 100% - 48px); margin: 0 auto; }
@media (max-width: 640px) { .wrap { width: calc(100% - 32px); } }

/* ---------- шапка ---------- */
.top { position: sticky; top: 0; z-index: 40; background: rgba(17, 17, 18, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .3s var(--ease); }
.top.scrolled { border-bottom-color: var(--line); }
.top-in { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font: 500 17px/1 var(--sans); letter-spacing: -.01em; white-space: nowrap; }
.brand .bar { color: var(--muted); margin: 0 .3em; font-weight: 300; }
.brand .sub { color: var(--fg-2); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a, .tool {
  height: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 8px;
  font-size: 14px; color: var(--fg-2); transition: color .16s var(--ease), background-color .16s var(--ease);
}
.nav a:hover, .tool:hover { color: var(--fg); background: var(--card); }
.nav a[aria-current="page"] { color: var(--fg); }
.tool { border: 1px solid var(--line-2); background: none; cursor: pointer; margin-left: 8px; }
.tool[aria-pressed="true"] { color: #111; background: var(--fg); border-color: var(--fg); }
.tool svg { width: 16px; height: 16px; }
.tool kbd { font: 400 11px/1 var(--mono); color: inherit; opacity: .6; border: 1px solid currentColor; border-radius: 4px; padding: 3px 4px; }
@media (max-width: 720px) { .nav a.hide-sm, .tool kbd { display: none; } .nav a { padding: 0 8px; } .tool { margin-left: 4px; } }
@media (hover: none) { .tool { display: none; } }

/* ---------- типографика ---------- */
.serif { font-family: var(--serif); font-weight: 400; }
h1, h2, h3 { margin: 0; font-weight: 400; }
.h-display { font: 400 clamp(44px, 7.4vw, 112px)/.98 var(--serif); letter-spacing: -.02em; }
.h-page { font: 400 clamp(40px, 6vw, 88px)/1 var(--serif); letter-spacing: -.02em; }
.h-sec { font: 400 clamp(30px, 3.6vw, 48px)/1.05 var(--serif); letter-spacing: -.01em; }
.label { font: 400 12px/16px var(--mono); color: var(--muted); letter-spacing: .01em; }
.lead { font-size: clamp(18px, 1.6vw, 20px); line-height: 1.5; color: var(--fg-2); max-width: 36rem; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* маска для построчного появления заголовка */
.line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.line > span { display: inline-block; transform: translateY(105%); transition: transform .9s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.ready .line > span { transform: none; }

/* появление при прокрутке */
[data-reveal] { opacity: 0; transform: translateY(12px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(var(--d, 0) * 60ms); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- кнопки ---------- */
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  height: 48px; padding: 0 20px; border-radius: 10px; display: inline-flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 500; cursor: pointer; border: 1px solid transparent;
  transition: background-color .16s var(--ease), color .16s var(--ease), transform .12s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn-1 { background: var(--fg); color: #111; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-1:hover { background: #fff; }
.btn-2 { background: var(--card); border-color: var(--line-2); color: var(--fg); }
.btn-2:hover { background: var(--raised); }
.btn .arr { transition: transform .2s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }

/* ---------- главная: первый экран ---------- */
.hero { min-height: calc(100svh - 64px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-block: 48px 64px; }
.hero-text { display: grid; gap: 28px; align-content: center; }
.hero-text .lead { max-width: 30rem; }
.hint { display: flex; align-items: center; gap: 10px; font: 400 12px/16px var(--mono); color: var(--muted); }
.hint .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
@media (max-width: 960px) { .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 32px; } }

/* веер из работ */
.fan { position: relative; height: min(640px, 76svh); }
.fan a {
  position: absolute; left: 50%; top: 50%; width: min(300px, 46%); aspect-ratio: 4 / 5;
  border-radius: 14px; overflow: hidden; background: var(--card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 24px 48px -16px rgba(0, 0, 0, .7);
  transform: translate(-50%, -50%) translate(var(--x, 0), var(--y, 0)) rotate(var(--r, 0deg));
  transition: transform .7s var(--ease), opacity .5s var(--ease);
  opacity: 0;
}
.ready .fan a { opacity: 1; --x: var(--fx); --y: var(--fy); --r: var(--fr); }
.ready .fan a:nth-child(1) { transition-delay: .25s; } .ready .fan a:nth-child(2) { transition-delay: .31s; } .ready .fan a:nth-child(3) { transition-delay: .37s; } .ready .fan a:nth-child(4) { transition-delay: .43s; } .ready .fan a:nth-child(5) { transition-delay: .49s; }
.ready.settled .fan a { transition-delay: 0s; }
.fan:hover a { --x: calc(var(--fx) * 1.45); --y: calc(var(--fy) * 1.6); }
.fan a:hover, .fan a:focus-visible { --y: calc(var(--fy) * 1.6 - 28px) !important; --r: 0deg !important; z-index: 6; }
.fan img { width: 100%; height: 100%; object-fit: cover; }
.fan .cap {
  position: absolute; left: 10px; bottom: 10px; right: 10px; display: flex; justify-content: space-between; gap: 8px;
  font: 400 11px/14px var(--mono); color: #fff; padding: 6px 8px; border-radius: 6px; background: rgba(12, 12, 13, .72);
  opacity: 0; transform: translateY(4px); transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.fan a:hover .cap, .fan a:focus-visible .cap { opacity: 1; transform: none; }
@media (max-width: 960px) { .fan { height: 440px; } .fan a { width: min(220px, 52%); } }

/* ---------- секции главной ---------- */
.block { padding-block: 112px; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 32px 48px; }
.block > .label { padding-top: 10px; }
@media (max-width: 860px) { .block { grid-template-columns: minmax(0, 1fr); padding-block: 72px; } }

.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: 48px; align-items: start; }
.about-text { display: grid; gap: 20px; }
.about-text p { color: var(--fg-2); max-width: 40rem; }
.about-text p strong { color: var(--fg); font-weight: 500; }
.portrait { margin: 0; display: grid; gap: 12px; }
.portrait-frame { aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--card); }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; }
.portrait figcaption { display: flex; justify-content: space-between; gap: 12px; }
@media (max-width: 860px) { .about { grid-template-columns: minmax(0, 1fr); } .portrait { max-width: 420px; } }

.niches { display: flex; flex-wrap: wrap; gap: 8px; }
.niches span { font-size: 14px; padding: 6px 12px; border-radius: 6px; background: var(--card); border: 1px solid var(--line); color: var(--fg-2); }

/* услуги: при наведении рядом с курсором всплывает пример работы */
.services { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.services li { border-bottom: 1px solid var(--line); }
.services a { display: grid; grid-template-columns: 48px minmax(0, 5fr) minmax(0, 6fr) 24px; gap: 8px 24px; align-items: baseline; padding: 24px 0; transition: color .16s var(--ease); }
.services .n { font: 400 12px/16px var(--mono); color: var(--muted); }
.services h3 { font: 400 clamp(22px, 2.2vw, 30px)/1.15 var(--serif); transition: transform .3s var(--ease); }
.services p { color: var(--muted); font-size: 15px; }
.services .go { color: var(--muted); transition: transform .3s var(--ease), color .16s var(--ease); }
.services a:hover h3 { transform: translateX(8px); }
.services a:hover .go { color: var(--fg); transform: translateX(4px); }
@media (max-width: 720px) { .services a { grid-template-columns: 32px minmax(0, 1fr); } .services p { grid-column: 2; } .services .go { display: none; } }
.peek {
  position: fixed; left: 0; top: 0; z-index: 30; width: 240px; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden;
  pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(.9);
  transition: opacity .25s var(--ease), transform .25s var(--ease); box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .8);
}
.peek.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.peek img { width: 100%; height: 100%; object-fit: cover; }
@media (hover: none) { .peek { display: none; } }

/* этапы */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 32px; counter-reset: s; }
.steps li { display: grid; gap: 8px; align-content: start; padding-top: 16px; border-top: 1px solid var(--line-2); }
.steps .n { font: 400 12px/16px var(--mono); color: var(--muted); }
.steps b { font-weight: 500; font-size: 17px; }
.steps span:last-child { color: var(--muted); font-size: 15px; }
@media (max-width: 860px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* контакты */
.contact-big { display: grid; gap: 32px; }
.tg { font: 400 clamp(40px, 7vw, 104px)/1 var(--serif); letter-spacing: -.02em; display: inline-flex; align-items: baseline; gap: .2em; width: fit-content; position: relative; }
.tg::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.08em; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.tg:hover::after { transform: scaleX(1); }
.tg .arr { font-size: .5em; color: var(--muted); transition: transform .3s var(--ease), color .2s; }
.tg:hover .arr { transform: translate(4px, -4px); color: var(--fg); }
.links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.links a { color: var(--fg-2); border-bottom: 1px solid var(--line-2); padding-bottom: 2px; transition: color .16s, border-color .16s; }
.links a:hover { color: var(--fg); border-color: var(--fg); }

/* ---------- портфолио ---------- */
.page { padding-block: 64px 112px; display: grid; gap: 64px; }
.page-head { display: grid; gap: 20px; max-width: 900px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font: 400 12px/16px var(--mono); color: var(--muted); }
.crumbs a, .crumbs button { color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; font: inherit; transition: color .16s; }
.crumbs a:hover, .crumbs button:hover { color: var(--fg); }
.crumbs .here { color: var(--fg-2); }
.status:empty { display: none; }

.sections { display: grid; gap: 16px; }
.sec {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; padding: 24px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line); transition: background-color .2s var(--ease);
}
.sec:hover { background: #1c1c1e; }
.sec-info { display: grid; align-content: space-between; gap: 32px; padding: 8px; }
.sec-info h2 { font: 400 clamp(32px, 3.8vw, 56px)/1 var(--serif); letter-spacing: -.01em; }
.sec-info p { color: var(--fg-2); margin-top: 12px; max-width: 28rem; }
.sec-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sec-go { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--fg); }
.sec-go .arr { transition: transform .3s var(--ease); }
.sec:hover .sec-go .arr { transform: translateX(6px); }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; height: 340px; }
.strip span { border-radius: 10px; overflow: hidden; background: var(--raised); transition: flex-grow .5s var(--ease); }
.strip img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.sec:hover .strip img { transform: scale(1.03); }

.strip-deck { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.strip-deck img { object-position: center; }
.strip-web img { object-position: top center; }
@media (max-width: 860px) { .sec { grid-template-columns: minmax(0, 1fr); padding: 16px; } .strip { height: 240px; } }
@media (max-width: 520px) { .strip:not(.strip-deck) span:nth-child(n+3) { display: none; } }

/* палитры блога */
.pairs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; height: 340px; }
.pair { border-radius: 10px; overflow: hidden; display: grid; grid-template-rows: 1fr 1fr; }
.pair i { display: flex; flex-direction: column; justify-content: flex-end; padding: 12px; font: 400 11px/15px var(--mono); font-style: normal; }
.pair i b { font: 400 18px/1.2 var(--serif); }
@media (max-width: 860px) { .pairs { height: 240px; } }
@media (max-width: 520px) { .pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pair:nth-child(3) { display: none; } }

/* палитра, снятая с обложки */
.palette { display: flex; gap: 4px; height: 24px; }
.palette button { flex: 1; border: 0; border-radius: 4px; cursor: pointer; position: relative; padding: 0; transition: flex-grow .3s var(--ease); }
.palette button:hover { flex-grow: 2.4; }
.palette button span { position: absolute; inset: 0; display: grid; place-items: center; font: 400 10px/1 var(--mono); opacity: 0; transition: opacity .16s; }
.palette button:hover span { opacity: 1; }

/* проекты внутри раздела */
.view { display: grid; gap: 32px; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.proj {
  display: grid; gap: 16px; padding: 12px 12px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  text-align: left; cursor: pointer; min-width: 0; transition: background-color .2s var(--ease);
}
.proj:hover { background: #1c1c1e; }
.proj .plate { aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: var(--raised); }
.proj-grid.web .plate { aspect-ratio: 4 / 5; }
.proj-grid.deck .plate { aspect-ratio: 16 / 10; }
.proj .plate img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .8s var(--ease); }
.proj:hover .plate img { transform: scale(1.03); }
.proj-body { display: grid; gap: 4px; padding: 0 4px; }
.proj-title { font: 400 22px/1.15 var(--serif); }
.proj-meta { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 0 4px; }

.case-text { display: grid; gap: 16px; max-width: 44rem; color: var(--fg-2); }
.case-text p:first-child { color: var(--fg); font-size: 19px; line-height: 1.5; }
.tiles { columns: 3 300px; column-gap: 16px; }
.tiles > .tile { break-inside: avoid; margin-bottom: 16px; width: 100%; }
.tiles.deck { columns: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.tiles.deck > .tile { margin: 0; }
.tile { display: grid; gap: 10px; padding: 8px 8px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); cursor: zoom-in; text-align: left; transition: background-color .2s var(--ease); }
.tile:hover { background: #1c1c1e; }
.tile .plate { border-radius: 8px; overflow: hidden; background: var(--raised); }
.tile img { width: 100%; height: auto; }
.tile-cap { display: flex; justify-content: space-between; gap: 12px; padding: 0 4px; min-width: 0; }
.tile-title { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-width: 400px) { .tiles { columns: 1; } .tiles.deck, .proj-grid { grid-template-columns: minmax(0, 1fr); } }

.empty { display: grid; gap: 12px; padding: 32px; border: 1px dashed var(--line-2); border-radius: 16px; max-width: 640px; }
.notice { font: 400 12px/1.6 var(--mono); color: var(--muted); }

/* ---------- просмотр ---------- */
.lb { position: fixed; inset: 0; z-index: 60; background: rgba(10, 10, 11, .97); display: grid; grid-template-rows: minmax(0, 1fr) auto; padding: 64px 16px 16px; animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.lb-stage { display: grid; place-items: center; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: calc(100dvh - 150px); width: auto; height: auto; border-radius: 8px; }
.lb-stage.tall { place-items: start center; }
.lb-stage.tall img { max-height: none; width: min(1100px, 100%); }
.lb-bar { display: flex; justify-content: space-between; gap: 16px; padding-top: 12px; }
.lb-title { font-size: 15px; }
.lb-btn { position: absolute; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); color: var(--fg); cursor: pointer; display: grid; place-items: center; font-size: 18px; transition: background-color .16s; }
.lb-btn:hover { background: var(--raised); }
.lb-close { top: 12px; right: 16px; }
.lb-prev { left: 16px; top: 50%; }
.lb-next { right: 16px; top: 50%; }
@media (max-width: 760px) { .lb-prev, .lb-next { top: auto; bottom: 56px; } }

/* ---------- пипетка ---------- */
body.picking, body.picking a, body.picking button { cursor: crosshair; }
.loupe {
  position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; display: flex; align-items: center; gap: 8px;
  opacity: 0; transition: opacity .12s var(--ease);
}
.loupe.on { opacity: 1; }
.loupe i { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 8px 20px rgba(0, 0, 0, .5); transform: translate(-50%, -50%); }
.loupe span { font: 400 12px/1 var(--mono); background: #fff; color: #111; padding: 6px 8px; border-radius: 6px; transform: translate(-12px, -50%); }

.tray {
  position: fixed; left: 50%; bottom: 16px; z-index: 50; display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 16px; border-radius: 14px; background: rgba(24, 24, 26, .94); border: 1px solid var(--line-2);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transform: translate(-50%, 140%); transition: transform .45s var(--ease); max-width: calc(100% - 32px);
}
.tray.on { transform: translate(-50%, 0); }
.tray .label { white-space: nowrap; }
.tray-sw { display: flex; gap: 4px; }
.tray-sw button { width: 56px; height: 40px; border-radius: 8px; border: 0; cursor: pointer; position: relative; animation: pop .35s var(--ease); }
.tray-sw button span { position: absolute; inset: auto 0 4px; font: 400 9px/1 var(--mono); text-align: center; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.tray-x { width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.tray-x:hover { color: var(--fg); background: var(--raised); }
@media (max-width: 520px) { .tray .label { display: none; } .tray-sw button { width: 44px; } }

.toast {
  position: fixed; left: 50%; top: 76px; z-index: 80; transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  font: 400 12px/1 var(--mono); background: var(--fg); color: #111; padding: 10px 12px; border-radius: 8px;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- подвал ---------- */
.foot { border-top: 1px solid var(--line); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 24px 32px; }
.foot a:hover { color: var(--fg); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .line > span, [data-reveal] { transform: none; opacity: 1; }
}
