/* =========================================================================
   Кейс: аренда коммерческой недвижимости
   (/kejsy/arenda-kommercheskoj-nedvizhimosti/)
   Первый экран с лестницей позиций двух запросов, коротко о проекте, задача
   и старт, что сделал, результат (график по реальным датам, переключатель
   замеров, сетка из 350 запросов), сроки и услуга.
   Всё видно без JS в конечном состоянии (анимация — assets/js/scenes/cases.js).
   ========================================================================= */

/* ---------- первый экран ---------- */
.ar-hero { min-height: min(96svh, 900px); }
.ar-h1 { font-size: clamp(1.7rem, 1.1rem + 2vw, 2.9rem); }
.ar-stage { display: grid; place-items: center; min-height: 0; }
.lad { margin: 0 0 0 auto; width: 100%; max-width: 480px; padding: clamp(14px, 2vw, 24px); border-radius: var(--radius-lg); background: linear-gradient(160deg, rgba(24, 38, 74, 0.72), rgba(17, 28, 51, 0.9)); border: 1px solid var(--line); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.6); }
.lad-svg { width: 100%; height: auto; overflow: visible; }
.lad-svg text { font-family: var(--font-text); }
.lad-top { fill: rgba(255, 176, 32, 0.12); stroke: rgba(255, 176, 32, 0.5); stroke-width: 1.2; stroke-dasharray: 4 4; }
.lad-top-t { font-family: var(--font-display) !important; font-size: 14px; font-weight: 600; fill: var(--signal); }
.lad-axis line { stroke: var(--night-line); stroke-width: 1; }
.lad-axis text { font-size: 13px; fill: var(--fog-dim); }
.lad-trail { stroke: url(#ladTrail); stroke-width: 4; stroke-linecap: round; }
.lad-ghost circle { fill: var(--night-2); stroke: var(--fog-dim); stroke-width: 1.5; stroke-dasharray: 3 3; }
.lad-ghost text { font-size: 12px; font-weight: 600; fill: var(--fog); }
.lad-mk circle { fill: var(--signal); stroke: var(--night); stroke-width: 4; }
.lad-mk text { font-family: var(--font-display) !important; font-size: 16px; font-weight: 700; fill: var(--ink); }
.lad-q { font-size: 13px; font-weight: 600; fill: #eef2fb; }
.lad figcaption { margin-top: 10px; color: var(--fog-dim); font-size: 0.85rem; line-height: 1.4; }

/* ---------- коротко о проекте ---------- */
.ar-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0; border-radius: var(--radius-lg); overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.ar-facts div { display: grid; gap: 4px; padding: 20px 22px; background: var(--surface); }
.ar-facts dt { color: var(--fg-dim); font-size: 0.85rem; }
.ar-facts dd { margin: 0; font-weight: 650; font-size: var(--step-1); line-height: 1.3; }

/* ---------- задача и старт ---------- */
.ar-start-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.ar-start .section-head { margin-bottom: 28px; }
.ar-was { list-style: none; display: grid; gap: 0; border-top: 1px solid var(--line); }
.ar-was li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 18px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--line); }
.ar-was .num { font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.6rem); color: var(--signal); }
.ar-was span:last-child { color: var(--fg-soft); }
.ar-was-note { margin: 18px 0 0; color: var(--fg-soft); }
.ar-serp { display: grid; gap: 12px; padding: clamp(18px, 2.6vw, 26px); border-radius: var(--radius-lg); background: #fff; color: var(--ink); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.7); }
.ar-serp-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 999px; border: 1.5px solid var(--paper-line); font-weight: 600; }
.ar-serp-bar svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-soft); stroke-width: 2; stroke-linecap: round; }
.ar-serp-list { list-style: none; display: grid; gap: 8px; }
.ar-serp-list li { display: grid; gap: 2px; padding: 12px 16px; border-radius: 14px; background: var(--paper); }
.ar-serp-list b { font-weight: 600; }
.ar-serp-list small { color: var(--ink-soft); font-size: 0.82rem; }
.ar-serp-list .is-agg b { color: var(--flow-ink); }
.ar-serp-list .is-gap { padding: 0 16px; background: none; color: var(--ink-soft); }
.ar-serp-list .is-you { background: #fff5f3; box-shadow: inset 0 0 0 1.5px #ffb3a8; }
.ar-serp-list .is-you small { color: #b3271a; font-weight: 600; }
.ar-serp-note { margin: 0; color: var(--ink-soft); font-size: 0.8rem; }

/* ---------- что сделал ---------- */
.ar-steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ar-steps li { position: relative; display: grid; gap: 12px; align-content: start; padding: 26px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); }
.ar-step-n { position: absolute; right: 22px; top: 18px; font-family: var(--font-display); font-weight: 600; font-size: 2.4rem; line-height: 1; color: var(--paper-3); }
.ar-steps svg { width: 40px; height: 40px; fill: none; stroke: var(--flow-ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ar-steps h3 { font-size: var(--step-1); font-weight: 650; }
.ar-steps p { margin: 0; color: var(--fg-soft); }
.ar-did-more { max-width: 62rem; margin: 22px 0 0; color: var(--fg-soft); }

/* ---------- результат ---------- */
.ar-board { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(20px, 3vw, 40px); align-items: start; padding: clamp(18px, 3vw, 36px); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.ar-chart svg { width: 100%; height: auto; overflow: visible; }
.ar-chart .grid line { stroke: var(--paper-line); stroke-width: 1; }
.ar-chart .grid text { font-family: var(--font-text); font-size: 12px; fill: var(--fg-dim); }
.ar-chart .val { font-family: var(--font-display); font-size: 15px; font-weight: 600; fill: var(--ink); transition: fill 0.3s; }
.ar-chart .line { fill: none; stroke: var(--flow); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.ar-chart .area { fill: url(#arFill); }
.ar-chart .pt { fill: #fff; stroke: var(--flow); stroke-width: 3; transition: r 0.3s var(--ease-out), fill 0.3s, stroke 0.3s; }
.ar-chart .pt.is-on { fill: var(--signal); stroke: var(--ink); r: 9px; }
.ar-dates { position: relative; height: 54px; margin: 6px 20px 0 40px; margin-left: calc(40 / 600 * 100%); margin-right: calc(20 / 600 * 100%); }
.ar-dates::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--paper-line); }
.ar-dates button { position: absolute; top: 0; left: calc(var(--at) * 1%); transform: translateX(-50%); display: grid; justify-items: center; gap: 0; min-width: 52px; padding: 10px 6px 4px; border: 0; border-radius: 10px; background: none; color: var(--fg-soft); font-size: 0.8rem; line-height: 1.25; cursor: pointer; }
.ar-dates button::before { content: ""; position: absolute; left: 50%; top: -5px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #fff; border: 2px solid var(--flow); }
.ar-dates button b { font-weight: 650; color: var(--fg); font-variant-numeric: tabular-nums; }
.ar-dates button span { font-variant-numeric: tabular-nums; }
.ar-dates button:hover { background: var(--paper); }
.ar-dates button[aria-pressed="true"]::before { background: var(--signal); border-color: var(--ink); }
.ar-dates button[aria-pressed="true"] b { color: var(--flow-ink); }
.ar-dates button:nth-child(1) { transform: translateX(-30%); }
.ar-dates button:nth-child(4) { transform: translateX(-62%); }
.ar-dates button:nth-child(5) { transform: translateX(-38%); }
.ar-dates-hint { margin: 10px 0 0; color: var(--fg-dim); font-size: 0.85rem; }
.ar-cells-box { display: grid; gap: 14px; }
.ar-sel { display: grid; gap: 2px; margin: 0; }
.ar-sel b { font-weight: 650; }
.ar-sel > span { color: var(--fg-soft); }
.ar-cells { display: grid; grid-template-columns: repeat(25, minmax(0, 1fr)); gap: 3px; }
.ar-cells i { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--paper-3); transition: background-color 0.35s, transform 0.35s var(--ease-out); }
.ar-cells i.on { background: var(--flow); }
.ar-cells i.on:nth-child(n+1) { transition-delay: calc(var(--d, 0) * 1ms); }
.ar-cells-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; color: var(--fg-soft); font-size: 0.85rem; }
.ar-cells-key i { width: 12px; height: 12px; border-radius: 3px; background: var(--paper-3); margin-left: 10px; }
.ar-cells-key i:first-child { margin-left: 0; }
.ar-cells-key i.on { background: var(--flow); }
.ar-source { margin: 16px 0 0; color: var(--fg-dim); font-size: var(--step--1); max-width: 72ch; }

/* ---------- сроки и услуга ---------- */
.ar-svc-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.ar-time { list-style: none; position: relative; height: 64px; margin: 40px 34px 0 22px; }
.ar-time::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--flow), var(--signal)); }
.ar-time li { position: absolute; top: 0; left: calc(var(--at) * 1%); display: grid; justify-items: center; gap: 2px; padding-top: 22px; transform: translateX(-50%); font-size: 0.82rem; line-height: 1.2; color: var(--fog); white-space: nowrap; }
.ar-time li::before { content: ""; position: absolute; top: 1px; left: 50%; width: 15px; height: 15px; margin-left: -7.5px; border-radius: 50%; background: var(--night); border: 3px solid var(--flow-light); }
.ar-time li:last-child::before { background: var(--signal); border-color: var(--signal); }
.ar-time b { color: #eef2fb; font-weight: 650; }
.ar-time li:nth-child(2) { transform: translateX(-20%); }
.ar-svc-card { display: grid; gap: 14px; padding: clamp(22px, 3vw, 34px); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.ar-svc-k { margin: 0; color: var(--fg-dim); font-size: 0.85rem; }
.ar-svc-card h3 { font-family: var(--font-display); font-size: var(--step-2); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.ar-svc-card p { margin: 0; color: var(--fg-soft); }
.ar-svc-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ar-svc-price .num { font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.4rem); color: var(--signal); }
.ar-svc-card .btn { justify-self: start; }

/* ---------- адаптив ---------- */
@media (max-width: 1080px) {
  .ar-hero { min-height: auto; }
  .ar-start-grid, .ar-svc-grid, .ar-board { grid-template-columns: minmax(0, 1fr); }
  .ar-steps { grid-template-columns: minmax(0, 1fr); }
  .lad { margin: 0 auto; }
  .ar-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ar-facts { grid-template-columns: minmax(0, 1fr); }
  .ar-was li { grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
  /* на телефоне даты замеров идут ровным рядом, шкала по дням есть в блоке «Сроки» */
  .ar-dates { display: flex; gap: 4px; height: auto; margin: 12px 0 0; }
  .ar-dates::before { display: none; }
  .ar-dates button, .ar-dates button:nth-child(n) { position: relative; left: auto; top: auto; flex: 1 1 0; min-width: 0; transform: none; padding: 16px 2px 6px; font-size: 0.75rem; background: var(--paper); }
  .ar-dates button::before { top: 4px; width: 9px; height: 9px; margin-left: -4.5px; }
  .ar-time { margin: 44px 18px 0 10px; }
  .ar-time li { font-size: 0.75rem; }
  .ar-time li span { display: none; }
  .ar-time li:first-child { transform: translateX(-20%); }
  .ar-time li:nth-child(2) { transform: translateX(-30%); }
  .ar-time li:nth-child(4) { top: -34px; padding-top: 0; padding-bottom: 20px; }
  .ar-time li:nth-child(4)::before { top: auto; bottom: -1px; }
  .ar-time li:last-child { transform: translateX(-80%); }
  .ar-cells { gap: 2px; }
  .ar-steps li { padding: 22px; }
}
