/* =========================================================
   Mojito Studio — «Mint your soul. Design your darkness.»
   Эстетика из шапки: готический собор, осколки стекла,
   холодное сине-бирюзовое свечение, одна капля красного.
   ========================================================= */

:root {
  --bg: #06080b;
  --bg-2: #0b1016;
  --stone: #141b23;
  --line: rgba(143, 200, 222, 0.16);
  --text: #c3ccd3;          /* основной текст — мягкий, не белый */
  --bright: #e8eef2;        /* заголовки */
  --muted: #8995a0;
  --steel: #7aa6c2;          /* цвет букв в шапке */
  --glow: #7fdcef;           /* свечение по краю стекла */
  --glow-soft: rgba(127, 220, 239, 0.28);
  --blood: #b0142c;          /* единственный тёплый акцент: только «Заказать» */
  --blood-hot: #d61d3a;

  --font-display: "Forum", "Times New Roman", serif;
  --font-text: "Tenor Sans", "Trebuchet MS", sans-serif;
  --font-script: "Marck Script", cursive;

  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1.02rem;
  line-height: 1.75;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

/* Плёночное зерно поверх всего — как фактура на её работах */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { display: block; max-width: 100%; }
a { color: var(--steel); }
a:hover { color: var(--glow); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Навигация ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  transition: background 0.4s, backdrop-filter 0.4s;
}
.nav.is-scrolled {
  background: rgba(6, 8, 11, 0.78);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--steel);
  text-decoration: none;
  white-space: nowrap;
}
.logo span { color: var(--glow); }
.nav__links {
  display: flex;
  gap: clamp(14px, 2.5vw, 34px);
  list-style: none;
  margin: 0; padding: 0;
}
.nav__links a {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.nav__links a:hover { color: var(--glow); }
.nav__links a[aria-current="page"] { color: var(--glow); }
.btn--sm { padding: 0.65em 1.3em; font-size: 0.78rem; }
@media (max-width: 720px) {
  .nav__inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 8px; }
  .nav nav { order: 3; width: 100%; }
  .nav__links { justify-content: center; gap: 22px; }
  .nav { background: rgba(6, 8, 11, 0.85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-block;
  padding: 0.9em 1.9em;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s, color 0.25s, border-color 0.25s;
}
.btn--blood {
  background: var(--blood);
  color: #f5e9ea;
  box-shadow: 0 0 0 rgba(214, 29, 58, 0);
}
.btn--blood:hover {
  background: var(--blood-hot);
  color: #fff;
  box-shadow: 0 0 28px rgba(214, 29, 58, 0.45);
  transform: translateY(-2px);
}
.btn--ghost {
  background: transparent; /* явно: у <button> иначе нативный светлый фон */
  color: var(--steel);
  border-color: var(--line);
}
.btn--ghost:hover {
  color: var(--glow);
  border-color: var(--glow);
  box-shadow: 0 0 22px var(--glow-soft);
}

/* ---------- Первый экран: собор и осколки ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse 60% 45% at 50% 0%, rgba(80, 130, 170, 0.22), transparent 70%),
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(0, 0, 0, 0.9), transparent 70%),
    linear-gradient(180deg, #0a0f15 0%, var(--bg) 75%);
}

/* Витражные окна-арки в глубине */
.hero__windows {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 7vh 8vw 0;
  pointer-events: none;
}
.hero__windows i {
  width: clamp(40px, 6vw, 90px);
  height: clamp(150px, 34vh, 380px);
  border-radius: 999px 999px 4px 4px;
  background:
    repeating-linear-gradient(90deg, transparent 0 22%, rgba(0,0,0,0.55) 22% 26%),
    repeating-linear-gradient(0deg, transparent 0 18%, rgba(0,0,0,0.55) 18% 21%),
    linear-gradient(180deg, rgba(120, 180, 215, 0.35), rgba(40, 70, 100, 0.12));
  filter: blur(1.5px);
  opacity: 0.55;
}
.hero__windows i:nth-child(2),
.hero__windows i:nth-child(4) { margin-top: 9vh; opacity: 0.3; }
.hero__windows i:nth-child(3) { opacity: 0.18; margin-top: 3vh; }

/* Лучи света из окон */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: conic-gradient(from 180deg at 50% -10%, transparent 40%, rgba(140, 200, 230, 0.07) 47%, transparent 53%, rgba(140, 200, 230, 0.05) 58%, transparent 64%);
  pointer-events: none;
}

/* Трещины по стеклу: расходятся от центра при загрузке */
.hero__cracks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}
.hero__cracks path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: crack 2.4s cubic-bezier(.3, .6, .25, 1) forwards;
  /* трещины начинают расходиться, когда заголовок уже появился; каждая — со своей задержкой */
  animation-delay: calc(0.6s + var(--cd, 0.1s) * 2.5);
}
.hero__cracks .c-glow { stroke: url(#crack-glow); stroke-width: 3.5; filter: blur(1.2px); }
.hero__cracks .c-core { stroke: url(#crack-core); stroke-width: 0.9; }
.hero__cracks .c-fine { stroke: url(#crack-core); stroke-width: 0.6; opacity: 0.7; }
@keyframes crack { to { stroke-dashoffset: 0; } }

/* Осколок: 4 слоя, у каждого своё движение
   .shard        — место на экране и свечение по краю
   .shard__fly   — разлёт от центра при загрузке (один раз)
   .shard__par   — откликается на мышь (глубина --depth)
   .shard__drift — медленно парит
   .shard__glass — форма осколка */
.shard {
  position: absolute;
  z-index: 0;
  filter:
    drop-shadow(0 0 1px rgba(210, 248, 255, 0.95))
    drop-shadow(0 0 12px var(--glow-soft))
    drop-shadow(0 20px 34px rgba(0, 0, 0, 0.75));
}
.shard__fly {
  width: 100%;
  height: 100%;
  animation: fly 2.8s calc(1.2s + (var(--d, 0.45s) - 0.45s) * 3) cubic-bezier(.22, .7, .25, 1) both;
}
@keyframes fly {
  from { transform: translate(var(--fx), var(--fy)) scale(0.12) rotate(40deg); opacity: 0; }
  35%  { opacity: 1; }
  to   { transform: none; opacity: 1; }
}
.shard__par {
  width: 100%;
  height: 100%;
  transform: translate3d(calc(var(--mx, 0) * var(--depth, 20) * 1px), calc(var(--my, 0) * var(--depth, 20) * 1px), 0);
  transition: transform 0.9s cubic-bezier(.2, .7, .2, 1);
}
.shard__drift {
  width: 100%;
  height: 100%;
  animation: drift 9s ease-in-out infinite alternate;
  transform: rotate(var(--r));
}
.shard__glass {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.shard__glass img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
/* Блик на стекле */
.shard__glass::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(255,255,255,0.20) 0%, rgba(255,255,255,0.04) 26%, transparent 42%, rgba(160, 230, 250, 0.08) 82%);
  mix-blend-mode: screen;
}
/* Парение: осколок медленно поднимается и чуть поворачивается в объёме */
@keyframes drift {
  from { transform: translate3d(0, 0, 0) rotate(var(--r)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
  to   { transform: translate3d(0, var(--drift, -22px), 0) rotate(calc(var(--r) + 4deg))
                    rotateX(calc(var(--rx, 0deg) * -0.6)) rotateY(calc(var(--ry, 0deg) * 0.7)); }
}

/* Раскладка: осколки только по краям, в центре — свободное место для текста */
.shard--1 { width: clamp(150px, 14vw, 205px); aspect-ratio: 1; top: 12%; left: 3%;  --r: -8deg;  --fx: 38vw;  --fy: 26vh;  --d: 0.45s; }
.shard--1 .shard__glass { clip-path: polygon(10% 4%, 100% 0, 92% 70%, 50% 100%, 0 76%); }
.shard--2 { width: clamp(140px, 13vw, 195px); aspect-ratio: 1; top: 10%; right: 4%; --r: 9deg;   --fx: -37vw; --fy: 28vh;  --d: 0.55s; }
.shard--2 .shard__glass { clip-path: polygon(24% 0, 100% 14%, 86% 100%, 0 78%); }
.shard--3 { width: clamp(150px, 13vw, 195px); aspect-ratio: 1; bottom: 6%; right: 5%; --r: 6deg; --fx: -36vw; --fy: -28vh; --d: 0.65s; }
.shard--3 .shard__glass { clip-path: polygon(0 10%, 74% 0, 100% 52%, 66% 100%, 6% 88%); }
.shard--4 { width: clamp(130px, 12vw, 185px); aspect-ratio: 1; bottom: 8%; left: 8%; --r: -11deg; --fx: 34vw;  --fy: -30vh; --d: 0.5s; }
.shard--4 .shard__glass { clip-path: polygon(0 4%, 100% 20%, 74% 100%, 8% 84%); }
.shard--5 { width: clamp(90px, 8vw, 125px);  aspect-ratio: 1; top: 45%; left: 13%; --r: 14deg; --fx: 30vw;  --fy: 0vh;   --d: 0.7s; }
.shard--5 .shard__glass { clip-path: polygon(46% 0, 100% 44%, 60% 100%, 0 62%); }
.shard--6 { width: clamp(90px, 8vw, 125px);  aspect-ratio: 1; top: 44%; right: 12%; --r: -10deg; --fx: -30vw; --fy: 0vh;  --d: 0.75s; }
.shard--6 .shard__glass { clip-path: polygon(0 18%, 82% 0, 100% 78%, 22% 100%); }

@media (max-width: 720px) {
  .shard--5, .shard--6 { display: none; }
  .shard--1 { width: 27vw; top: 9%;  left: 4%; }
  .shard--2 { width: 25vw; top: 10%; right: 4%; }
  .shard--3 { width: 26vw; bottom: 3%; right: 5%; }
  .shard--4 { width: 25vw; bottom: 4%; left: 5%; }
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 96px var(--gutter) 72px;
}

/* Заголовок на мазках кисти, как в шапке */
.hero__title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35em;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 4.4vw, 3.3rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--steel);
  line-height: 1.1;
}
@media (min-width: 900px) {
  .brush--first { margin-right: clamp(0px, 9vw, 150px); }
  .brush--second { margin-left: clamp(0px, 11vw, 190px); }
}
.brush {
  display: inline-block;
  padding: 0.45em 1.1em 0.45em 1.4em;
  background: url("img/brand/brush.svg") center / 100% 100% no-repeat;
  text-shadow: 0 0 18px rgba(122, 166, 194, 0.35);
}
@media (max-width: 720px) {
  .hero__title { letter-spacing: 0.18em; }
}

.hero__lead {
  max-width: 34em;
  margin: 2.2rem auto 2.4rem;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--text);
  text-shadow: 0 2px 12px #000;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

/* ---------- Заголовки разделов: рукописное слово + заглавные ---------- */

.section { position: relative; padding: clamp(72px, 12vw, 140px) 0; }

.heading { margin: 0 0 clamp(36px, 6vw, 64px); text-align: center; }
.heading__script {
  display: block;
  font-family: var(--font-script);
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  color: var(--glow);
  line-height: 1;
  text-shadow: 0 0 24px var(--glow-soft);
  transform: rotate(-4deg);
}
.heading__caps {
  display: block;
  margin-top: -0.2em;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--steel);
}
.heading--left { text-align: left; }
.heading--left .heading__script { transform: rotate(-4deg) translateX(-0.1em); }
.heading--left .heading__caps { margin-top: 0.25em; }
.heading__note {
  max-width: 36em;
  margin: 1.2rem auto 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Разделитель — тонкая трещина */
.crack {
  height: 1px;
  border: 0;
  margin: 0;
  background: linear-gradient(90deg, transparent, var(--line) 20%, rgba(127, 220, 239, 0.35) 50%, var(--line) 80%, transparent);
}

/* ---------- Услуги: стеклянные панели ---------- */

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 18px;
}
.service {
  position: relative;
  padding: 30px 26px 26px;
  background: linear-gradient(160deg, rgba(122, 166, 194, 0.08), rgba(10, 14, 19, 0.6) 45%);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
  transition: border-color 0.3s, transform 0.3s;
}
.service::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glow), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.service:hover { border-color: rgba(127, 220, 239, 0.4); transform: translateY(-3px); }
.service:hover::before { opacity: 0.8; }
.service h3 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bright);
}
.service p { margin: 0 0 1.2rem; color: var(--text); font-size: 0.98rem; }
.service__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.price { font-family: var(--font-display); letter-spacing: 0.12em; color: var(--glow); }
.service--wide { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .service--wide { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; }
}

/* ---------- Галерея ---------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 36px;
}
.tab {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  padding: 0.7em 1.4em;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] {
  color: var(--glow);
  border-color: var(--glow);
  box-shadow: 0 0 18px var(--glow-soft);
}

.panel[hidden] { display: none; }

/* Эпиграфы — колонки без обрезки: разный формат остаётся целым */
/* Эпиграфы — ровные ряды: у картинок в ряду одна высота, ширина по пропорциям, ничего не обрезается.
   --r = ширина / высота картинки (проставлено в разметке) */
.grid-epigraphs {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.grid-epigraphs .work {
  flex: calc(var(--r) * 1000) 1 calc(var(--r) * 250px);
  margin: 0;
}
.grid-epigraphs::after { content: ""; flex-grow: 1000000; } /* последний ряд не растягивается */
@media (max-width: 560px) {
  .grid-epigraphs .work { flex-basis: calc(var(--r) * 150px); }
}
.grid-avatars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 180px));
  justify-content: center;
  gap: 16px;
}

