/* =========================================================
   ФОРМА — тату-студия, Барнаул
   Палитра: стена студии, белый свет, тушь и фиолетовый
   цвет трансферного эскиза (стенсила).
   ========================================================= */

:root {
  color-scheme: light;

  --wall: #E9EAEA;      /* стены студии */
  --paper: #FFFFFF;     /* подсвеченные поверхности */
  --ink: #000000;       /* тушь */
  --stone: #5A5D5E;     /* вторичный текст, серый пол */
  --hair: #BDC0C1;      /* тонкие разделители */
  --stencil: #5B3FB4;   /* фиолетовый стенсил: построение, фокус, промокод */
  --stencil-light: #B9A8F0; /* тот же стенсил на чёрном */
  --error: #A8231B;

  --serif: "Noto Serif Display", "Sitka Banner", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Jost", "Futura PT", "Futura", "Century Gothic", "Segoe UI", system-ui, sans-serif;

  --fs-small: 0.875rem;                                  /* 14 */
  --fs-body: clamp(1.0625rem, 0.25vw + 1rem, 1.125rem);  /* 17–18 */
  --fs-lead: clamp(1.1875rem, 0.7vw + 0.95rem, 1.5rem);  /* 19–24 */
  --fs-h3: clamp(1.5rem, 1.5vw + 0.95rem, 2.25rem);      /* 24–36 */
  --fs-sub: clamp(1.875rem, 2.5vw + 0.9rem, 3.5rem);     /* 30–56 */
  --fs-h2: clamp(2.5rem, 4.4vw + 0.7rem, 4.5rem);        /* 40–72 */

  --wrap: 1360px;
  --pad: clamp(20px, 4.4vw, 64px);
  --gap: clamp(16px, 2.2vw, 32px);
  --section: clamp(96px, 11vw, 168px);
  --header-h: 72px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p, figure, ol, ul, dl, dd, fieldset, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
svg { display: block; }
[hidden] { display: none !important; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 16px; top: -120px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}
.skip:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--stencil);
  outline-offset: 3px;
}

/* ---------- Типографика ---------- */

h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: var(--fs-h2);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--fs-h3);
  line-height: 1.12;
  letter-spacing: -0.005em;
}

p + p { margin-top: 0.85em; }

.lead { font-size: var(--fs-lead); line-height: 1.45; }

/* ---------- Ссылки и кнопки ---------- */

.link {
  padding: 0;
  border: 0;
  background: none;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  cursor: pointer;
  transition: color .2s;
}
.link:hover { color: var(--stencil); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.btn:hover { border-color: var(--stencil); color: var(--stencil); }

.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--stencil); border-color: var(--stencil); color: #fff; }

