/* Тату-студия чёрной графики — главная */

:root {
  --paper: #e8e6e1;
  --ink: #0f0d0d;
  --ink-2: #1c1818;
  --bone: #eae9e7;
  --bone-2: #b0aca8;
  --red: #a3121a;
  --red-2: #860d14;
  --muted: #4a4542;

  --display: "Forum", "Times New Roman", serif;
  --text: "Manrope", "Segoe UI", system-ui, sans-serif;

  /* шкала: 15 / 17 / 19 / 30 / h2 / h1 / подвал */
  --fs-small: 15px;
  --fs-body: 17px;
  --fs-lead: 19px;
  --fs-mid: 30px;
  --fs-h2: clamp(40px, 4.4vw, 64px);
  --fs-h1: clamp(46px, 7vw, 80px);

  --gutter: clamp(16px, 3.4vw, 48px);
  --spine: clamp(400px, 37vw, 560px);
  --gap: clamp(24px, 3vw, 48px);

  /* ангел первого экрана: ширина, высота и сколько хвоста выходит на бумагу */
  --art-w: min(720px, 50vw);
  --ar: .6516;              /* ширина/высота рисунка; на странице задаётся у каждого эскиза */
  --art-h: calc(var(--art-w) / var(--ar));
  --spine-h: 960px;         /* рост эскиза в хребте: ширина = рост × пропорция, но не шире колонки */
  --tail: calc(var(--art-w) * .5);

  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--fs-body)/1.55 var(--text);
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; }
p { margin: 0; }
ul, ol, dl, dd, figure { margin: 0; padding: 0; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
::selection { background: var(--red); color: var(--bone); }

/* зерно бумаги */
.paper {
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3  0 0 0 0 0.28  0 0 0 0 0.26  0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Кнопки и ссылки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 28px;
  font: 700 var(--fs-body)/1 var(--text);
  text-decoration: none; border: 0; border-radius: 0; cursor: pointer;
  transition: background-color .2s, transform .15s var(--ease-out);
}
.btn--red { background: var(--red); color: var(--bone); }
.btn--red:hover { background: var(--red-2); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn--wide { width: 100%; }

.link {
  font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px;
  text-underline-offset: 6px; text-decoration-color: var(--red);
  transition: text-underline-offset .2s var(--ease-out);
}
.link:hover { text-underline-offset: 9px; }
.link--bone { color: var(--bone); }

/* ---------- Первый экран ---------- */
.hero {
  position: relative; z-index: 2;
  height: max(720px, calc(var(--art-h) - var(--tail) + 88px));
  background: var(--ink);
  color: var(--bone);
}
/* рваный край с потёками: тушь первого экрана стекает на бумагу */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; top: calc(100% - 2px);
  height: 320px;
  background: url("../ink/edge-drip.f7c9ed1ba70b.webp") center top / auto 100% repeat-x;
  pointer-events: none; z-index: 3;
}

.bar {
  position: relative; z-index: 5;
  display: flex; align-items: center; gap: 40px;
  max-width: 1440px; margin: 0 auto; padding: 24px var(--gutter);
}
.bar__mark { font: 400 var(--fs-mid)/1 var(--display); text-decoration: none; margin-right: auto; }
.bar__links { display: flex; gap: 32px; list-style: none; }
.bar__links a { text-decoration: none; font-weight: 500; transition: color .2s; }
.bar__links a:hover { color: var(--bone-2); }
.bar__cta {
  background: var(--red); padding: 12px 20px; font-weight: 700; text-decoration: none;
  transition: background-color .2s;
}
.bar__cta:hover { background: var(--red-2); }

.hero__text {
  position: relative; z-index: 4;
  max-width: 1440px; margin: 0 auto;
  padding: clamp(64px, 11vh, 120px) var(--gutter) 0;
}
.hero h1 {
  max-width: 600px;
  font-size: var(--fs-h1); line-height: .96; letter-spacing: -.02em;
}
.hero__lead { margin-top: 36px; font-size: var(--fs-lead); max-width: 470px; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; margin-top: 44px; }

/* ангел: светлая тушь на чёрном; ниже края тот же рисунок продолжается чёрной тушью */
.hero__art {
  position: absolute; z-index: 2;
  right: max(var(--gutter), calc((100vw - 1440px) / 2 + var(--gutter)));
  bottom: calc(-1 * var(--tail));
  width: var(--art-w);
  aspect-ratio: var(--ar);
}
.hero__art > .hero__bone, .hero__art > .hero__ink {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.hero__bone { clip-path: inset(0 0 var(--tail) 0); }
.hero__ink { clip-path: inset(calc(100% - var(--tail)) 0 0 0); }

.spray { position: absolute; pointer-events: none; max-width: none; }
.spray--hero { width: 30%; left: 64%; top: 36%; }

.tag--hero {
  position: absolute; z-index: 4;
  right: max(var(--gutter), calc((100vw - 1440px) / 2 + var(--gutter)));
  bottom: 96px; width: 280px;
}

/* ---------- Красные плашки эскизов ---------- */
.tag {
  background: var(--red); color: var(--bone);
  padding: 26px 28px 24px; width: min(100%, 320px);
}
.tag__title { font-size: var(--fs-mid); line-height: 1; }
.tag__meta { margin-top: 10px; font-size: var(--fs-small); line-height: 1.5; }
.tag__claim {
  margin-top: 18px; min-height: 44px; padding: 0 18px;
  background: var(--bone); color: var(--ink); border: 0; cursor: pointer;
  font-weight: 700; font-size: var(--fs-small);
  transition: background-color .2s, color .2s, transform .15s var(--ease-out);
}
.tag__claim:hover, .tag__claim[aria-pressed="true"] { background: var(--ink); color: var(--bone); }
.tag__claim:active { transform: scale(.97); }

/* ---------- Ряды: хребет из эскизов по центру, контент по бокам ---------- */
.paper { position: relative; z-index: 1; padding-top: 1px; }

.row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--spine) minmax(0, 1fr);
  column-gap: var(--gap);
  align-items: start;
  max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter);
}
.col { position: relative; z-index: 3; display: flex; flex-direction: column; gap: 36px; grid-row: 1; }
.col--l { grid-column: 1; align-items: flex-start; }
.col--r { grid-column: 3; align-items: flex-end; }
.col--r > * { width: 100%; max-width: 360px; }