.work {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  background: var(--stone);
  cursor: zoom-in;
  break-inside: avoid;
  overflow: hidden;
  transition: box-shadow 0.35s, transform 0.35s;
}
.work img {
  width: 100%;
  height: auto;
  transition: transform 0.6s, filter 0.35s;
}
.work::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(200, 245, 255, 0);
  transition: border-color 0.35s;
  pointer-events: none;
}
.work:hover, .work:focus-visible {
  box-shadow: 0 0 0 1px rgba(200, 245, 255, 0.7), 0 0 26px var(--glow-soft);
  transform: translateY(-2px);
  outline: none;
}
.work:hover img { transform: scale(1.03); filter: brightness(1.08); }
.grid-avatars .work { margin: 0; max-width: 180px; }

/* Подписи — серии */
.series { margin-bottom: 44px; }
.series__title {
  margin: 0 0 16px;
  text-align: center;
  font-family: var(--font-script);
  font-size: 2rem;
  font-weight: 400;
  color: var(--steel);
}
.series__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
.series__row .work { width: auto; margin: 0; }
.series__row .work img { width: auto; max-width: 100%; }

/* ---------- Просмотр работы ---------- */

.lightbox {
  width: min(96vw, 900px);
  max-height: 94vh;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(6, 8, 11, 0.96);
  color: var(--text);
  overflow: visible;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.82); backdrop-filter: blur(4px); }
