/* ============================================================
   CASE TEMPLATE — «Журнал» (2026-11)
   Standard layout for new case studies: editorial hero + sticky
   chapter rail + chapters, each with its own scroll interaction.
   Loaded after style.css; relies on its tokens (--accent, --hl…).
   ============================================================ */

.page-case main { position: relative; z-index: 1; background: var(--bg); }

/* ---------- Hero ---------- */
.ch-hero {
  position: relative;
  min-height: 100dvh;
  padding: 132px 32px 72px;
  display: flex;
  align-items: center;
  overflow: clip;
}
.ch-hero__inner {
  position: relative;
  z-index: 2;
  width: min(var(--content-max), 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}
.ch-hero__title {
  margin: 26px 0 0;
  font-size: clamp(2.5rem, 5.4vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.018em;
  font-weight: 600;
  max-width: 15ch;
}
.ch-hero__title .text-hl {
  white-space: normal;
  padding: 0;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--hl);
}
.ch-hero__title .text-hl::before { display: none; }
/* Brand yellow as one flat colour: a gradient clipped to text restarts on
   every wrapped line, so two-line marks came out in two shades. */
.chapter--dark .title-mark {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--hl);
}
.ch-hero__lede {
  margin: 28px 0 0;
  max-width: 52ch;
  font-size: clamp(1.0625rem, 1.25vw, 1.1875rem);
  line-height: 1.6;
  color: var(--fg);
}
.ch-meta {
  margin: 36px 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, auto));
  gap: 14px 32px;
  justify-content: start;
}
.ch-meta__item dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.ch-meta__item dd { margin: 8px 0 0; font-size: 0.9375rem; font-weight: 500; }
.ch-meta__logo { height: 18px; width: auto; margin-top: 2px; }

/* Reel wall: three columns of real vertical videos drifting at
   different speeds — the "feed" of what the factory produces. */
.reel-wall {
  position: relative;
  height: min(78vh, 720px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 86%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 86%, transparent 100%);
}
.reel-wall__col { overflow: hidden; }
.reel-wall__track {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: reel-drift var(--dur, 60s) linear infinite;
}
.reel-wall__col:nth-child(2) .reel-wall__track { --dur: 78s; animation-direction: reverse; }
.reel-wall__col:nth-child(3) .reel-wall__track { --dur: 66s; }
@keyframes reel-drift { to { transform: translateY(-50%); } }
.reel {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(160deg, #1a1d3a, #0c0c14);
  border: 1px solid var(--hairline-strong);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
}
.reel video, .reel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel__tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(8, 8, 12, 0.72);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Metric strip ---------- */
.ch-stats {
  width: min(var(--content-max), calc(100% - 64px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--hairline-strong);
  border-bottom: 1px solid var(--hairline-strong);
}
.ch-stat { padding: 28px 24px 30px; }
.ch-stat + .ch-stat { border-left: 1px solid var(--hairline); }
.ch-stat__num {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--hl);
  font-variant-numeric: tabular-nums;
}
.ch-stat__label { margin-top: 12px; font-size: 0.9375rem; line-height: 1.45; color: var(--fg-soft); max-width: 24ch; }

/* ---------- Body: sticky rail + chapters ---------- */
.ch-body {
  width: min(var(--content-max), calc(100% - 64px));
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 72px;
}
.ch-rail { position: relative; }
.ch-rail { padding-top: 110px; }
.ch-rail__inner { position: sticky; top: 120px; z-index: 5; }
.ch-rail__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.ch-rail__list { margin-top: 18px; position: relative; padding-left: 18px; }
.ch-rail__list::before,
.ch-rail__progress {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  border-radius: 2px;
  background: var(--hairline-strong);
}
.ch-rail__progress {
  background: var(--hl);
  transform-origin: top;
  transform: scaleY(var(--p, 0));
  box-shadow: 0 0 12px var(--hl-glow);
}
.ch-rail__list a {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--fg-mute);
  transition: color 200ms ease;
}
.ch-rail__list a span { font-family: var(--font-mono); font-size: 11px; padding-top: 2px; color: var(--fg-mute); }
.ch-rail__list a.is-active,
.ch-rail__list a.is-active span { color: var(--fg); }
@media (hover: hover) and (pointer: fine) {
  .ch-rail__list a:hover { color: var(--fg); }
}
.ch-rail__cta { margin-top: 28px; }