.btn-paper { background: #fff; border-color: #fff; color: var(--ink); }
.btn-paper:hover { background: var(--stencil-light); border-color: var(--stencil-light); color: var(--ink); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 48px; height: 48px;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: color .2s, border-color .2s, background-color .2s;
}
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  background: rgba(233, 234, 234, .9);
  -webkit-backdrop-filter: saturate(1.1) blur(12px);
  backdrop-filter: saturate(1.1) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.is-scrolled,
.site-header.is-open { border-bottom-color: var(--hair); }

.header-in {
  display: flex;
  align-items: center;
  gap: 32px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark { width: 46px; height: 46px; }
.brand-word { width: 96px; }
.brand-mark svg,
.brand-word svg,
.footer-word svg { width: 100%; height: auto; }

.nav {
  display: flex;
  gap: clamp(18px, 2vw, 30px);
  margin-left: auto;
}
.nav a {
  padding: 6px 0;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .25s ease, color .2s;
}
.nav a:hover { background-size: 100% 1px; }

.header-cta { min-height: 44px; padding: 0 22px; }

.menu-btn {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  font-weight: 500;
  cursor: pointer;
}
.menu-lines {
  position: relative;
  width: 22px; height: 9px;
  border-block: 1px solid currentColor;
  transition: transform .25s ease;
}
.site-header.is-open .menu-lines { border-bottom-color: transparent; transform: translateY(4px); }

.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 65;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 32px var(--pad) 40px;
  overflow-y: auto;
  background: var(--wall);
}
.mobile-menu nav { display: grid; gap: 4px; }
.mobile-menu nav a {
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 300;
  line-height: 1.2;
  text-decoration: none;
}
.mobile-menu .btn { align-self: flex-start; }
.mobile-menu-meta { margin-top: auto; color: var(--stone); font-size: var(--fs-small); }

@media (max-width: 1100px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .header-cta { margin-left: auto; }
}
@media (max-width: 560px) {
  :root { --header-h: 64px; }
  .brand-word { display: none; }
  .brand-mark { width: 42px; height: 42px; }
  .header-in { gap: 16px; }
  .header-cta { padding: 0 18px; font-size: 0.9375rem; }
}

/* ---------- Первый экран ----------
   Логотип на всю ширину заходит на фото стены студии —
   буквы как будто начерчены прямо на стене. */

.hero {
  position: relative;
  overflow: hidden;
  overflow: clip;
  padding-block: clamp(20px, 3vw, 44px) 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto 1fr;
  column-gap: var(--gap);
}

.hero-wm {
  grid-column: 1 / -1;
  grid-row: 1;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.hero-text {
  grid-column: 1 / span 6;
  grid-row: 2;
  position: relative;
  z-index: 2;
  padding-bottom: 8px;
}

.wm {
  width: 100%;
  height: auto;
  max-height: 46vh;
  min-height: 0;
  overflow: visible;
}
.wm-c { fill: none; stroke: var(--stencil); stroke-width: var(--cw, .7); }
.wm-c.dashed { stroke-dasharray: var(--dash, 2.4 3.2); }
.wm-dot { fill: var(--stencil); }
.wm-i {
  fill: none;
  stroke: var(--ink);
  stroke-width: var(--iw, 1.5);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wm-con { mix-blend-mode: multiply; opacity: .62; }

/* анимация «эскиз → тушь»: классы ставит main.js */
.wm.is-prep .draw { stroke-dasharray: var(--len) var(--len); stroke-dashoffset: var(--len); }
.wm.is-prep .wm-i,
.wm.is-prep .dashed,
.wm.is-prep .wm-dot { opacity: 0; }
.wm.is-play .draw {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset var(--dur, .9s) cubic-bezier(.55, .08, .25, 1) var(--delay, 0s);
}
.wm.is-play .wm-i,
.wm.is-play .dashed,
.wm.is-play .wm-dot {
  opacity: 1;
  transition: opacity .45s ease var(--delay, 0s), stroke-dashoffset var(--dur, .9s) cubic-bezier(.55, .08, .25, 1) var(--delay, 0s);
}
.wm.is-play .wm-i { transition: opacity 0s linear var(--delay, 0s), stroke-dashoffset var(--dur, .9s) cubic-bezier(.55, .08, .25, 1) var(--delay, 0s); }
/* финальное состояние жёстко: даже если вкладка была в фоне и переходы не доиграли */
.wm.is-done .draw,
.wm.is-done .wm-i,
.wm.is-done .dashed,
.wm.is-done .wm-dot { transition: none; opacity: 1; stroke-dashoffset: 0; }

.hero-title {
  margin-top: clamp(16px, 2.2vw, 32px);
  font-family: var(--serif);
  font-size: var(--fs-sub);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -0.012em;
}

.hero-lead { margin-top: 18px; max-width: 30em; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  margin-top: 32px;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  margin-top: clamp(32px, 4vw, 52px);
  color: var(--stone);
  font-size: var(--fs-small);
}

.hero-photo {
  grid-column: 8 / -1;
  grid-row: 1 / span 2;
  position: relative;
  z-index: 1;
  min-height: 520px;
}
.hero-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0;
}

@media (max-width: 900px) {
  .hero-wm,
  .hero-text,
  .hero-photo { grid-column: 1 / -1; grid-row: auto; }
  .wm { max-height: none; }
  .hero-photo { min-height: 0; margin-top: 48px; aspect-ratio: 4 / 5; }
  .hero-photo img { object-position: 50% 30%; }
}

/* ---------- Секции ---------- */

.section { padding-top: var(--section); }
main { padding-bottom: var(--section); }

.section-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: end;
  margin-bottom: clamp(40px, 5vw, 72px);
}
.section-head h2 { grid-column: 1 / span 6; }
.section-head p { grid-column: 7 / span 5; max-width: 42ch; color: var(--stone); }

@media (max-width: 900px) {
  .section-head h2,
  .section-head p { grid-column: 1 / -1; }
  .section-head p { margin-top: 16px; }
}

figcaption {
  margin-top: 12px;
  max-width: 38ch;
  color: var(--stone);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.zoom img { width: 100%; }

/* ---------- Работы ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: clamp(28px, 3vw, 40px);
}
.filter {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.filter:hover { border-color: var(--stencil); color: var(--stencil); }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px var(--gap);
}
.tile-img img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #D9DBDB;
}
.tile-cap {
  display: inline-block;
  margin-top: 10px;
  color: var(--stone);
  font-size: var(--fs-small);
  text-decoration: none;
}
a.tile-cap:hover { color: var(--stencil); text-decoration: underline; text-underline-offset: 0.3em; }

.gallery-more { margin-top: 40px; }

@media (max-width: 1000px) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .filters {
    flex-wrap: nowrap;
    margin-inline: calc(var(--pad) * -1);
    padding-inline: var(--pad);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex-shrink: 0; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
}

/* ---------- Мастера ---------- */

.masters-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: clamp(40px, 4vw, 64px) var(--gap);
}

.master-link {
  display: grid;
  justify-items: start;
  color: var(--ink);
  text-decoration: none;
}

.portrait {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100% - 24px, 280px);
  aspect-ratio: 1;
  margin: 12px 12px 28px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--paper);
  outline: 1px solid var(--ink);
  outline-offset: 10px;
  transition: outline-offset .3s ease, outline-color .3s ease;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait-empty svg { width: 52%; height: auto; opacity: .16; }