.lightbox__figure { margin: 0; padding: 18px; display: grid; place-items: center; }
.lightbox__figure img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  box-shadow: 0 0 0 1px rgba(200, 245, 255, 0.5), 0 0 40px var(--glow-soft);
}
.lightbox__caption { margin-top: 12px; color: var(--muted); font-style: italic; text-align: center; }
.lightbox__btn {
  position: absolute;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--steel);
  width: 44px; height: 44px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox__btn:hover { color: var(--glow); border-color: var(--glow); }
.lightbox__close { top: -52px; right: 0; }
.lightbox__prev { left: -56px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: -56px; top: 50%; transform: translateY(-50%); }
@media (max-width: 1020px) {
  .lightbox__prev { left: 8px; top: auto; bottom: 8px; transform: none; background: rgba(6,8,11,0.8); }
  .lightbox__next { right: 8px; top: auto; bottom: 8px; transform: none; background: rgba(6,8,11,0.8); }
}

/* ---------- Кубики ---------- */

.dice {
  display: grid;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
@media (min-width: 900px) { .dice { grid-template-columns: 1fr 1fr; } }
.dice__list { list-style: none; margin: 0 0 2rem; padding: 0; }
.dice__list li {
  position: relative;
  padding: 0.6rem 0 0.6rem 2rem;
  border-bottom: 1px solid var(--line);
}
.dice__list li::before {
  content: "";
  position: absolute;
  left: 0.2rem; top: 1.15rem;
  width: 10px; height: 10px;
  border: 1px solid var(--glow);
  transform: rotate(45deg);
  box-shadow: 0 0 10px var(--glow-soft);
}
/* Макет результата броска — как он выглядит в посте */
.dice__demo {
  padding: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(170deg, rgba(122, 166, 194, 0.07), transparent 60%);
}
.dice__label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}
.dice__quote {
  margin: 0;
  padding: 16px 20px;
  border-left: 2px solid var(--glow);
  background: rgba(0, 0, 0, 0.35);
  font-size: 1.15rem;
}
.dice__roll {
  display: inline-block;
  min-width: 2.2em;
  font-family: var(--font-display);
  color: var(--glow);
  text-shadow: 0 0 12px var(--glow-soft);
}
.dice__again { margin-top: 18px; }