.chapter { position: relative; isolation: isolate; padding: 110px 0 120px; scroll-margin-top: 40px; }
.chapter__num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-soft);
}
.chapter__title {
  margin: 14px 0 0;
  font-size: var(--h2-size);
  line-height: var(--h2-line);
  letter-spacing: -0.01em;
  font-weight: 600;
  max-width: 20ch;
}
.chapter__lede {
  margin: 22px 0 0;
  max-width: 62ch;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--fg);
}
.chapter p { max-width: 62ch; line-height: 1.65; }
.chapter h3 {
  margin: 56px 0 0;
  font-size: clamp(1.375rem, 2vw, 1.75rem);
  line-height: 1.25;
  letter-spacing: -0.005em;
  font-weight: 600;
}
.chapter h3 + p { margin-top: 14px; }

.ch-cards { margin-top: 40px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ch-card {
  padding: 24px 22px 26px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--hairline);
}
.ch-card__num { font-size: 2.25rem; line-height: 1; font-weight: 600; letter-spacing: -0.015em; color: var(--hl); }
.ch-card__text { margin-top: 12px; font-size: 0.9375rem; line-height: 1.5; color: var(--fg-soft); }

/* ---------- 02 · Orchestrator: pinned scroll-drawn diagram ---------- */
.orch { position: relative; height: 220vh; margin-top: 40px; }
.orch__stage {
  position: sticky;
  top: 90px;
  height: calc(100vh - 120px);
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 32px;
  align-items: center;
}
.orch__steps { display: grid; gap: 10px; }
.orch__step {
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 300ms ease, background 300ms ease;
}
.orch__step b { display: block; font-size: 1rem; font-weight: 600; }
.orch__step span { display: block; margin-top: 6px; font-size: 0.875rem; line-height: 1.5; color: var(--fg-mute); }
.orch__step.is-on { border-color: rgba(91, 108, 255, 0.45); background: rgba(91, 108, 255, 0.08); }
.orch__step.is-on span { color: var(--fg-soft); }
.orch__map { position: relative; width: 100%; aspect-ratio: 1.15; }
.orch__map svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.orch__wire { fill: none; stroke: url(#wire-grad); stroke-width: 1.6; stroke-linecap: round; }
.orch__node {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 9px 13px;
  border-radius: 12px;
  background: #11131f;
  border: 1px solid var(--hairline-strong);
  font-size: 0.8125rem;
  line-height: 1.25;
  white-space: nowrap;
  color: var(--fg-mute);
  transition: color 260ms ease, border-color 260ms ease, box-shadow 260ms ease;
}
.orch__node.is-on { color: var(--fg); border-color: rgba(140, 152, 255, 0.6); box-shadow: 0 0 0 4px rgba(91, 108, 255, 0.12); }
.orch__node--hub {
  padding: 18px 22px;
  border-radius: 20px;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg);
  background: linear-gradient(180deg, rgba(140, 152, 255, 0.25), rgba(42, 58, 255, 0.18));
  border-color: rgba(140, 152, 255, 0.55);
  box-shadow: 0 20px 60px -20px var(--accent-glow);
}
.orch__node--hub small { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-soft); font-weight: 400; }
.orch__node--in { white-space: normal; width: 170px; color: var(--fg); }
.orch__node--in i { display: block; font-style: normal; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-mute); margin-bottom: 4px; }
.orch__pulse {
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--hl);
  box-shadow: 0 0 14px var(--hl);
  opacity: 0;
}