.master-link:hover .portrait,
.master-link:focus-visible .portrait { outline-color: var(--stencil); outline-offset: 5px; }
.master-link:focus-visible { outline: none; }

.master-name { font-family: var(--serif); font-size: var(--fs-h3); line-height: 1.1; }
.master-since { margin-top: 8px; font-size: var(--fs-small); }
.master-since:empty { display: none; }
.master-meta { margin-top: 2px; color: var(--stone); font-size: var(--fs-small); }
.master-more {
  margin-top: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}
.master-link:hover .master-more { color: var(--stencil); }

.masters-empty { color: var(--stone); }

@media (max-width: 640px) {
  .masters-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
  .masters-list .portrait { width: calc(100% - 16px); margin: 8px 8px 20px; outline-offset: 6px; }
  .master-link:hover .portrait { outline-offset: 3px; }
  .master-name { font-size: 1.375rem; }
  .master-more { font-size: 0.9375rem; }
}

/* ---------- Профиль мастера ---------- */

dialog {
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  color: var(--ink);
}

.profile {
  --pp: clamp(20px, 4vw, 56px);
  position: fixed;
  inset: 0 0 0 auto;
  width: min(1000px, 100vw);
  height: 100vh;
  height: 100dvh;
  margin: 0 0 0 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--paper);
}
.profile::backdrop { background: rgba(0, 0, 0, .45); }
.profile[open] { animation: sheet-in .4s cubic-bezier(.2, .7, .2, 1); }
@keyframes sheet-in {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.profile-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--pp);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.profile-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font-weight: 500;
  cursor: pointer;
}
.profile-back svg { width: 18px; height: 18px; }
.profile-back:hover { color: var(--stencil); }
.profile-bar .icon-btn:hover { color: var(--stencil); }