/* ---------- Как заказать ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 28px;
  counter-reset: step;
  list-style: none;
  margin: 0; padding: 0;
}
.steps li { position: relative; padding-top: 3.2rem; }
.steps li::before {
  counter-increment: step;
  content: counter(step, upper-roman);
  position: absolute;
  top: 0; left: 0;
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1;
  color: var(--glow);
  letter-spacing: 0.08em;
  text-shadow: 0 0 22px var(--glow-soft);
}
.steps h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 1.45rem;
  color: var(--bright);
}
.steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.steps li { padding-top: 3.8rem; }

/* ---------- Форма ---------- */

.order {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(176, 20, 44, 0.08), transparent 60%),
    rgba(10, 14, 19, 0.7);
}
.field { margin-bottom: 20px; }
.field--row { display: grid; gap: 20px; }
@media (min-width: 640px) { .field--row { grid-template-columns: 1fr 1fr; } }
.field label, .field legend {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--steel);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.75em 0.9em;
  font: inherit;
  font-size: 1.1rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
  border-radius: 0;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--steel) 50%), linear-gradient(135deg, var(--steel) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.5em; }
.field select option { background: var(--bg-2); }
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--glow);
  box-shadow: 0 0 16px var(--glow-soft);
}
.field__hint { margin: 8px 0 0; font-size: 0.8rem; line-height: 1.5; color: var(--muted); }
.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 8px 0 26px;
  font-size: 0.88rem;
  color: var(--muted);
}
.consent input {
  appearance: none;
  flex: none;
  width: 20px; height: 20px;
  margin-top: 0.3em;
  border: 1px solid rgba(143, 200, 222, 0.45);
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.consent input::after {
  content: "";
  width: 6px; height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: 0;
}
.consent input:checked { background: var(--blood); border-color: var(--blood); }
.consent input:checked::after { opacity: 1; }
.consent input:focus-visible { outline: none; box-shadow: 0 0 14px var(--glow-soft); border-color: var(--glow); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; } /* ловушка для спам-ботов */
.order__status { margin: 16px 0 0; min-height: 1.5em; }
.order__status.is-ok { color: var(--glow); }
.order__status.is-err { color: #e0667a; }

/* ---------- Футер ---------- */

.footer {
  padding: 56px 0 40px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.6));
  font-size: 1.02rem;
  color: var(--muted);
}
.footer__grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.footer h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--steel);
}
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin: 4px 0; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--glow); }
.footer__tag { font-family: var(--font-script); font-size: 1.5rem; color: var(--steel); margin: 6px 0 0; }
.footer__bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
}

