:root {
  color-scheme: dark;
  --bg: #08070b;
  --bg-2: #110e17;
  --bg-3: #191522;
  --line: #251f31;
  --text: #efebf7;
  --muted: #9890aa;
  --real: #c4b5fd;      /* реальность: светлый лиловый */
  --ai: #a855f7;        /* AI: неоновый фиолетовый */
  --ai-2: #e879f9;
  --edit: #d8b4fe;      /* монтаж: мягкий сиреневый */
  --radius: 14px;
  --gut: clamp(16px, 4vw, 56px);
  --display: "Unbounded", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  background: var(--bg); color: var(--text);
  font: 400 17px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* плёночное зерно поверх всего */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; line-height: 1.05; }

/* ---------- Кнопки, метки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  padding: .9em 1.4em; border-radius: 999px;
  background: linear-gradient(90deg, var(--ai), var(--ai-2)); color: #fff; font-weight: 700; text-decoration: none;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 34px -10px var(--ai); }
.btn svg { width: 1.1em; height: 1.1em; fill: currentColor; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--text); }
.btn-light { background: var(--text); color: var(--bg); }
.btn-sm { padding: .55em 1.1em; font-size: 14px; }

.tag {
  display: inline-block; font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  padding: .55em .8em; border-radius: 6px; background: rgba(8,7,11,.72); backdrop-filter: blur(6px);
}
.tag-real { color: var(--real); box-shadow: inset 0 0 0 1px rgba(196,181,253,.5); }
.tag-ai { color: var(--ai); box-shadow: inset 0 0 0 1px rgba(168,85,247,.55); }
.tag-edit { color: var(--edit); box-shadow: inset 0 0 0 1px rgba(216,180,254,.5); }

.track-label {
  display: flex; align-items: center; gap: .6em;
  font: 600 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 18px;
}
.dot { width: 10px; height: 10px; border-radius: 3px; }
.dot-v1 { background: var(--real); }
.dot-v2 { background: var(--ai); }
.dot-v3 { background: var(--edit); }
.dot-a1 { background: var(--ai-2); }

/* ---------- Верхняя панель ---------- */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 14px var(--gut);
  background: rgba(8,7,11,.78); backdrop-filter: blur(14px);
}
.logo { display: flex; align-items: center; gap: 10px; font: 700 16px var(--display); text-decoration: none; letter-spacing: -.01em; }
.logo-mark { display: flex; gap: 3px; }
.logo-mark i { width: 7px; height: 18px; border-radius: 2px; background: var(--real); }
.logo-mark i + i { background: var(--ai); }
.nav { display: flex; gap: 24px; margin-left: auto; }
.nav a { text-decoration: none; font-size: 15px; color: var(--muted); transition: color .2s; }
.nav a:hover { color: var(--text); }
.tc { display: flex; align-items: center; gap: 8px; font: 600 13px var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.rec { width: 8px; height: 8px; border-radius: 50%; background: #ff3b30; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .15; } }
.ruler {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 24px);
}
.ruler-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--real), var(--ai)); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; padding: 120px var(--gut) 64px;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 80px); align-items: center;
  max-width: 1440px; margin: 0 auto;
}
.eyebrow { font: 600 13px var(--mono); letter-spacing: .06em; color: var(--muted); margin-bottom: 28px; }
.hero h1 { font-size: clamp(38px, 5.6vw, 84px); font-weight: 800; }
.w-real { color: var(--real); }
.w-ai {
  background: linear-gradient(90deg, var(--ai), #c084fc 50%, var(--ai-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: clamp(17px, 1.4vw, 20px); color: #c8c1d6; max-width: 560px; margin-top: 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 14px 40px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.hero-facts b { display: block; font: 700 22px var(--display); }
.hero-facts span { font-size: 13px; color: var(--muted); }

/* Шов реальность / AI */
.seam {
  position: relative; aspect-ratio: 9 / 16; max-height: 78vh; width: 100%; justify-self: center;
  border-radius: 22px; overflow: hidden; user-select: none; touch-action: pan-y;
  box-shadow: 0 40px 120px -40px rgba(168,85,247,.45), 0 0 0 1px var(--line);
  --pos: 50%;
}
.seam img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.seam-real { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.seam-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 18px #fff; pointer-events: none; }
.seam-knob {
  position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border-radius: 50%; background: #fff; display: grid; place-items: center;
}
.seam-knob svg { width: 22px; height: 22px; stroke: var(--bg); fill: none; stroke-width: 2.2; }
.seam-tag-l { position: absolute; top: 16px; left: 16px; }
.seam-tag-r { position: absolute; top: 16px; right: 16px; }
.seam-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.seam figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 18px 16px;
  font-size: 13px; line-height: 1.45; color: #ebe6f4;
  background: linear-gradient(transparent, rgba(0,0,0,.75)); pointer-events: none;
}
.seam figcaption a { color: #fff; font-weight: 700; pointer-events: auto; position: relative; z-index: 2; }

/* ---------- Шоурил-лента ---------- */
.reel { position: relative; height: min(70vh, 56vw); overflow: hidden; }
.reel-video { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.05) contrast(1.05); }
.reel::before, .reel::after { content: ""; position: absolute; left: 0; right: 0; height: 30%; z-index: 1; pointer-events: none; }
.reel::before { top: 0; background: linear-gradient(var(--bg), transparent); }
.reel::after { bottom: 0; background: linear-gradient(transparent, var(--bg)); }
.reel-over {
  position: absolute; inset: auto var(--gut) 40px; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.marker { font: 600 13px var(--mono); letter-spacing: .14em; color: var(--text); }

/* ---------- Секции ---------- */
.section { padding: clamp(80px, 11vw, 150px) var(--gut) 0; max-width: 1440px; margin: 0 auto; }
.sec-head { max-width: 900px; margin-bottom: 44px; }
.sec-head h2 { font-size: clamp(30px, 4vw, 56px); }
.sec-sub { color: #c8c1d6; margin-top: 22px; max-width: 700px; font-size: 18px; }

/* ---------- Фильтры и сетка работ ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.chip {
  padding: .6em 1.1em; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted);
  box-shadow: inset 0 0 0 1.5px var(--line); transition: all .2s;
}
.chip:hover { color: var(--text); }
.chip.is-on { background: var(--text); color: var(--bg); box-shadow: none; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; grid-auto-flow: dense; }
.card {
  position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bg-2);
  cursor: pointer; aspect-ratio: 9 / 16; isolation: isolate;
  opacity: 0; transform: translateY(24px); transition: opacity .6s, transform .6s;
}
.card.in { opacity: 1; transform: none; }
.card.h { grid-column: span 2; aspect-ratio: 9 / 8; } /* две колонки шириной = высота вертикальной карточки */
.card.hidden { display: none; }
.card img, .card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1), opacity .4s; }
.card video { opacity: 0; }
.card.playing video { opacity: 1; }
.card:hover img, .card:hover video { transform: scale(1.04); }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.85)); z-index: 1; }
.card-top { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 2; display: flex; justify-content: space-between; gap: 8px; }
.card-dur { font: 600 11px var(--mono); padding: .55em .7em; border-radius: 6px; background: rgba(8,7,11,.72); }
.card-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 18px; }
.card-body h3 { font-size: clamp(17px, 1.5vw, 22px); }
.card-body p { font-size: 14px; line-height: 1.45; color: #d6d0e2; margin-top: 8px; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .4s, opacity .4s; }
.card:hover .card-body p, .card:focus-visible .card-body p { max-height: 90px; opacity: 1; }
.card:focus-visible { outline: 2px solid var(--real); outline-offset: 3px; }
/* горизонтальные карточки: высота как у вертикальной в том же ряду */
.card.h .card-frame { position: absolute; inset: 0; }

/* Карточка-приглашение в конце сетки: ширину (span) выставляет app.js, чтобы добить последний ряд */
.card-cta {
  aspect-ratio: auto; min-height: 280px; text-decoration: none;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 20px;
  padding: clamp(20px, 3vw, 40px);
  background: radial-gradient(120% 90% at 100% 100%, rgba(168,85,247,.28), transparent 60%),
              radial-gradient(90% 80% at 0% 0%, rgba(196,181,253,.22), transparent 60%), var(--bg-2);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.card-cta::after { display: none; }
.card-cta h3 { font-size: clamp(24px, 3vw, 44px); max-width: 14ch; }
.card-cta p { color: #c8c1d6; margin-top: 12px; }
.card-cta:hover { box-shadow: inset 0 0 0 1.5px var(--ai); }
.card-cta.tall { aspect-ratio: 9 / 16; }
.card-cta.tall h3 { font-size: clamp(20px, 2.2vw, 28px); }

/* ---------- Подход: таймлайн ---------- */
.tl {
  position: relative; background: var(--bg-2); border-radius: var(--radius); padding: 14px 16px 18px 56px;
  box-shadow: 0 0 0 1px var(--line); overflow: hidden; margin-bottom: 48px;
}
.tl-ruler { display: flex; justify-content: space-between; font: 600 11px var(--mono); color: var(--muted); padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.tl-track { position: relative; height: 38px; margin: 6px 0; }
.tl-track em { position: absolute; left: -44px; top: 50%; transform: translateY(-50%); font: 600 12px var(--mono); font-style: normal; color: var(--muted); }
.tl-clip {
  position: absolute; top: 0; bottom: 0; left: var(--s); width: var(--w);
  border-radius: 6px; padding: 0 10px; display: flex; align-items: center;
  font: 600 12px var(--mono); color: #120a20; white-space: nowrap; overflow: hidden;
  transform-origin: left; transform: scaleX(0); transition: transform .9s cubic-bezier(.2,.7,.2,1);
}
.tl.in .tl-clip { transform: none; }
.tl-track:nth-child(3) .tl-clip { transition-delay: .5s; }
.tl-track:nth-child(2) .tl-clip { transition-delay: .9s; }
.tl-track:nth-child(4) .tl-clip + .tl-clip { transition-delay: 1.2s; }
.c-real { background: var(--real); }
.c-ai { background: var(--ai); }
.c-text { background: var(--edit); }
.c-audio { background: #2e1f4d; color: var(--ai-2); padding: 0; }
.c-audio svg { width: 100%; height: 60%; stroke: var(--ai-2); stroke-width: 1.4; fill: none; }
.tl-head { position: absolute; top: 0; bottom: 0; left: 56px; width: 2px; background: #ff3b30; box-shadow: 0 0 10px #ff3b30; }
.tl-head::before { content: ""; position: absolute; top: 0; left: -6px; border: 7px solid transparent; border-top: 9px solid #ff3b30; }

.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { position: relative; padding: 28px; border-radius: var(--radius); background: var(--bg-2); box-shadow: 0 0 0 1px var(--line); }
.step-n { font: 800 44px var(--display); color: transparent; -webkit-text-stroke: 1.5px var(--muted); }
.step h3 { font-size: 24px; margin: 14px 0 12px; }
.step p { color: #c8c1d6; font-size: 16px; }
.step-tag { margin-top: 20px; }

.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.rule { padding: 22px 26px; border-left: 3px solid var(--real); color: #c8c1d6; font-size: 16px; }
.rule:nth-child(2) { border-color: var(--ai); }
.rule:nth-child(3) { border-color: var(--edit); }
.rule b { display: block; color: var(--text); margin-bottom: 6px; font-size: 17px; }

/* ---------- Услуги ---------- */
.services { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.svc { padding: clamp(24px, 3vw, 40px); border-radius: var(--radius); background: var(--bg-2); box-shadow: 0 0 0 1px var(--line); transition: box-shadow .3s, transform .3s; }
.svc:hover { box-shadow: 0 0 0 1px var(--real); transform: translateY(-3px); }
.svc-i { font: 600 13px var(--mono); color: var(--real); }
.svc h3 { font-size: clamp(22px, 2.2vw, 30px); margin: 14px 0; }
.svc p { color: #c8c1d6; }
.svc ul { list-style: none; margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.svc li { font-size: 13px; padding: .45em .8em; border-radius: 999px; background: var(--bg-3); color: #d6d0e2; }
.svc-learn { background: linear-gradient(135deg, #1f1033, var(--bg-2) 60%); }
.svc-learn .svc-i { color: var(--ai); }
.svc-learn:hover { box-shadow: 0 0 0 1px var(--ai); }
.link { display: inline-block; margin-top: 22px; font-weight: 700; color: var(--ai); text-decoration: none; }

/* ---------- Отзывы ---------- */
.reviews { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rev-wide { grid-column: 1 / -1; }
.rev-who a { color: var(--muted); }
.rev-who a:hover { color: var(--text); }
.rev { padding: clamp(24px, 3vw, 40px); border-radius: var(--radius); background: var(--bg-2); box-shadow: 0 0 0 1px var(--line); display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.rev-video { flex-direction: row; align-items: center; gap: clamp(20px, 3vw, 40px); }
.rev-circle { position: relative; flex: none; width: clamp(140px, 16vw, 210px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 3px var(--real), 0 0 0 9px rgba(196,181,253,.15); }
.rev-circle img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.rev-circle:hover img { transform: scale(1.06); }
.rev-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.25); }
.rev-play svg { width: 44px; height: 44px; fill: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,.5)); }
.rev-quote { font: 500 clamp(18px, 1.6vw, 22px)/1.45 var(--body); }
.rev-who { font-size: 14px; color: var(--muted); margin-top: 18px; }
.rev-who b { display: block; color: var(--text); font-size: 16px; margin-bottom: 2px; }

/* ---------- Контакты ---------- */
.contact { text-align: center; padding: clamp(100px, 14vw, 200px) var(--gut); max-width: 1000px; margin: 0 auto; }
.contact .track-label { justify-content: center; }
.contact h2 { font-size: clamp(44px, 8vw, 120px); font-weight: 800;
  background: linear-gradient(90deg, var(--real), var(--ai)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.contact .lead { margin: 28px auto 0; }
.contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 40px; }

.foot { display: flex; justify-content: space-between; gap: 16px; padding: 24px var(--gut); border-top: 1px solid var(--line); font: 600 12px var(--mono); color: var(--muted); }
.foot-tc { color: var(--real); }

/* ---------- Плеер ---------- */
.player { margin: auto; border: 0; padding: 0; background: transparent; color: var(--text); max-width: 100vw; max-height: 100vh; }
.player::backdrop { background: rgba(5,5,5,.92); backdrop-filter: blur(8px); }
.player-box { position: relative; display: flex; gap: 32px; align-items: center; padding: 56px 24px 24px; max-width: 1280px; }
.player-media video { max-height: 82vh; max-width: min(1280px, 92vw); border-radius: 12px; background: #000; }
.player-media.v video { max-width: min(46vh, 92vw); }
.player-media.square video { border-radius: 50%; width: min(420px, 80vw); }
.player-info { max-width: 360px; }
.player-info h3 { font-size: 28px; margin: 14px 0 16px; }
.player-info dl { display: grid; gap: 14px; font-size: 15px; color: #c8c1d6; }
.player-info dt { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.player-x { position: fixed; top: 16px; right: 20px; width: 48px; height: 48px; border-radius: 50%; font-size: 30px; line-height: 1; background: var(--bg-3); z-index: 2; }
.player-x:hover { background: var(--real); color: var(--bg); }
.player.h .player-box { flex-direction: column; align-items: flex-start; }
.player.h .player-info { max-width: 900px; }
.player.h .player-info dl { grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .nav { display: none; }
  .tc { margin-left: auto; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 100px; }
  .seam { max-width: 420px; max-height: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .steps, .rules, .services, .reviews { grid-template-columns: 1fr; }
  .player-box { flex-direction: column; align-items: flex-start; }
  .player.h .player-info dl { grid-template-columns: 1fr; }
  .card-body p { max-height: none; opacity: 1; }
  .card.v .card-body p { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero h1 { font-size: 8.6vw; }
  .bar { gap: 14px; }
  .tc { font-size: 11px; }
  .card-body { padding: 12px; }
  .card-top .tag { font-size: 9px; }
  .rev-video { flex-direction: column; align-items: flex-start; }
  .tl { padding-left: 44px; }
  .tl-track em { left: -36px; }
  .tl-clip { font-size: 10px; padding: 0 6px; }
  .reel-over { bottom: 20px; }
  .foot { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .card { opacity: 1; transform: none; }
  .tl-clip { transform: none; }
}

/* ---------- Страница кейса «как сделано» ---------- */
.case-back { display: inline-block; margin-bottom: 22px; font: 600 13px var(--mono); color: var(--muted); text-decoration: none; }
.case-back:hover { color: var(--text); }
.case-hero .eyebrow { margin-bottom: 20px; }
.case-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 15px; color: #c8c1d6; }
.case-meta dt { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.case-sec .sec-head { margin-bottom: 32px; }
.case-steps { grid-template-columns: repeat(4, 1fr); }

.prompt { border-radius: var(--radius); background: var(--bg-2); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.prompt-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); font: 600 12px/1.4 var(--mono); color: var(--muted); }
.prompt-copy { flex: none; padding: .55em 1em; border-radius: 999px; font: 600 12px var(--mono); color: var(--ai); box-shadow: inset 0 0 0 1px rgba(168,85,247,.55); }
.prompt-copy:hover { background: var(--ai); color: var(--bg); }
.prompt pre { margin: 0; padding: 20px 18px; font: 400 14px/1.65 var(--mono); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.prompt-more { margin-top: 14px; }
.prompt-more summary { cursor: pointer; padding: 14px 4px; font-weight: 700; color: var(--ai); list-style: none; }
.prompt-more summary::-webkit-details-marker { display: none; }
.prompt-more summary::before { content: "+ "; }
.prompt-more[open] summary::before { content: "− "; }

.case-film { display: grid; grid-template-columns: auto minmax(0, 560px); gap: 18px; align-items: stretch; }
.case-video video { border-radius: var(--radius); background: #000; max-height: 80vh; }
.case-video.v video { width: min(45vh, 100%); aspect-ratio: 9 / 16; }
.case-cta { cursor: pointer; opacity: 1; transform: none; aspect-ratio: auto; }

.case-more { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.case-link { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; aspect-ratio: 9 / 12; padding: 18px; border-radius: var(--radius); overflow: hidden; text-decoration: none; isolation: isolate; box-shadow: 0 0 0 1px var(--line); }
.case-link img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.case-link::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,.88)); }
.case-link:hover img { transform: scale(1.04); }
.case-link .tag { align-self: flex-start; }
.case-link h3 { font-size: clamp(17px, 1.5vw, 22px); }
.case-link .link { margin-top: 0; }

/* Ссылка на разбор: в плеере и на карточке */
.player-case { margin: 4px 0 22px; }
.card-case { display: inline-block; margin-bottom: 10px; font: 600 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: .6em .8em; border-radius: 6px; background: var(--ai); color: #fff; text-decoration: none; }

@media (max-width: 1100px) {
  .case-steps { grid-template-columns: repeat(2, 1fr); }
  .case-more { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .case-film { grid-template-columns: 1fr; }
  .case-video.v video { width: 100%; max-width: 420px; }
  .case-steps { grid-template-columns: 1fr; }
  .case-more { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .case-meta { grid-template-columns: 1fr; gap: 16px; }
  .prompt pre { font-size: 13px; padding: 16px 14px; }
  .prompt-head { padding: 12px 14px; }
}

/* Кнопка «полный урок в Telegram» в плеере урока */
.player-tg { margin: 4px 0 22px; background: linear-gradient(90deg, var(--real), var(--ai)); color: #fff; }
.player-tg:hover { box-shadow: 0 10px 30px -10px var(--ai); }

/* ---------- Работы v2: разделы с лентами ---------- */
.cats { display: flex; flex-wrap: wrap; gap: 8px; margin: -12px 0 48px; }
.cat {
  display: inline-flex; align-items: center; gap: 10px; padding: .65em 1.1em; border-radius: 999px;
  font-size: 15px; font-weight: 600; color: var(--text); text-decoration: none;
  box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow .2s, background .2s;
}
.cat span { font: 600 12px var(--mono); color: var(--muted); }
.cat:hover { box-shadow: inset 0 0 0 1.5px var(--text); }

.group { margin-bottom: 64px; opacity: 0; transform: translateY(20px); transition: opacity .7s, transform .7s; scroll-margin-top: 90px; }
.group.in { opacity: 1; transform: none; }
.group-head { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 6px 22px; margin-bottom: 22px; }
.group-n { font: 800 44px/1 var(--display); color: transparent; -webkit-text-stroke: 1.5px var(--muted); }
.group-title h3 { font-size: clamp(22px, 2.4vw, 32px); }
.group-title h3 small { font: 600 13px var(--mono); color: var(--muted); letter-spacing: .04em; margin-left: 8px; vertical-align: middle; }
.group-title p { color: #c8c1d6; margin-top: 8px; max-width: 680px; font-size: 16px; }
.group-arrows { display: flex; gap: 8px; }
.group-arrows[hidden] { display: none; }
.arr { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--line); transition: background .2s, box-shadow .2s; }
.arr svg { width: 20px; height: 20px; stroke: var(--text); stroke-width: 2; fill: none; }
.arr:hover:not(:disabled) { background: var(--text); }
.arr:hover:not(:disabled) svg { stroke: var(--bg); }
.arr:disabled { opacity: .3; cursor: default; }

.rail {
  display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: 2px;
  padding: 4px 2px 14px; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.rail::-webkit-scrollbar { height: 6px; }
.rail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.wk { --h: 420px; flex: none; width: calc(var(--h) * 9 / 16); scroll-snap-align: start; cursor: pointer; outline: none; }
.wk.h { width: calc(var(--h) * 16 / 9 * .75); }  /* горизонталь: та же высота, кадр чуть подрезан по бокам */
.wk-media { position: relative; height: var(--h); border-radius: var(--radius); overflow: hidden; background: var(--bg-2); box-shadow: 0 0 0 1px var(--line); }
.wk-media img, .wk-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1), opacity .4s; }
.wk-media video { opacity: 0; }
.wk.playing .wk-media video { opacity: 1; }
.wk:hover .wk-media img, .wk:hover .wk-media video { transform: scale(1.04); }
.wk:focus-visible .wk-media { box-shadow: 0 0 0 2px var(--real); }
.wk-dur, .wk-badge { position: absolute; z-index: 2; font: 600 11px/1 var(--mono); padding: .6em .75em; border-radius: 6px; }
.wk-dur { right: 10px; bottom: 10px; background: rgba(8,7,11,.75); color: var(--text); }
.wk-badge { left: 10px; top: 10px; background: var(--ai); color: #fff; letter-spacing: .05em; text-transform: uppercase; font-size: 10px; }
.wk-play {
  position: absolute; z-index: 2; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(8,7,11,.55); backdrop-filter: blur(6px);
  opacity: 0; transform: scale(.85); transition: opacity .25s, transform .25s;
}
.wk-play svg { width: 24px; height: 24px; fill: #fff; margin-left: 3px; }
.wk:hover .wk-play, .wk:focus-visible .wk-play { opacity: 1; transform: none; }
.wk-info { padding: 14px 4px 0; }
.wk-tag { font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wk-info h4 { font: 700 18px/1.25 var(--display); letter-spacing: -.01em; margin-top: 6px; }
.wk-info p { font-size: 14px; line-height: 1.45; color: #b2aac3; margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wk-case { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--ai); text-decoration: none; }
.wk-case:hover { text-decoration: underline; }

.works-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: clamp(24px, 3vw, 40px); border-radius: var(--radius);
  background: radial-gradient(120% 140% at 100% 100%, rgba(168,85,247,.22), transparent 60%),
              radial-gradient(90% 120% at 0% 0%, rgba(196,181,253,.18), transparent 60%), var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.works-cta h3 { font-size: clamp(22px, 2.6vw, 34px); }
.works-cta p { color: #c8c1d6; margin-top: 8px; }

@media (max-width: 860px) {
  .wk { --h: 340px; }
  .group-head { grid-template-columns: auto 1fr; }
  .group-arrows { display: none; }
  .group-n { font-size: 34px; }
  .rail { margin: 0 calc(var(--gut) * -1); padding-left: var(--gut); padding-right: var(--gut); scroll-padding-left: var(--gut); }
}
@media (max-width: 560px) {
  .wk { --h: 300px; }
  .cats { margin-bottom: 36px; }
  .cat { font-size: 14px; }
  .wk-info h4 { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .group { opacity: 1; transform: none; } }

/* Шов на видео (hero-nmp.mp4 «бок о бок», режется на canvas) */
.seam video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.seam canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* фиолетовая подсветка фона страницы */
body { background: radial-gradient(1200px 700px at 85% -10%, rgba(168,85,247,.16), transparent 60%),
                   radial-gradient(900px 600px at -10% 30%, rgba(196,181,253,.06), transparent 60%), var(--bg); background-attachment: fixed; }