.profile-in { padding: 8px var(--pp) 72px; }

.profile-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}
.profile-head .portrait { width: clamp(132px, 20vw, 220px); margin: 12px; background: var(--wall); }

.profile-role { color: var(--stone); }
.profile-name {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: var(--fs-h2);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.015em;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tags li {
  padding: 5px 14px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  font-size: var(--fs-small);
}

.profile-quote {
  max-width: 34ch;
  margin-top: clamp(36px, 5vw, 56px);
  padding-left: 24px;
  border-left: 1px solid var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.375rem, 1.2vw + 1rem, 2rem);
  font-weight: 300;
  line-height: 1.25;
}

.profile-bio { max-width: 62ch; margin-top: clamp(32px, 4vw, 48px); }

.profile-works-title { margin-top: clamp(48px, 6vw, 72px); }
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.profile-grid img { aspect-ratio: 3 / 4; object-fit: cover; }
.profile-empty { margin-top: 16px; color: var(--stone); }
.profile-cta { margin-top: clamp(40px, 5vw, 56px); }

@media (max-width: 640px) {
  .profile-head { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Просмотр фото ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  background: #000;
  color: #fff;
}
.lightbox::backdrop { background: transparent; }

.lb-figure {
  position: absolute;
  inset: 72px 72px 104px;
  display: grid;
  place-items: center;
  margin: 0;
}
.lb-figure img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 196px);
  object-fit: contain;
}
.lb-info {
  position: absolute;
  left: 0; right: 0; bottom: 24px;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding-inline: 72px;
  text-align: center;
}
.lb-caption { max-width: 60ch; color: rgba(255, 255, 255, .82); font-size: var(--fs-small); }
.lb-master {
  padding: 6px 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: var(--fs-small);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.3em;
  cursor: pointer;
}
.lb-master:hover { color: var(--stencil-light); }
.lb-count {
  position: absolute;
  top: 30px; left: 24px;
  color: rgba(255, 255, 255, .7);
  font-size: var(--fs-small);
}
.lightbox .icon-btn { position: absolute; color: #fff; border-color: rgba(255, 255, 255, .45); }
.lightbox .icon-btn:hover { border-color: #fff; }
.lightbox :focus-visible { outline-color: var(--stencil-light); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

@media (max-width: 640px) {
  .lb-figure { inset: 72px 12px 150px; }
  .lb-figure img { max-height: calc(100dvh - 222px); }
  .lb-prev, .lb-next { top: auto; bottom: 20px; transform: none; }
  .lb-info { bottom: 84px; padding-inline: 16px; }
}

/* ---------- Услуги ---------- */

.services-list { border-top: 1px solid var(--ink); }

.service {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  padding-block: clamp(28px, 3.4vw, 48px);
  border-bottom: 1px solid var(--hair);
}
.service h3 { grid-column: 1 / span 5; }
.service--main h3 { font-size: var(--fs-sub); font-weight: 300; line-height: 1.04; }
.service-body { grid-column: 7 / span 5; }
.service-body p { max-width: 46ch; }
.service-body .link { display: inline-block; margin-top: 18px; }

@media (max-width: 900px) {
  .service h3,
  .service-body { grid-column: 1 / -1; }
  .service-body { margin-top: 14px; }
}

/* ---------- Обучение ----------
   чёрный лист, как у учебных материалов студии */

.training {
  margin-top: var(--section);
  padding-block: var(--section);
  background: var(--ink);
  color: #fff;
}
.training .section-head p { color: rgba(255, 255, 255, .72); }
.training :focus-visible { outline-color: var(--stencil-light); }

.courses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 255, 255, .28);
}
.course { display: flex; flex-direction: column; padding: clamp(28px, 3.4vw, 48px) clamp(24px, 3.4vw, 48px) 0 0; }
.course + .course { padding-right: 0; padding-left: clamp(24px, 3.4vw, 48px); border-left: 1px solid rgba(255, 255, 255, .28); }

.course-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.course-head h3 { font-size: var(--fs-h2); font-weight: 300; line-height: 1; }
.course-time { font-family: var(--serif); font-size: var(--fs-h3); font-weight: 300; color: rgba(255, 255, 255, .85); }
.course-sum { max-width: 42ch; margin-top: 18px; color: rgba(255, 255, 255, .78); }

.course-blocks { margin-top: 32px; border-top: 1px solid rgba(255, 255, 255, .18); }
.course-blocks > li { border-bottom: 1px solid rgba(255, 255, 255, .18); }
.course-blocks summary {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 14px;
  align-items: baseline;
  gap: 12px;
  padding: 16px 0;
  cursor: pointer;
  list-style: none;
}
.course-blocks summary::-webkit-details-marker { display: none; }
.course-blocks summary::after {
  content: "";
  align-self: center;
  width: 12px; height: 12px;
  background:
    linear-gradient(currentColor, currentColor) center / 12px 1px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1px 12px no-repeat;
  transition: transform .25s ease;
}
.course-blocks details[open] summary::after { transform: rotate(45deg); }
.course-blocks summary:hover .block-t { color: var(--stencil-light); }
.block-n { font-family: var(--serif); font-size: 1.25rem; font-weight: 300; color: rgba(255, 255, 255, .6); }
.block-t { font-weight: 500; transition: color .2s; }
.block-m { color: rgba(255, 255, 255, .6); font-size: var(--fs-small); }
.block-bonus {
  padding: 1px 10px;
  border: 1px solid var(--stencil-light);
  border-radius: 999px;
  color: var(--stencil-light);
  font-size: 0.8125rem;
}
.course-blocks details ul,
.course-blocks details p {
  padding: 0 0 22px 44px;
  color: rgba(255, 255, 255, .78);
  font-size: 0.9375rem;
}
.course-blocks details p { max-width: 48ch; }
.course-blocks details ul { display: grid; gap: 6px; }
.course-blocks details li { position: relative; padding-left: 16px; }
.course-blocks details li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.68em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .45);
}