/* ---------- Появление при прокрутке ---------- */

/* Прячем блоки только когда скрипт реально работает (класс .js ставит script.js),
   иначе без JS страница осталась бы пустой */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s ease, transform 0.9s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

.hero__content > * { animation: rise 1.2s both; }
.hero__title .brush:nth-child(1) { animation: rise 1.2s 0.15s both; }
.hero__title .brush:nth-child(2) { animation: rise 1.2s 0.45s both; }
.hero__lead { animation-delay: 1.4s !important; }
.hero__actions { animation-delay: 0.95s !important; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Служебная страница ---------- */

.doc { padding: 120px 0 80px; }
.doc h1 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--steel);
  font-size: clamp(1.4rem, 3.5vw, 2.1rem);
}
.doc h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.12em; color: var(--steel); font-size: 1.2rem; margin-top: 2rem; }
.doc p, .doc li { max-width: 46em; }


/* =========================================================
   Главная: три двери
   ========================================================= */
.hero__lead--short { max-width: 30em; margin-bottom: 0; }
.doors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 210px));
  gap: 22px;
  justify-content: center;
  margin-top: 2.6rem;
  animation: rise 1.4s 2s both;
}
.door {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 270px;
  padding: 22px 16px 24px;
  border: 1px solid rgba(143, 200, 222, 0.32);
  border-radius: 105px 105px 2px 2px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(180deg, rgba(122, 166, 194, 0.12), rgba(6, 8, 11, 0.9) 70%);
  transition: transform 0.4s, border-color 0.4s, box-shadow 0.4s;
}
/* переплёт витража */
.door::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(143, 200, 222, 0.14) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(0deg, transparent calc(62% - 0.5px), rgba(143, 200, 222, 0.14) 62%, transparent calc(62% + 0.5px));
}
.door__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.32;
  filter: saturate(0.7);
  transition: opacity 0.4s, transform 0.8s;
}
.door__icon {
  width: 64px;
  height: 64px;
  margin-bottom: auto;
  margin-top: 46px;
  color: var(--steel);
  opacity: 0.8;
  transition: color 0.4s, opacity 0.4s;
}
.door__title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bright);
}
.door__sub { font-size: 0.82rem; color: var(--muted); text-align: center; line-height: 1.45; }
.door:hover, .door:focus-visible {
  transform: translateY(-6px);
  border-color: var(--glow);
  box-shadow: 0 0 34px var(--glow-soft), inset 0 0 40px rgba(127, 220, 239, 0.08);
  outline: none;
}
.door:hover .door__bg { opacity: 0.55; transform: scale(1.05); }
.door:hover .door__icon { color: var(--glow); opacity: 1; }
@media (max-width: 720px) {
  .doors { grid-template-columns: 1fr; gap: 14px; width: min(100%, 340px); margin-inline: auto; }
  .door { height: 104px; border-radius: 52px 52px 2px 2px; justify-content: center; }
  .door__icon { display: none; }
}