.piece {
  position: relative; z-index: 2; grid-column: 2; grid-row: 1; justify-self: center;
  width: min(100%, calc(var(--spine-h) * var(--ar)));
}
.piece img { width: 100%; }

h2 { font-size: var(--fs-h2); line-height: 1; letter-spacing: -.02em; }
.col p + p { margin-top: -16px; }

/* стили */
.row--styles { padding-top: calc(var(--tail) - 40px); }
.row--styles .col--l { padding-top: 30px; }
.row--styles .col--r { padding-top: 250px; }
.styles { display: grid; gap: 24px; }
.styles dt { font: 400 var(--fs-mid)/1.05 var(--display); }
.styles dd { margin-top: 6px; max-width: 34ch; }
.statement { font: 400 var(--fs-mid)/1.15 var(--display); }
.spray--join1 { width: 420px; left: 50%; bottom: -170px; transform: translateX(-50%); z-index: 1; }

/* свободные эскизы */
.row--nun { margin-top: -40px; }
.row--nun .col--l { padding-top: 200px; }
.row--nun .col--l p { max-width: 36ch; }
.row--nun .col--r { padding-top: 380px; }
.spray--nun { width: 280px; left: calc(50% + 110px); top: 250px; z-index: 1; }

/* рыцарь и эскиз под вас */
.row--knight { margin-top: -30px; }
.row--knight .col--l { padding-top: 420px; }
.row--knight .col--r { padding-top: 150px; }
.custom { background: var(--ink); color: var(--bone); padding: 40px 36px; }
.custom p { margin: 20px 0 28px; }
.spray--join2 { width: 560px; left: 50%; bottom: -150px; transform: translateX(-50%); z-index: 1; }

/* процесс */
.row--process { margin-top: -20px; }
.row--process .col--l { padding-top: 150px; }
.row--process .col--r { padding-top: 400px; }
.steps { list-style: none; display: grid; gap: 28px; }
.steps h3 { font-size: var(--fs-mid); line-height: 1.05; }
.steps p { margin-top: 8px; max-width: 34ch; }
.price { font: 400 var(--fs-mid)/1.15 var(--display); }
.spray--crown { width: 380px; left: calc(50% - 300px); top: 120px; z-index: 1; }