/* ---------- 03 · Video: phone wipe (raw → final) ---------- */
.wipe { position: relative; height: 200vh; margin-top: 48px; }
.wipe__stage {
  position: sticky;
  top: 90px;
  height: calc(100vh - 120px);
  min-height: 560px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.phone {
  position: relative;
  width: min(300px, 34vh);
  border-radius: 40px;
  padding: 10px;
  background: linear-gradient(160deg, #2a2d40, #0d0e16);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.phone__screen { position: relative; width: 100%; aspect-ratio: 9 / 16; border-radius: 31px; overflow: hidden; background: #000; touch-action: pan-x; cursor: ns-resize; }
.phone__screen > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.phone__final { clip-path: inset(var(--wipe, 100%) 0 0 0); }
.phone__line {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--wipe, 100%);
  height: 2px;
  background: var(--hl);
  box-shadow: 0 0 16px var(--hl);
}
.phone__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(8, 8, 12, 0.75);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.wipe__copy .ch-compare { margin-top: 28px; }
.ch-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 520px; }
.ch-compare > div { padding: 18px 20px; border-radius: 16px; border: 1px solid var(--hairline); }
.ch-compare dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-mute); }
.ch-compare dd { margin: 8px 0 0; font-size: 1.75rem; font-weight: 600; letter-spacing: -0.01em; }
.ch-compare > div:last-child dd { color: var(--hl); }

.reel-row { margin-top: 32px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.reel-row figure { margin: 0; }
.reel-row figcaption { margin-top: 12px; font-size: 0.875rem; line-height: 1.45; color: var(--fg-soft); }
.reel-row figcaption b { display: block; color: var(--fg); font-weight: 600; font-size: 0.9375rem; margin-bottom: 4px; }

/* ---------- 04 · Before / after drag slider ---------- */
.ba {
  position: relative;
  margin-top: 40px;
  width: min(100%, 560px, calc(76vh * 0.8));
  aspect-ratio: 4 / 5;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--hairline-strong);
  touch-action: pan-y;
  cursor: ew-resize;
  user-select: none;
  --x: 50%;
}
.ba > img, .ba > .ba__ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba__after { clip-path: inset(0 0 0 var(--x)); }
.ba__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--x);
  width: 2px;
  background: var(--hl);
  box-shadow: 0 0 16px var(--hl);
}
.ba__handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: var(--hl) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%2314172b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 5l-4 5 4 5M13 5l4 5-4 5'/%3E%3C/svg%3E") center / 20px no-repeat;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.ba__label {
  position: absolute;
  top: 16px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(8, 8, 12, 0.75);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ba__label--l { left: 16px; }
.ba__label--r { right: 16px; }