/* =========================================================
   Шапка раздела (Графика / Скрипты / Вёрстка)
   ========================================================= */
.page-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(130px, 18vw, 190px) 0 clamp(64px, 9vw, 110px);
  text-align: center;
  background:
    radial-gradient(ellipse 60% 70% at 50% 0%, rgba(80, 130, 170, 0.2), transparent 70%),
    linear-gradient(180deg, #0a0f15, var(--bg));
}
.page-hero .hero__windows { opacity: 0.6; }
.page-hero .heading { margin-bottom: 1.4rem; }
.page-hero .heading__script { font-size: clamp(3.2rem, 9vw, 5.6rem); }
.page-hero .heading__caps { font-size: clamp(1.1rem, 2.6vw, 1.6rem); color: var(--bright); letter-spacing: 0.34em; }
.page-hero__lead { max-width: 34em; margin: 0 auto 2.2rem; font-size: 1.1rem; color: var(--text); }

/* =========================================================
   Эпиграфы: наклонная стена, ряды плывут навстречу друг другу
   ========================================================= */
.ep-wall {
  position: relative;
  height: clamp(460px, 58vw, 720px);
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent), linear-gradient(0deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent), linear-gradient(0deg, transparent, #000 12%, #000 88%, transparent);
  mask-composite: intersect;
}
.ep-wall__tilt {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transform: translate(-50%, -50%) rotate(-7deg);
}
.ep-row {
  display: flex;
  gap: 18px;
  width: max-content;
  animation: slide var(--dur, 70s) linear infinite;
}
.ep-row--rev { animation-direction: reverse; }
.ep-row .work {
  flex: none;
  width: auto;
  height: clamp(170px, 19vw, 250px);
  margin: 0;
}
.ep-row .work img { height: 100%; width: auto; }
.ep-wall:hover .ep-row, .ep-wall:focus-within .ep-row { animation-play-state: paused; }
.ep-wall:hover .work { filter: brightness(0.55) saturate(0.8); }
.ep-wall .work:hover, .ep-wall .work:focus-visible { filter: none; transform: scale(1.05); z-index: 2; }
@keyframes slide { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ep-wall { height: auto; -webkit-mask-image: none; mask-image: none; margin: 0; }
  .ep-wall__tilt { position: static; transform: none; }
  .ep-row { flex-wrap: wrap; justify-content: center; width: auto; }
  .ep-row [data-clone] { display: none; }
}

/* =========================================================
   Скрипты: каталог
   ========================================================= */
.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 18px;
}
.script-card { display: flex; flex-direction: column; }
.script-card p { flex: 1; }
.badge {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 0.8rem;
  padding: 0.25em 0.8em;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--glow);
  border: 1px solid rgba(127, 220, 239, 0.4);
}
.badge--muted { color: var(--muted); border-color: var(--line); }
.dice__hint { margin: 12px 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--muted); }

/* ---------- Телефон: разгружаем шапку и первый экран ---------- */
@media (max-width: 720px) {
  .nav .btn--sm { display: none; }              /* кнопка заказа есть в шапке раздела */
  .page-hero { padding-top: 150px; }
  .hero__content { padding-top: 190px; }
  .hero .shard--3, .hero .shard--4 { display: none; }   /* внизу теперь двери */
  .shard--1 { top: 104px; width: 24vw; }
  .shard--2 { top: 110px; width: 22vw; }
}

/* =========================================================
   Главная — ровно один экран на любом мониторе, без прокрутки.
   Размеры считаются от высоты окна (vh), чтобы на низком ноутбуке
   всё сжималось, а на большом мониторе не расползалось.
   ========================================================= */
.hero--hub {
  height: 100vh;
  height: 100svh;
  min-height: 0;
}
.hero--hub .hero__content { padding: calc(64px + 3vh) var(--gutter) calc(34px + 4vh); }
.hero--hub .hero__title {
  font-size: clamp(1.2rem, min(3.1vw, 5.8vh), 3rem);
  gap: 0.3em;
}
.hero--hub .hero__lead { margin: 3.2vh auto 0; font-size: clamp(0.9rem, 2.2vh, 1.1rem); }
.hero--hub .doors { margin-top: 4.2vh; }
.hero--hub .door { height: clamp(92px, 30vh, 270px); padding-bottom: clamp(12px, 2.6vh, 24px); }
.hero--hub .door__icon { width: clamp(34px, 7vh, 64px); height: clamp(34px, 7vh, 64px); margin-top: clamp(10px, 5vh, 46px); }
.hero--hub .door__title { font-size: clamp(1rem, 2.8vh, 1.45rem); }
.hero--hub .door__sub { font-size: clamp(0.72rem, 1.5vh, 0.82rem); }