.course-blocks { margin-bottom: 32px; }
.course-cta { align-self: flex-start; margin-top: auto; }

.courses-note { max-width: 62ch; margin-top: clamp(36px, 4vw, 56px); color: rgba(255, 255, 255, .72); }

@media (max-width: 900px) {
  .courses { grid-template-columns: 1fr; }
  .course { padding-right: 0; }
  .course + .course {
    margin-top: 48px;
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, .28);
  }
}

/* ---------- Студия ---------- */

.studio-quote { margin-bottom: clamp(48px, 6vw, 88px); }
.studio-quote blockquote p {
  max-width: 24ch;
  font-family: var(--serif);
  font-size: var(--fs-sub);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.studio-quote figcaption { margin-top: 18px; }

.studio-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 40px var(--gap);
  align-items: end;
}
.studio-a { grid-column: 1 / span 5; }
.studio-b { grid-column: 7 / span 3; }
.studio-c { grid-column: 10 / span 3; }

@media (max-width: 900px) {
  .studio-grid { row-gap: 32px; align-items: start; }
  .studio-a { grid-column: 1 / -1; }
  .studio-b { grid-column: 1 / span 6; }
  .studio-c { grid-column: 7 / span 6; }
}

/* ---------- Запись ---------- */

.booking-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 48px var(--gap);
  align-items: start;
}
.booking-intro { grid-column: 1 / span 5; }
.form-wrap { grid-column: 7 / span 6; }

.steps { counter-reset: step; display: grid; gap: 28px; margin-top: clamp(32px, 4vw, 48px); }
.steps li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 12px;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  grid-row: span 2;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
}
.steps h3 { font-size: 1.5rem; }
.steps p { margin-top: 6px; max-width: 40ch; color: var(--stone); }

.form {
  padding: clamp(24px, 3.6vw, 48px);
  background: var(--paper);
}