/* Horizontal carousel strip driven by vertical scroll */
.hstrip { position: relative; height: 220vh; margin-top: 64px; }
.hstrip__stage { position: sticky; top: 90px; height: calc(100vh - 120px); display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.hstrip__track { display: flex; gap: 16px; transform: translate3d(var(--tx, 0), 0, 0); }
.hstrip__item { flex: 0 0 auto; width: min(320px, 62vw); aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; border: 1px solid var(--hairline-strong); background: linear-gradient(160deg, #1a1d3a, #0c0c14); }
.hstrip__item img { width: 100%; height: 100%; object-fit: cover; }
.hstrip__head { margin-bottom: 28px; }

/* ---------- 05 · Print: sheets landing on a desk ---------- */
.desk { position: relative; height: 130vh; margin-top: 24px; }
.desk__stage { position: sticky; top: 90px; height: calc(100vh - 120px); min-height: 520px; display: grid; place-items: center; overflow: clip; }
.sheet {
  position: absolute;
  width: min(300px, 40vw);
  aspect-ratio: 1 / 1.414;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(160deg, #f4f5f8, #d9dbe6);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.85);
  transform: translate3d(var(--sx, 0), var(--sy, 120vh), 0) rotate(var(--sr, 0deg));
}
.sheet img { width: 100%; height: 100%; object-fit: cover; }
.sheet--a3 { width: min(460px, 52vw); aspect-ratio: 1.414 / 1; }
.sheet--a5 { width: min(220px, 30vw); }
.desk__specs { position: absolute; right: 0; bottom: 6%; display: grid; gap: 8px; text-align: right; }
.desk__specs span { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-soft); }

/* ---------- 06 · Calendar that fills itself ---------- */
.cal { margin-top: 40px; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px; }
.cal__day { display: grid; gap: 6px; }
.cal__date { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--fg-mute); text-align: center; margin-bottom: 4px; }
.cal__slot {
  height: 34px;
  border-radius: 8px;
  border: 1px dashed var(--hairline-strong);
  position: relative;
  overflow: hidden;
}
.cal__slot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  transform: translateY(105%);
  transition: transform 420ms var(--ease-out);
}
.cal__slot.is-filled { border-style: solid; border-color: transparent; }
.cal__slot.is-filled::after { transform: translateY(0); }
.cal__slot span { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; font-family: var(--font-mono); font-size: 10px; color: #fff; opacity: 0; transition: opacity 300ms ease 150ms; }
.cal__slot.is-filled span { opacity: 1; }
.cal__legend { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 0.875rem; color: var(--fg-soft); }
.cal__legend b { color: var(--hl); font-weight: 600; }

.bot-chat { margin-top: 40px; max-width: 420px; display: grid; gap: 10px; }
.bot-msg { padding: 12px 16px; border-radius: 18px 18px 18px 6px; background: #161a2e; border: 1px solid var(--hairline); font-size: 0.9375rem; line-height: 1.45; justify-self: start; max-width: 90%; }
.bot-msg--me { border-radius: 18px 18px 6px 18px; background: linear-gradient(180deg, var(--accent), var(--accent-deep)); border-color: transparent; justify-self: end; }
.bot-msg small { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-mute); }

/* ---------- 07 · Result + quote + stack ---------- */
.ch-quote {
  margin: 56px 0 0;
  padding: 36px 36px 32px;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(91, 108, 255, 0.14), rgba(91, 108, 255, 0.03));
  border: 1px solid rgba(140, 152, 255, 0.28);
  max-width: 820px;
}
.ch-quote blockquote { margin: 0; font-size: clamp(1.25rem, 2vw, 1.625rem); line-height: 1.4; letter-spacing: -0.005em; font-weight: 500; }
.ch-quote figcaption { margin-top: 18px; font-size: 0.9375rem; color: var(--fg-soft); }
.ch-stack { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 8px; }
.ch-stack span { padding: 8px 13px; border-radius: 999px; border: 1px solid var(--hairline-strong); background: rgba(255, 255, 255, 0.03); font-size: 0.875rem; }

/* ---------- Media placeholder (before real assets land) ---------- */
.ph { display: grid; place-items: center; width: 100%; height: 100%; background: linear-gradient(160deg, #1d2140, #0c0c14); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-mute); text-align: center; padding: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .ch-body { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ch-rail { display: none; }
}
@media (max-width: 900px) {
  .ch-hero { padding: 112px 16px 48px; min-height: auto; }
  .ch-hero__inner { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .reel-wall { height: 420px; }
  .ch-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-stats { width: calc(100% - 32px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-stat:nth-child(3) { border-left: 0; }
  .ch-stat:nth-child(n + 3) { border-top: 1px solid var(--hairline); }
  .ch-body { width: calc(100% - 32px); padding-top: 80px; }
  .chapter { padding: 80px 0 88px; }
  .ch-cards { grid-template-columns: minmax(0, 1fr); }
  .orch { height: auto; }
  .orch__stage { position: relative; top: 0; height: auto; min-height: 0; grid-template-columns: minmax(0, 1fr); }
  .orch__map { aspect-ratio: auto; height: 760px; max-width: 420px; margin: 0 auto; }
  .wipe { height: 170vh; }
  .wipe__stage { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 24px; align-content: center; }
  .wipe__copy { display: none; }
  .reel-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .desk__specs { position: static; margin-top: 16px; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .reel-wall__track { animation: none; }
  .orch, .wipe, .hstrip, .desk { height: auto; }
  .orch__stage, .wipe__stage, .hstrip__stage, .desk__stage { position: relative; top: 0; height: auto; }
  .phone__final { clip-path: none; }
  .phone__line { display: none; }
  .hstrip__track { flex-wrap: wrap; transform: none; }
  .sheet { position: relative; transform: none; }
  .cal__slot::after { transition: none; }
}

/* ============================================================
   Chapter themes: full-bleed backgrounds, light islands,
   indigo orbs and generated line art (2026-11-01 feedback:
   «не сплошной черный», блоки разделяем цветом).
   --bleed-l / --bleed-w are set by case.js from the article
   column's position, so the ::before spans the whole viewport.
   ============================================================ */
.chapter::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(-1 * var(--bleed-l, 0px));
  width: var(--bleed-w, 100vw);
  z-index: -1;
  pointer-events: none;
}
.chapter--dark::before {
  background:
    radial-gradient(42% 36% at 88% 22%, rgba(91, 108, 255, 0.22), transparent 70%),
    radial-gradient(38% 34% at 6% 82%, rgba(140, 152, 255, 0.12), transparent 70%),
    var(--bg);
}
.chapter--orbit::before {
  background:
    radial-gradient(40% 40% at 10% 85%, rgba(91, 108, 255, 0.16), transparent 70%),
    url("/assets/cases/ai-content-factory/lines-orbit.svg") right center / cover no-repeat,
    var(--bg);
}
.chapter--flow::before {
  background:
    linear-gradient(180deg, var(--bg) 0%, rgba(8, 8, 12, 0.35) 30%, rgba(8, 8, 12, 0.35) 70%, var(--bg) 100%),
    radial-gradient(40% 30% at 85% 15%, rgba(91, 108, 255, 0.2), transparent 70%),
    url("/assets/cases/ai-content-factory/lines-flow.svg") center bottom / cover no-repeat,
    var(--bg);
}
.chapter--flip::before { transform: scaleX(-1); }
.chapter--glow::before {
  background:
    radial-gradient(34% 40% at 55% 58%, rgba(91, 108, 255, 0.3), transparent 72%),
    radial-gradient(30% 30% at 90% 10%, rgba(255, 210, 77, 0.06), transparent 70%),
    var(--bg);
}

/* Light island */
.chapter--light { color: #14172b; }
.chapter--light::before {
  background:
    radial-gradient(40% 36% at 92% 8%, rgba(91, 108, 255, 0.14), transparent 70%),
    radial-gradient(36% 30% at 0% 100%, rgba(91, 108, 255, 0.1), transparent 70%),
    #f4f5f8;
}
.chapter--light .chapter__num { color: var(--accent-deep); }
.chapter--light .chapter__lede,
.chapter--light p { color: #14172b; }
.chapter--light .title-mark {
  background: var(--mark-yellow);
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: inherit;
  filter: none;
  padding: 0 0.06em;
}
.chapter--light .ch-card { background: #fff; border-color: rgba(20, 23, 43, 0.08); box-shadow: 0 18px 40px -28px rgba(20, 23, 43, 0.35); }
.chapter--light .ch-card__text { color: #14172b; }
.chapter--light .ch-card__num { color: var(--accent-deep); }
.chapter--light .orch__step { background: #fff; border-color: rgba(20, 23, 43, 0.08); }
.chapter--light .orch__step span { color: rgba(20, 23, 43, 0.72); }
.chapter--light .orch__step.is-on { border-color: rgba(91, 108, 255, 0.5); background: #eef0ff; }
.chapter--light .orch__step.is-on span { color: #14172b; }
.chapter--light .orch__node { background: #fff; color: rgba(20, 23, 43, 0.6); border-color: rgba(20, 23, 43, 0.12); }
.chapter--light .orch__node.is-on { color: #14172b; border-color: rgba(91, 108, 255, 0.6); box-shadow: 0 0 0 4px rgba(91, 108, 255, 0.12); }
.chapter--light .orch__node--in i { color: rgba(20, 23, 43, 0.6); }
.chapter--light .orch__node--hub { color: #fff; background: linear-gradient(180deg, var(--accent-soft), var(--accent) 55%, var(--accent-deep)); border-color: transparent; }
.chapter--light .orch__node--hub small { color: rgba(255, 255, 255, 0.85); }
.chapter--light .ba { border-color: rgba(20, 23, 43, 0.1); box-shadow: 0 30px 60px -30px rgba(20, 23, 43, 0.45); }
.chapter--light .hstrip__item { border-color: rgba(20, 23, 43, 0.08); box-shadow: 0 24px 48px -28px rgba(20, 23, 43, 0.45); background: #fff; }
.chapter--light .cal__date { color: rgba(20, 23, 43, 0.6); }
.chapter--light .cal__slot { border-color: rgba(20, 23, 43, 0.18); }
.chapter--light .cal__legend { color: #14172b; }
.chapter--light .cal__legend b { color: var(--accent-deep); }
.chapter--light .bot-msg { background: #fff; border-color: rgba(20, 23, 43, 0.1); color: #14172b; }
.chapter--light .bot-msg small { color: rgba(20, 23, 43, 0.55); }
.chapter--light .bot-msg--me { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); color: #fff; }
.chapter--light .bot-msg--me small { color: rgba(255, 255, 255, 0.75); }

/* Rail over light chapters: each line switches on its own (case.js) */
.ch-rail__label.is-light,
.ch-rail__list a.is-light,
.ch-rail__list a.is-light span { color: rgba(20, 23, 43, 0.6); }
.ch-rail__list a.is-light.is-active,
.ch-rail__list a.is-light.is-active span { color: #14172b; }
.ch-rail__list::before { background: rgba(128, 132, 160, 0.35); }
.ch-rail__cta.is-light { color: #14172b; background: rgba(20, 23, 43, 0.04); border-color: rgba(20, 23, 43, 0.16); }
.ch-rail__label, .ch-rail__list a, .ch-rail__list::before { transition: color 240ms ease, background 240ms ease; }

/* Facts grid in the founder-video chapter */
.ch-compare--facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ch-compare--facts dd { color: var(--hl); font-size: 1.5rem; }
.wipe__note { margin-top: 16px; font-size: 0.9375rem; color: var(--fg-soft); max-width: 52ch; }

/* A clear breath between the carousel and the ads that follow it */
.hstrip__item--break { margin-left: 48px; }
.ba__label { color: #fff; }
/* Pin the diagram right under the chapter intro instead of mid-screen */
.orch__stage { align-items: start; padding-top: 8px; }

/* Wipe knob: the divider can be grabbed and pulled up or down */
.phone__knob {
  position: absolute;
  left: 50%;
  top: var(--wipe, 100%);
  z-index: 3;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: var(--hl) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%2314172b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 7l5-4 5 4M5 13l5 4 5-4'/%3E%3C/svg%3E") center / 20px no-repeat;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.phone__badge { z-index: 4; }
.ch-rail__cta { white-space: nowrap; padding-right: 22px; }
.wipe__stage { align-items: start; padding-top: 8px; }
@media (max-width: 900px) { .wipe__stage { align-content: start; } }

/* ---------- 02 · Numbered steps on a connector line ---------- */
.orch__steps { list-style: none; margin: 0; padding: 0; position: relative; gap: 12px; }
.orch__steps::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 30px;
  bottom: 30px;
  width: 2px;
  border-radius: 2px;
  background: rgba(20, 23, 43, 0.12);
}
.chapter--light .orch__step,
.orch__step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.orch__step > div {
  padding: 16px 20px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(20, 23, 43, 0.08);
  box-shadow: 0 14px 30px -24px rgba(20, 23, 43, 0.4);
  transition: border-color 260ms ease, background 260ms ease;
}
.orch__step-n {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-deep);
  background: #fff;
  border: 1px solid rgba(20, 23, 43, 0.12);
  transition: background 260ms ease, color 260ms ease, box-shadow 260ms ease;
}
.chapter--light .orch__step.is-on { background: none; }
.orch__step.is-on .orch__step-n {
  color: #fff;
  border: 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  box-shadow: 0 8px 20px -6px var(--accent-glow);
}
.orch__step.is-on > div { border-color: rgba(91, 108, 255, 0.5); background: #eef0ff; }

/* ---------- 07 · Monthly capacity infographic ---------- */
.cap {
  margin-top: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.cap__total {
  grid-row: span 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  border-radius: 24px;
  background:
    radial-gradient(80% 60% at 20% 10%, rgba(140, 152, 255, 0.28), transparent 70%),
    linear-gradient(160deg, rgba(91, 108, 255, 0.22), rgba(42, 58, 255, 0.06));
  border: 1px solid rgba(140, 152, 255, 0.35);
}
.cap__total-num {
  font-size: clamp(4.5rem, 9vw, 8rem);
  line-height: 0.9;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--hl);
  font-variant-numeric: tabular-nums;
}
.cap__total-label { margin-top: 18px; font-size: 1.125rem; line-height: 1.45; max-width: 22ch; }
.cap__tile {
  position: relative;
  overflow: hidden;
  padding: 22px 22px 26px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--hairline);
}
.cap__tile:last-child { grid-column: span 2; }
.cap__num { font-size: 1.0625rem; font-weight: 500; }
.cap__num b {
  display: block;
  margin-bottom: 6px;
  font-size: clamp(2.5rem, 4vw, 3.25rem);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--hl);
  font-variant-numeric: tabular-nums;
}
.cap__desc { margin-top: 6px; font-size: 0.875rem; line-height: 1.45; color: var(--fg-mute); }
.cap__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  transition: width 1200ms var(--ease-out);
}
.cap.is-on .cap__bar { width: var(--len); }
@media (max-width: 900px) {
  .cap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cap__total { grid-column: span 2; grid-row: auto; padding: 26px; }
}
@media (prefers-reduced-motion: reduce) { .cap__bar { transition: none; width: var(--len); } }
/* text-fit.js wraps compounds in span[data-nw]; keep those inline inside step copy */
.orch__step span[data-nw] { display: inline; margin: 0; color: inherit; }

/* ---------- 05 · Heading pinned together with the desk ---------- */
.desk { height: 190vh; margin-top: 0; }
.desk__stage {
  display: flex;
  flex-direction: column;
  place-items: stretch;
  height: calc(100vh - 100px);
  min-height: 600px;
}
.desk__head { flex: none; }
.desk__table { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; }
.desk__table .sheet--a3 { width: min(420px, 46vw); }
.desk__table .sheet--a5 { width: min(190px, 26vw); }
@media (max-width: 900px) {
  .desk__stage { height: calc(100vh - 90px); min-height: 560px; }
  .desk__table .sheet--a3 { width: 58vw; }
  .desk__table .sheet--a5 { width: 30vw; }
}
.ch-stack__title { margin: 64px 0 0; }
.ch-stack__title + .ch-stack { margin-top: 18px; }

/* ============================================================
   Short desktop windows (13" laptops, 1366×768, OS scaling):
   size the hero and pinned stages by viewport HEIGHT so the
   first screen and every pinned scene fit without cropping.
   ============================================================ */
@media (min-width: 901px) and (max-height: 900px) {
  .ch-hero { padding: 104px 32px 36px; }
  .ch-hero__title { margin-top: 18px; font-size: clamp(2.25rem, 7.4vh, 4.75rem); }
  .ch-hero__lede { margin-top: 18px; font-size: clamp(0.9375rem, 2.05vh, 1.1875rem); line-height: 1.55; }
  .ch-meta { margin-top: 22px; }
  .ch-meta__item dd { font-size: clamp(0.8125rem, 1.8vh, 0.9375rem); }
  .reel-wall { height: min(76vh, 720px); }
}
@media (min-width: 901px) {
  .orch__map { max-height: calc(100vh - 150px); width: min(100%, calc((100vh - 150px) * 1.15)); justify-self: end; }
  .phone { width: min(300px, 34vh, calc((100vh - 170px) * 0.5)); }
  .hstrip__item { width: min(320px, 62vw, calc((100vh - 360px) * 0.8)); }
  .desk__table .sheet--a3 { width: min(420px, 46vw, calc((100vh - 380px) * 1.25)); }
  .desk__table .sheet--a5 { width: min(190px, 26vw, calc((100vh - 380px) * 0.55)); }
}
@media (min-width: 901px) and (max-height: 720px) {
  .orch__step > div { padding: 11px 16px; }
  .orch__step b { font-size: 0.9375rem; }
  .orch__step span { font-size: 0.8125rem; line-height: 1.4; margin-top: 3px; }
  .wipe__copy h3 { margin-top: 0; font-size: 1.25rem; }
  .wipe__copy p { font-size: 0.875rem; line-height: 1.5; }
  .ch-compare { gap: 8px; }
  .ch-compare > div { padding: 10px 14px; }
  .ch-compare dd { font-size: 1.125rem; margin-top: 4px; }
  .wipe__note { display: none; }
  .hstrip__head { margin-bottom: 16px; }
  .hstrip__head p { font-size: 0.875rem; }
  .desk__head .chapter__title { font-size: clamp(1.75rem, 5.5vh, 2.5rem); }
  .desk__head .chapter__lede { font-size: 0.9375rem; margin-top: 12px; }
}
@media (min-width: 901px) and (max-height: 620px) {
  .ch-hero { padding-top: 92px; padding-bottom: 24px; }
  .ch-hero__title { font-size: clamp(2rem, 6.8vh, 4rem); margin-top: 14px; }
  .ch-hero__lede { margin-top: 14px; font-size: 0.875rem; }
  .ch-meta { margin-top: 16px; }
  .orch__map { max-height: calc(100vh - 175px); width: min(100%, calc((100vh - 175px) * 1.15)); }
  .orch__steps { gap: 8px; }
}
@media (min-width: 901px) and (max-height: 620px) {
  .orch__node { padding: 6px 10px; font-size: 0.75rem; }
  .orch__node--hub { padding: 12px 16px; font-size: 0.875rem; }
}
@media (min-width: 901px) and (max-height: 620px) {
  .orch__step > div { padding: 8px 14px; }
  .orch__steps { gap: 6px; }
  .orch__step-n { width: 38px; height: 38px; }
  .orch__step { grid-template-columns: 38px minmax(0, 1fr); }
  .orch__steps::before { left: 18px; }
}
@media (max-width: 900px) {
  .hstrip__item { width: min(320px, 62vw, calc((100vh - 400px) * 0.8)); }
}
@media (max-width: 900px) and (max-height: 700px) {
  .hstrip__head { margin-bottom: 14px; }
  .hstrip__head p { font-size: 0.875rem; line-height: 1.5; }
}
@media (min-width: 901px) and (max-height: 800px) {
  .ch-hero__title { font-size: clamp(2.25rem, 6.6vh, 4.75rem); }
}