/* Строка внизу экрана вместо обычного подвала */
.hub-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 1.4vh var(--gutter);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.hub-foot a { color: var(--muted); text-decoration: none; }
.hub-foot a:hover { color: var(--glow); }

@media (max-width: 720px) {
  .hero--hub .hero__content { padding-top: calc(96px + 11vh); padding-bottom: calc(30px + 3vh); }
  .hero--hub .hero__title { font-size: clamp(1.05rem, min(6vw, 3.6vh), 1.8rem); }
  .hero--hub .doors { margin-top: 3vh; gap: 1.4vh; }
  .hero--hub .door { height: clamp(58px, 9.5vh, 104px); padding: 0 16px; }
  .hero--hub .shard--1, .hero--hub .shard--2 { top: calc(96px + 1vh); width: min(20vw, 10vh); }
}
/* Совсем низкое окно (телефон боком): лучше прокрутка, чем сплющенные двери */
@media (max-height: 430px) {
  .hero--hub { height: auto; min-height: 100svh; }
}

/* Сцена осколков: не шире 1600px и не выше 980px, по центру экрана.
   На 1920–3440px осколки остаются рядом с заголовком, центр не пустеет. */
.hero__stage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(100%, 1600px);
  height: min(100%, 980px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}
@media (min-width: 1700px) {
  .shard--1 { width: clamp(150px, 12vw, 235px); }
  .shard--2 { width: clamp(140px, 11vw, 225px); }
  .shard--3 { width: clamp(150px, 11.5vw, 225px); }
  .shard--4 { width: clamp(130px, 10.5vw, 215px); }
  .shard--5, .shard--6 { width: clamp(90px, 7vw, 145px); }
}

/* ---------- Осколки при сужении экрана ----------
   Чем уже экран, тем меньше осколков: сначала уходят нижние (иначе прячутся под двери),
   потом средние. Исчезают плавно, а не пропадают рывком. */
.hero--hub .shard { transition: opacity 0.6s ease, visibility 0.6s; }
@media (min-width: 721px) and (max-width: 1180px) {
  .hero--hub .shard--3, .hero--hub .shard--4 { opacity: 0; visibility: hidden; }
}
@media (min-width: 721px) and (max-width: 940px) {
  .hero--hub .shard--5, .hero--hub .shard--6 { opacity: 0; visibility: hidden; }
}

/* Телефон: три осколка плотной группой над заголовком — центральный крупнее и сверху */
@media (max-width: 720px) {
  .hero--hub { --c: min(25vw, 12vh); --s: min(19vw, 9vh); }
  .hero--hub .shard--1, .hero--hub .shard--2, .hero--hub .shard--5 { display: block; }
  .hero--hub .shard--5 {
    z-index: 1;
    width: var(--c);
    top: calc(96px + 1vh);
    left: calc(50% - var(--c) / 2);
    --r: -4deg; --fx: 0vw; --fy: 24vh;
  }
  .hero--hub .shard--1 {
    width: var(--s);
    top: calc(96px + 3.2vh);
    left: calc(50% - var(--c) / 2 - var(--s) * 0.78);
    --r: -13deg; --fx: 12vw; --fy: 22vh;
  }
  .hero--hub .shard--2 {
    width: var(--s);
    top: calc(96px + 2.6vh);
    right: auto;
    left: calc(50% + var(--c) / 2 - var(--s) * 0.22);
    --r: 11deg; --fx: -12vw; --fy: 22vh;
  }
  .hero--hub .hero__content { padding-top: calc(96px + 15vh); }
  .hero--hub .door { height: clamp(54px, 8.8vh, 104px); }
}

/* Средние экраны: строки заголовка без сдвига, верхние осколки — к углам под меню */
@media (min-width: 721px) and (max-width: 1180px) {
  .hero--hub .brush--first, .hero--hub .brush--second { margin: 0; }
  .hero--hub .shard--1 { top: calc(64px + 1.5vh); left: 2%; width: clamp(90px, 10vw, 130px); }
  .hero--hub .shard--2 { top: calc(64px + 1vh); right: 2%; width: clamp(86px, 9.5vw, 125px); }
}