.form-group { margin-top: 26px; }
.form-body > .form-group:first-child { margin-top: 0; }
.form-label {
  display: block;
  margin-bottom: 6px;
  padding: 0;
  font-size: var(--fs-small);
  font-weight: 500;
}
.form-optional { color: var(--stone); font-weight: 400; }

.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }

.input {
  display: block;
  width: 100%;
  padding: 10px 0 12px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  font-size: 1.0625rem;
  line-height: 1.4;
  transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: #85898A; }
.input:focus { outline: none; border-bottom-color: var(--stencil); box-shadow: 0 1px 0 var(--stencil); }
.input[aria-invalid="true"] { border-bottom-color: var(--error); box-shadow: 0 1px 0 var(--error); }
textarea.input { min-height: 104px; resize: vertical; }
select.input {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 32px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 2px center;
  cursor: pointer;
}
.form-date .input { max-width: 240px; min-height: 46px; }

.field-error { margin-top: 6px; color: var(--error); font-size: var(--fs-small); }
.field-error:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; border: 0; min-width: 0; }
.chips legend { float: left; width: 100%; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.9375rem;
  transition: background-color .2s, color .2s;
}
.chip input:checked + span { background: var(--ink); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--stencil); outline-offset: 3px; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 22px;
  cursor: pointer;
  font-size: 0.9375rem;
  line-height: 1.45;
}
.check input {
  flex-shrink: 0;
  width: 20px; height: 20px;
  margin: 1px 0 0;
  accent-color: var(--stencil);
  cursor: pointer;
}
.check input[aria-invalid="true"] { outline: 2px solid var(--error); outline-offset: 2px; }
.check .link { font-weight: 400; }
.check + .field-error { margin-left: 32px; }

/* референсы: превью как листы эскизов, пунктир — зона, куда можно бросить фото */
.refs {
  margin-inline: -12px;
  padding: 12px;
  border: 1px dashed transparent;
  border-radius: 6px;
  transition: border-color .2s, background-color .2s;
}
.refs.is-drag { border-color: var(--stencil); background: rgba(91, 63, 180, .05); }
.refs-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.refs-list:empty { display: none; }
.refs-list + .refs-add { margin-top: 12px; }
.ref { position: relative; aspect-ratio: 3 / 4; background: var(--wall); }
.ref img { width: 100%; height: 100%; object-fit: cover; }
.ref-name {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 6px;
  overflow: hidden;
  color: var(--stone);
  font-size: 0.75rem;
  text-align: center;
  word-break: break-all;
}
.ref-remove {
  position: absolute;
  top: 4px; right: 4px;
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}
.ref-remove:hover { background: var(--stencil); }
.refs-add { position: relative; display: inline-flex; cursor: pointer; }
.refs-add input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.refs-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px dashed var(--ink);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: border-color .2s, color .2s;
}
.refs-add-btn::before { content: "+"; font-size: 1.25rem; font-weight: 400; line-height: 1; }
.refs-add:hover .refs-add-btn { border-color: var(--stencil); color: var(--stencil); }
.refs-add input:focus-visible + .refs-add-btn { outline: 2px solid var(--stencil); outline-offset: 3px; }
.refs-hint { margin-top: 8px; color: var(--stone); font-size: var(--fs-small); }

@media (max-width: 560px) {
  .refs-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ловушка для спам-ботов: людям не видна */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-submit { width: 100%; margin-top: 28px; }
.form-submit:disabled { cursor: progress; opacity: .75; }
.form-status { margin-top: 14px; font-size: 0.9375rem; }
.form-status:empty { display: none; }
.form-status.is-err { padding-left: 14px; border-left: 2px solid var(--error); }
.form-status.is-err .link { margin-top: 6px; }

.form-done:focus { outline: none; }
.form-done-title {
  font-family: var(--serif);
  font-size: var(--fs-sub);
  font-weight: 300;
  line-height: 1.05;
}
.form-done-text { max-width: 44ch; margin-top: 16px; }
.form-again { margin-top: 22px; }

.form-alt { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--hair); }
.form-alt-title { color: var(--stone); font-size: var(--fs-small); }
.form-alt-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.form-alt-links .btn { min-height: 44px; padding: 0 20px; font-size: 0.9375rem; }