/* запись */
.row--booking { margin-top: 0; padding-bottom: 260px; }
.row--booking .col--l { padding-top: 220px; }
.row--booking .col--r { padding-top: 120px; }
.contacts { list-style: none; display: grid; gap: 14px; font: 400 var(--fs-mid)/1.1 var(--display); }
.contacts a { text-decoration: none; transition: color .2s; }
.contacts a:hover { color: var(--red); }
.note { font-size: var(--fs-small); }

.form { background: var(--ink); color: var(--bone); padding: 36px 32px 28px; display: grid; gap: 18px; }
.form__title { font-size: var(--fs-mid); line-height: 1; }
.field { display: grid; gap: 6px; }
.field span { font-size: var(--fs-small); color: var(--bone-2); }
.field input, .field textarea {
  width: 100%; background: var(--ink-2); border: 0; border-bottom: 2px solid #3a3433;
  padding: 12px 14px; color: var(--bone); border-radius: 0; resize: vertical;
  transition: border-color .2s, background-color .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--red); background: #241f1f; }
.field input[aria-invalid="true"] { border-bottom-color: var(--red); }
.check { display: flex; gap: 12px; align-items: center; font-size: var(--fs-small); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--red); }
.form__status { font-size: var(--fs-small); min-height: 1.5em; }
.form__status.is-error { color: #ff9a9a; }
.form__pick[hidden] { display: none; }
.form__pick { display: flex; gap: 16px; align-items: center; background: var(--ink-2); padding: 12px; }
.form__pick img { width: 64px; height: 84px; object-fit: contain; background: var(--paper); padding: 4px; }
.form__pick-name { font: 400 var(--fs-mid)/1.05 var(--display); }
.form__unpick {
  margin-top: 6px; background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--bone-2); text-decoration: underline; font-size: var(--fs-small);
}
.form__unpick:hover { color: var(--bone); }

/* ---------- Подвал ---------- */
.foot { position: relative; z-index: 2; background: var(--ink); color: var(--bone); padding: 24px var(--gutter) 40px; }
.foot::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(100% - 2px); height: 260px;
  background: url("../ink/edge-rise.f6404a579e5c.webp") center top / auto 100% repeat-x;
  transform: scaleY(-1); pointer-events: none;
}
.foot__word {
  position: relative; text-align: center; white-space: nowrap;
  font: 400 clamp(52px, 12.4vw, 180px)/.9 var(--display); letter-spacing: -.03em;
}
.foot__row {
  position: relative; display: flex; flex-wrap: wrap; gap: 16px 40px; justify-content: center;
  margin-top: 40px; font-size: var(--fs-small); color: var(--bone-2);
}
.foot__row a { color: var(--bone); text-decoration: none; transition: color .2s; }
.foot__row a:hover { color: var(--bone-2); }

/* ---------- Движение ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
@keyframes ink-in { from { opacity: 0; transform: translateY(40px) scale(.97); } }
@keyframes drop-in { from { opacity: 0; transform: scale(.6); } }

.hero__text > * { animation: rise .9s var(--ease-out) both; }
.hero__text > :nth-child(2) { animation-delay: .08s; }
.hero__text > :nth-child(3) { animation-delay: .16s; }
.hero__art > img:not(.spray) { animation: ink-in 1.4s var(--ease-out) .1s both; }
.spray--hero { animation: drop-in .7s var(--ease-out) .9s both; }
.tag--hero { animation: rise .9s var(--ease-out) .5s both; }

.js [data-reveal]:not(.tag):not(.custom):not(.form):not(.statement) > *,
.js .tag[data-reveal], .js .custom[data-reveal], .js .form[data-reveal], .js .statement[data-reveal] {
  opacity: 0; transform: translateY(24px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.js [data-reveal].is-in:not(.tag):not(.custom):not(.form):not(.statement) > *,
.js .tag[data-reveal].is-in, .js .custom[data-reveal].is-in, .js .form[data-reveal].is-in, .js .statement[data-reveal].is-in {
  opacity: 1; transform: none;
}
/* эскизы на бумаге проступают, как тушь */
.js .paper .piece img { transition: opacity 1.1s var(--ease-out), transform 1.4s var(--ease-out); }
.js .paper .piece:not(.is-in) img { opacity: 0; transform: translateY(40px) scale(.98); }
.js .paper .spray { transition: opacity .8s ease .3s, scale .9s var(--ease-out) .3s; }
.js .paper .row:not(.is-in) > .spray { opacity: 0; scale: .7; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; }
  .js [data-reveal] > *, .js [data-reveal], .js .paper .piece img, .js .paper .spray {
    opacity: 1 !important; transform: none !important; scale: none !important; transition: none !important;
  }
}