/* Главная: сдвиг строк заголовка поменьше, чтобы вторая строка не упиралась в правые осколки */
@media (min-width: 1181px) {
  .hero--hub .brush--first { margin-right: clamp(0px, 6vw, 110px); }
  .hero--hub .brush--second { margin-left: clamp(0px, 7vw, 130px); }
}
/* Средние экраны: маленькие осколки — у самых краёв на высоте заголовка, подальше от дверей */
@media (min-width: 941px) and (max-width: 1180px) {
  .hero--hub .shard--5 { top: 38%; left: 1.5%; width: clamp(70px, 7.5vw, 95px); }
  .hero--hub .shard--6 { top: 40%; right: 1.5%; width: clamp(70px, 7.5vw, 95px); }
}
@media (min-width: 1181px) {
  .hero--hub .shard--2 { top: 6%; }
  .hero--hub .shard--6 { top: 50%; }
}
@media (min-width: 1181px) {
  .hero--hub .shard--5 { left: 9.5%; }
  .hero--hub .shard--6 { right: 9.5%; }
}
@media (min-width: 1700px) {
  .hero--hub .shard--2 { top: 5%; width: clamp(140px, 10vw, 200px); }
}

/* =========================================================
   Осколки с раскладкой по свободному месту (script.js, layoutShards).
   Без JS работают правила выше; с JS место и размер каждого осколка
   считаются под конкретный экран, а здесь только оформление.
   ========================================================= */
.shard--7 { display: none; aspect-ratio: 1; --d: 0.8s; }
.shard--7 .shard__glass { clip-path: polygon(14% 0, 100% 10%, 90% 86%, 30% 100%, 0 58%); }
.shard--8 { display: none; aspect-ratio: 1; --d: 0.85s; }
.shard--8 .shard__glass { clip-path: polygon(0 22%, 64% 0, 100% 40%, 84% 100%, 12% 92%); }

.hero.shards-js .hero__stage { z-index: 3; }         /* поверх мазков кисти; текст и двери осколки не задевают */
.hero.shards-js .shard { display: block; aspect-ratio: 1; }
.hero.shards-js.is-relayout .shard {
  transition: left 0.8s cubic-bezier(.3, .7, .2, 1), top 0.8s cubic-bezier(.3, .7, .2, 1),
              width 0.8s cubic-bezier(.3, .7, .2, 1), opacity 0.6s ease, visibility 0.6s;
}

/* Телефон: осколки парят с меньшим размахом — так им остаётся больше места */
@media (max-width: 720px) { .hero--hub { --drift: -8px; } }

/* ---------- Глубина, как в шапке ---------- */
.shard__par { perspective: 900px; }

/* Задний план: пустые стёклышки без картинок (создаёт script.js) */
.hero__dust {
  position: absolute;
  inset: 0;
  z-index: 1;                 /* за текстом и дверями, над трещинами */
  pointer-events: none;
}
.frag {
  position: absolute;
  opacity: var(--o, 0.8);
  filter: blur(var(--b, 0px)) drop-shadow(0 0 3px rgba(160, 230, 250, 0.45));
}
.frag__fly {
  width: 100%;
  height: 100%;
  animation: fly 2.8s calc(1.3s + var(--d, 0s)) cubic-bezier(.22, .7, .25, 1) both;
}
.frag__par {
  width: 100%;
  height: 100%;
  perspective: 500px;
  transform: translate3d(calc(var(--mx, 0) * var(--depth, 6) * 1px), calc(var(--my, 0) * var(--depth, 6) * 1px), 0);
  transition: transform 0.9s cubic-bezier(.2, .7, .2, 1);
}
.frag__glass {
  --drift: -10px;
  width: 100%;
  height: 100%;
  animation: drift 11s ease-in-out infinite alternate;
}
/* Стекло видно по граням, а не по заливке: тело почти прозрачное,
   одна кромка ловит свет, внутри — короткий блик */
.frag svg { display: block; width: 100%; height: 100%; overflow: visible; }
.frag__body {
  fill: rgba(205, 240, 255, 0.06);
  stroke: rgba(170, 225, 245, 0.42);
  stroke-width: 1;
  stroke-linejoin: miter;
  vector-effect: non-scaling-stroke;
}
.frag__edge {
  fill: none;
  stroke: rgba(242, 253, 255, 0.95);
  stroke-width: 1.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.frag__glint {
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 1;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.hero.shards-js.is-relayout .frag { transition: left 0.8s, top 0.8s, width 0.8s, height 0.8s; }

/* Временные номера работ (А1…, К1…) — чтобы Ярослава могла сказать, что с чем ставить.
   Убрать: удалить класс numbered у панелей в art/index.html. */
.numbered .work::before {
  content: attr(data-n);
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 3;
  padding: 1px 6px;
  font-family: var(--font-text);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--glow);
  background: rgba(6, 8, 11, 0.85);
  border: 1px solid var(--line);
  pointer-events: none;
}