/* сообщения для отправки без JavaScript */
.flash { display: none; margin-bottom: 16px; padding: 14px 18px; border-left: 2px solid var(--stencil); background: var(--paper); }
.flash--err { border-left-color: var(--error); }
.flash:target { display: block; }
.js .flash { display: none !important; }

@media (max-width: 1100px) and (min-width: 901px) {
  .booking-intro { grid-column: 1 / span 5; }
  .form-wrap { grid-column: 6 / span 7; }
}
@media (max-width: 900px) {
  .booking-intro,
  .form-wrap { grid-column: 1 / -1; }
  .form-wrap { margin-inline: calc(var(--pad) * -1); }
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- Контакты ---------- */

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 48px var(--gap);
}
.contacts-grid > h2 { grid-column: 1 / -1; }
.contacts-where { grid-column: 1 / span 6; }
.contacts-reach { grid-column: 8 / span 5; }

.addr,
.hours {
  font-family: var(--serif);
  font-size: var(--fs-sub);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -0.012em;
}
.addr-sub,
.hours-sub { margin-top: 10px; color: var(--stone); }

.route { display: grid; gap: 18px; margin-top: 36px; }
.route li { position: relative; padding-left: 34px; }
.route li::before {
  content: "";
  position: absolute;
  left: 4px; top: 0.6em;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--stencil);
}
.route li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 8px;
  top: calc(0.6em + 9px);
  bottom: calc(-18px - 0.6em);
  width: 1px;
  background: var(--stencil);
}

.map-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.reach-list { display: grid; gap: 8px; margin-top: 32px; font-size: var(--fs-lead); }
.reach-list a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; }
.reach-list a:hover { color: var(--stencil); }
.contacts-cta { margin-top: 32px; }

@media (max-width: 900px) {
  .contacts-where,
  .contacts-reach { grid-column: 1 / -1; }
}

/* ---------- Подвал ---------- */

.site-footer {
  padding-block: clamp(64px, 8vw, 112px) 28px;
  background: var(--ink);
  color: #fff;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 40px var(--gap);
  align-items: start;
}
.footer-mark { grid-column: 1 / span 3; }
.footer-mark svg { width: clamp(120px, 13vw, 184px); height: auto; }
.footer-info { grid-column: 5 / span 4; color: rgba(255, 255, 255, .78); }
.footer-word { display: block; width: 150px; margin-bottom: 24px; color: #fff; }
.footer-nav { grid-column: 10 / span 3; display: grid; gap: 6px; justify-items: start; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; text-underline-offset: 0.3em; }
.footer-bottom {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .2);
  color: rgba(255, 255, 255, .6);
  font-size: var(--fs-small);
}
.footer-bottom a { color: inherit; }
.footer-bottom a:hover { color: #fff; }
.site-footer :focus-visible { outline-color: var(--stencil-light); }

@media (max-width: 900px) {
  .footer-mark,
  .footer-info,
  .footer-nav { grid-column: 1 / -1; }
}

/* ---------- Документы (политика, согласие) ---------- */

.doc { padding-block: clamp(48px, 7vw, 96px) var(--section); }
.doc-in { max-width: 46rem; }
.doc h1 {
  font-family: var(--serif);
  font-size: var(--fs-h2);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -0.015em;
}
.doc h2 { margin-top: 2.2em; font-size: var(--fs-h3); font-weight: 400; letter-spacing: 0; }
.doc p, .doc ul { margin-top: 0.85em; }
.doc ul { padding-left: 1.2em; list-style: disc; }
.doc li + li { margin-top: 0.35em; }
.doc-note { padding: 14px 18px; border-left: 2px solid var(--stencil); background: var(--paper); font-size: 0.9375rem; }
.doc-back { display: inline-block; margin-bottom: 32px; }

/* ---------- Пониженная анимация ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
