/* ALISHER — прототип v2. Единая сцена WebGL на всю страницу; текст и запись поверх неё.
   Без внешних шрифтов и библиотек (скорость, приватность, лицензии). */
:root {
  --ink: #f1ede6;
  --muted: #aaa49b;
  --line: rgba(255, 255, 255, .09);
  --ember: #ff7a2a;
  --ember-2: #ffb25a;
  --panel: rgba(8, 8, 11, .66);
  --radius: 14px;
  --max: 1180px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.22, .7, .2, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: #050507; }
body { margin: 0; color: var(--ink); font: 17px/1.6 var(--sans); overflow-x: hidden; background: transparent; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; margin: 0 0 .5em; }
h2 { font-size: clamp(32px, 4.8vw, 60px); letter-spacing: -.01em; }
h3 { font-size: 22px; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { text-transform: uppercase; letter-spacing: .26em; font-size: 12px; color: var(--ember-2); margin-bottom: .9em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; color: #000; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--ember-2); outline-offset: 3px; border-radius: 6px; }
section[id] { scroll-margin-top: 70px; }

.proto-bar { position: relative; z-index: 60; text-align: center; font-size: 12px; letter-spacing: .08em; padding: 6px 12px;
  background: rgba(42, 22, 8, .92); color: #ffcf9a; border-bottom: 1px solid rgba(255, 160, 80, .25); }

/* ---------- сцена ---------- */
.world { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -2; display: block; background: #050507; }
.world-still { position: fixed; inset: 0; z-index: -3; display: none;
  background: radial-gradient(90% 70% at 50% 45%, rgba(5,5,7,0), rgba(5,5,7,.85)), url(../assets/scene/smoke.webp) center / cover no-repeat, #050507; }
html.no-world .world { display: none; }
html.no-world .world-still { display: block; }

/* ---------- навигация ---------- */
.nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 24px; padding: 10px clamp(16px, 4vw, 40px);
  background: linear-gradient(180deg, rgba(5,5,7,.82), rgba(5,5,7,.45)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); }
.nav__logo img { width: 112px; height: auto; }
.nav nav { flex: 1; }
.nav__links { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; font-size: 14px; color: #d4cec4; }
.nav__links a { text-decoration: none; }
.nav__links a:hover { color: #fff; }
.nav__actions { display: flex; align-items: center; gap: 12px; }
@media (max-width: 900px) { .nav nav { display: none; } .nav { justify-content: space-between; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 26px; border-radius: 999px;
  background: linear-gradient(135deg, #ff8a35, #e6501b); color: #120804; font-weight: 650; text-decoration: none; border: 0; cursor: pointer;
  box-shadow: 0 8px 30px rgba(255, 110, 40, .28); transition: transform .3s var(--ease), box-shadow .3s; font-size: 16px; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(255, 110, 40, .42); }
.btn--small { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn--ghost { background: rgba(255,255,255,.06); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); backdrop-filter: blur(4px); }
.motion-toggle { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 8px 12px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.motion-toggle__off { display: none; }
html[data-motion="off"] .motion-toggle__on { display: none; }
html[data-motion="off"] .motion-toggle__off { display: inline; }
.sm-show { display: none; }
@media (max-width: 520px) {
  .sm-hide { display: none; } .sm-show { display: inline; }
  .nav { gap: 10px; } .nav__logo img { width: 92px; }
  .motion-toggle { padding: 8px; font-size: 11px; } .motion-toggle::before { content: "◐ "; }
  .btn--small { padding: 0 14px; }
}

/* выбор логотипа (только прототип) */
.logo-pick { position: fixed; right: 14px; bottom: 14px; z-index: 70; display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px;
  background: rgba(10,10,13,.85); border: 1px solid rgba(255,180,90,.35); border-radius: 999px; font-size: 12px; color: #ffcf9a; backdrop-filter: blur(8px); }
.logo-pick button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; font-weight: 700; }
.logo-pick button[aria-pressed="true"] { background: var(--ember-2); color: #120804; border-color: transparent; }

/* ---------- вход в мир ---------- */
.hero { position: relative; min-height: calc(100svh - 64px); display: grid; place-items: end center; padding: 40px 20px 13svh; }
.hero__content { text-align: center; max-width: 920px; }
.hero__logo { margin: 0 auto .15em; width: min(800px, 90vw); filter: drop-shadow(0 6px 34px rgba(0,0,0,.9)) drop-shadow(0 0 3px rgba(0,0,0,.8)); }
.logo-anim, .logo-anim svg, .logo-anim img { display: block; width: 100%; height: auto; color: #fff; }
.logo-anim .rv { stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: draw .55s cubic-bezier(.65, .05, .3, 1) forwards;
  animation-delay: calc(.3s + var(--i) * .14s); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero__slogan { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 3vw, 34px); margin: 0 0 .3em;
  text-shadow: 0 2px 22px rgba(0,0,0,.95); opacity: 0; animation: rise 1.2s 2.1s var(--ease) forwards; }
.hero__meta { color: #ddd6cb; letter-spacing: .14em; text-transform: uppercase; font-size: 12.5px; text-shadow: 0 2px 12px #000;
  opacity: 0; animation: rise 1.2s 2.4s var(--ease) forwards; }
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; opacity: 0; animation: rise 1.2s 2.6s var(--ease) forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero__scroll { position: absolute; bottom: 22px; left: 50%; width: 26px; height: 42px; margin-left: -13px; border: 1.5px solid rgba(255,255,255,.4); border-radius: 14px; }
.hero__scroll span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: var(--ember-2); animation: wheel 2s infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- главы истории ---------- */
.chapter { position: relative; min-height: 190svh; }
.chapter__text { position: sticky; top: 30svh; width: min(var(--max), calc(100% - 40px)); margin: 30svh auto 0;
  opacity: 0; transform: translateY(30px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.chapter__text > * { max-width: 470px; }
.chapter--right .chapter__text > * { margin-left: auto; }
.chapter__text h2, .chapter__text p { text-shadow: 0 2px 26px rgba(0,0,0,.95), 0 0 2px rgba(0,0,0,.7); }
.chapter.in .chapter__text { opacity: 1; transform: none; }
.still { display: none; margin: 0; }
@media (max-width: 760px) {
  .chapter { min-height: 170svh; }
  .chapter__text { top: auto; bottom: 8svh; margin-top: 110svh; padding: 26px 0 0;
    background: linear-gradient(180deg, rgba(5,5,7,0), rgba(5,5,7,.75) 40%); }
}
/* запасной режим (нет WebGL или анимации выключены): кадры в потоке, края мягкие */
html.no-world .chapter { min-height: 0; padding: 60px 0; display: grid; gap: 20px; justify-items: center; }
html.no-world .still { display: block; width: min(720px, 92vw); }
html.no-world .still img { width: 100%; -webkit-mask-image: radial-gradient(58% 56% at 50% 50%, #000 55%, transparent 100%);
  mask-image: radial-gradient(58% 56% at 50% 50%, #000 55%, transparent 100%); }
html.no-world .chapter__text { position: static; margin: 0 auto; opacity: 1; transform: none; background: none; padding: 0; }

/* ---------- разделы с содержанием: читаемость поверх сцены ---------- */
.section { position: relative; width: min(var(--max), calc(100% - 40px)); margin: 0 auto; padding: clamp(70px, 10vw, 130px) 0; }
.section::before { content: ""; position: absolute; inset: 0 -8vw; z-index: -1; pointer-events: none;
  background: radial-gradient(75% 60% at 50% 50%, rgba(5,5,7,.78), rgba(5,5,7,.45) 70%, rgba(5,5,7,0)); }
.section__head { max-width: 680px; margin-bottom: 40px; }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

.placeholder { display: grid; place-items: center; text-align: center; min-height: 260px; height: 100%; border-radius: var(--radius); padding: 20px;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 12px, rgba(255,255,255,.01) 12px 24px), rgba(12,12,15,.72);
  border: 1px dashed rgba(255,255,255,.18); color: var(--muted); font-size: 14px; }
.placeholder--portrait { aspect-ratio: 4 / 5; }
.placeholder-text { color: var(--ember-2); font-size: 14px; }

.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(30px, 6vw, 80px); align-items: center; }
@media (max-width: 800px) { .about { grid-template-columns: 1fr; } }
.stats { list-style: none; padding: 0; margin: 30px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stats li { border-top: 1px solid rgba(255,140,60,.4); padding-top: 12px; }
.stats strong { display: block; font-family: var(--serif); font-size: 30px; font-weight: 500; color: #fff; }
.stats span { font-size: 13px; color: var(--muted); }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: 9px 16px; font-size: 14px; cursor: pointer; }
.chip.is-active { background: var(--ink); color: #111; }
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 240px; gap: 14px; }
.gallery li.tall { grid-row: span 2; }
.gallery li[hidden] { display: none; }
@media (max-width: 800px) { .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; } }

.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card .placeholder { min-height: 300px; margin-bottom: 14px; }
.link { color: var(--ember-2); text-decoration: none; font-weight: 600; }
@media (max-width: 800px) { .cards { grid-template-columns: 1fr; } }

.prices { list-style: none; padding: 0; margin: 0; max-width: 760px; }
.prices li { display: flex; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.prices strong { font-family: var(--serif); font-size: 22px; font-weight: 500; white-space: nowrap; color: #fff; }
.note { color: var(--muted); max-width: 760px; margin-top: 18px; font-size: 15px; }

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; backdrop-filter: blur(6px); }
@media (max-width: 900px) { .info-grid { grid-template-columns: 1fr; } }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 820px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: clamp(20px, 4vw, 36px); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; }
.field--wide { grid-column: 1 / -1; }
.field label, legend { font-size: 14px; color: #d8d1c6; }
input, textarea { font: inherit; color: var(--ink); background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.16); border-radius: 10px; padding: 12px 14px; }
input[type="file"] { padding: 10px; }
input:focus, textarea:focus { border-color: var(--ember-2); outline: none; }
.radio { display: inline-flex; align-items: center; gap: 8px; margin-right: 18px; font-size: 15px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.consent input { margin-top: 4px; }
.form__status { min-height: 1.4em; margin: 0; font-size: 15px; }
.form__status.ok { color: #ffcf9a; }
.form__status.err { color: #ff8f8f; }
@media (max-width: 640px) { .form { grid-template-columns: 1fr; } }

.contact { text-align: center; }
.socials { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.socials a { display: inline-block; padding: 12px 22px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); text-decoration: none; background: rgba(5,5,7,.4); }
.socials a:hover { border-color: var(--ember-2); }

.footer { text-align: center; padding: 60px 20px 80px; border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(5,5,7,.5), rgba(5,5,7,.92)); }
.footer img { width: 150px; margin: 0 auto 12px; }

/* ---------- режим без движения ---------- */
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after {
  animation-duration: .001s !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition: none !important; scroll-behavior: auto !important; }
html[data-motion="off"] .reveal, html[data-motion="off"] .chapter__text { opacity: 1; transform: none; }

/* поля формы не шире экрана телефона (иначе страница «раздувается» до 412 px) */
.form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.form > * { min-width: 0; }
input, textarea { width: 100%; min-width: 0; }
input[type="checkbox"], input[type="radio"] { width: auto; }
@media (max-width: 640px) { .form { grid-template-columns: minmax(0, 1fr); } }

/* подложки разделов шире контента — не дают горизонтальную прокрутку */
html, body { overflow-x: clip; }

/* galeria: prawdziwe prace */
.gallery figure { margin: 0; height: 100%; }
.gallery a { display: block; height: 100%; border-radius: var(--radius); overflow: hidden; background: #0b0b0d; }
.gallery img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.gallery a:hover img, .gallery a:focus-visible img { transform: scale(1.04); }
html[data-motion="off"] .gallery img { transition: none; }
.legal { max-width: 760px; margin: 0 auto; padding: 120px 20px 60px; }
.legal h1 { font-size: clamp(28px, 4vw, 40px); }
.about__photo img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
.card__img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); margin-bottom: 14px; background: #0b0b0d; }