/* ---------- Планшет и телефон: одна колонка ---------- */
@media (max-width: 1024px) {
  :root { --art-w: min(440px, 88vw); }
  .bar__links { display: none; }

  .hero { height: auto; padding-bottom: 56px; }
  .hero::after { height: 220px; }
  .hero__text { padding-top: 56px; max-width: 680px; }
  .hero__art {
    position: relative; right: auto; bottom: auto;
    margin: 48px auto 0;
  }
  .hero__bone { clip-path: none; }
  .hero__ink { display: none; }
  .tag--hero { position: relative; right: auto; bottom: auto; margin: -72px auto 0; width: min(100% - 2 * var(--gutter), 420px); }

  .row {
    grid-template-columns: minmax(0, 1fr);
    max-width: 680px; margin-top: 0 !important;
  }
  .col, .piece { grid-column: 1; grid-row: auto; }
  .col { padding-top: 0 !important; gap: 28px; align-items: stretch !important; }
  .col--r > * { max-width: none; }
  .piece { width: min(84%, 420px, calc(560px * var(--ar))) !important; margin-top: 40px; }
  .row + .row { margin-top: 120px !important; }
  .row--styles { padding-top: 220px; }
  .col--r { margin-top: -48px; }
  .tag { width: auto; margin-inline: 8%; }
  .row--knight .col--l { order: 2; margin-top: -48px; }
  .row--knight .piece { order: 1; margin-top: 0; }
  .row--knight .col--r { order: 3; margin-top: 40px; }
  .row--process .col--r { margin-top: 40px; }
  .row--booking { padding-bottom: 200px; }
  .row--booking .piece { order: 2; width: min(64%, 320px) !important; }
  .row--booking .col--r { order: 3; margin-top: -40px; }
  .row--booking .col--r .tag { order: -1; }
  .statement, .price { font-size: 24px; }
  .row--nun .col--l p, .styles dd, .steps p { max-width: none; }
  .spray--join1, .spray--join2 { display: none; }
  .spray--nun { width: 200px; left: auto; right: 0; top: 420px; }
  .spray--crown { width: 300px; left: 0; top: 520px; }
  .custom, .form { padding: 32px 24px; }
  .foot::before { height: 180px; }
}

@media (min-width: 600px) and (max-width: 1024px) {
  .styles, .steps { grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .tag { margin-inline: auto; width: min(100%, 440px); }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .bar { padding: 16px var(--gutter); gap: 16px; }
  .bar__mark { font-size: 24px; }
  .bar__cta { padding: 10px 14px; font-size: var(--fs-small); }
  .hero__lead { font-size: 18px; margin-top: 24px; }
  .hero__actions { margin-top: 32px; }
  .hero__actions .btn { width: 100%; }
  .tag { margin-inline: 0; }
}

/* ---------- Django-версия: доп. ряды, ловушка, бронь ---------- */
.hero { --art-h: calc(var(--art-w) / var(--ar)); }  /* пересчёт под пропорцию эскиза первого экрана */
.hero--bare { height: auto; min-height: 640px; }
.col__group { display: flex; flex-direction: column; gap: 36px; }
.row--extra { margin-top: -30px; }
.row--extra .col { padding-top: 320px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tag__state {
  display: inline-block; margin-top: 18px; padding: 10px 16px;
  background: var(--ink); color: var(--bone); font-weight: 700; font-size: var(--fs-small);
}
.form__status.is-ok { color: var(--bone); }
@media (max-width: 1024px) {
  .row--extra { margin-top: 96px !important; }
  .row--extra .col--l:empty, .row--extra .col--r:empty { display: none; }
  .row--extra .col { margin-top: -48px; }
  .row--extra .piece { order: 1; margin-top: 0; }
  .row--extra .col { order: 2; }
}
