/* Кейс — Клиника МКС: styles unique to this case page. Header, menu, cursor and footer come from style.css */
:root {
    --bg: #f3f3f1;
    --fg: #0a0a0a;
    --muted: #6e6e6e;
    --line: rgba(0,0,0,.12);
    --glass: rgba(0,0,0,.03);
    --brand: #154b8b;
    --ice: #edf1f6;
    --graphite: #262626;
    --ease: cubic-bezier(.2,.8,.2,1);
    --gut: clamp(16px, 4vw, 56px);
    --half: clamp(50px, 6vw, 115px);
  }
  :root[data-theme="dark"] {
    --bg: #0a0a0a;
    --fg: #f2f2f0;
    --muted: #7d7d7d;
    --line: rgba(255,255,255,.1);
    --glass: rgba(255,255,255,.03);
  }

  .serif { font-family: "Playfair Display", serif; font-style: italic; font-weight: 400; text-transform: none; letter-spacing: -.02em; }
  .tag { display: inline-flex; gap: 12px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .tag b { color: var(--fg); font-weight: 600; }
  .row { display: block; overflow: hidden; padding: .16em .12em .26em; margin: -.16em -.12em -.26em; }
  .row > span { display: inline-block; transform: translateY(140%); transition: transform 1.2s var(--ease); }
  .in .row > span, .row.in > span { transform: none; }
  .fade { opacity: 0; transform: translateY(30px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
  .fade.in { opacity: 1; transform: none; }
  .h2 { font-family: "Unbounded"; font-weight: 800; font-size: clamp(36px, 6vw, 108px); line-height: .9; letter-spacing: -.05em; text-transform: uppercase; margin-top: 18px; }
  .h2 .serif { color: var(--brand); font-weight: 400; }
  [data-theme="dark"] .h2 .serif { color: #7fa6d6; }
  .sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; margin-bottom: clamp(40px, 6vw, 80px); }
  .sec-head p { max-width: 380px; line-height: 1.55; color: var(--muted); }



  /* device frames around real screenshots (cookie banner cropped off the bottom) */
  .browser { border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 50px 100px -40px rgba(10,30,60,.45); border: 1px solid rgba(0,0,0,.08); }
  .browser-bar { height: 40px; display: flex; align-items: center; gap: 7px; padding: 0 16px; background: #f1f1ef; border-bottom: 1px solid rgba(0,0,0,.06); }
  .browser-bar i { width: 11px; height: 11px; border-radius: 50%; background: #d9d9d6; }
  .browser-bar span { margin: 0 auto; font-size: 12px; color: #777; background: #fff; padding: 5px 40px; border-radius: 8px; }
  .browser > img { width: 100%; aspect-ratio: 1440 / 800; object-fit: cover; object-position: top; transition: transform 1.4s var(--ease); }
  .phone { padding: 8px; border-radius: 40px; background: #111; box-shadow: 0 50px 100px -40px rgba(10,30,60,.6); }
  .phone img { width: 100%; aspect-ratio: 500 / 850; object-fit: cover; object-position: top; border-radius: 32px; }

  /* hero */
  .case-hero { padding: clamp(130px, 16vw, 200px) var(--gut) var(--half); }
  .case-hero h1 { font-family: "Unbounded"; font-weight: 800; font-size: clamp(54px, 10.5vw, 200px); line-height: .88; letter-spacing: -.055em; text-transform: uppercase; margin-top: 24px; }
  .case-hero h1 .serif { font-size: 1.05em; color: var(--brand); }
  [data-theme="dark"] .case-hero h1 .serif { color: #7fa6d6; }
  .hero-lead { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; margin-top: clamp(32px, 4vw, 56px); }
  .hero-lead p { max-width: 560px; font-size: clamp(17px, 1.4vw, 21px); line-height: 1.5; color: var(--muted); }
  .hero-lead p strong { color: var(--fg); font-weight: 600; }
  .visit { display: inline-flex; align-items: center; gap: 14px; padding: 18px 28px; border-radius: 100px; background: var(--fg); color: var(--bg); font-weight: 600; }
  .visit i { font-style: normal; transition: transform .5s var(--ease); }
  .visit:hover i { transform: rotate(-45deg); }
  .hero-shot { position: relative; margin-top: clamp(40px, 5vw, 72px); perspective: 1800px; }
  .hs-browser { transform: rotateX(var(--tilt, 20deg)) scale(var(--sc, .9)); transform-origin: 50% 0; will-change: transform; }
  .hs-phone { position: absolute; right: 5%; bottom: -10%; width: clamp(110px, 16vw, 250px); transform: translateY(var(--py, 80px)); will-change: transform; }
  .meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: clamp(80px, 10vw, 160px); padding-top: 28px; border-top: 1px solid var(--line); }
  .meta small { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
  .meta b { font-weight: 600; font-size: 16px; line-height: 1.45; }

  /* key facts (what was built) */
  .facts { padding: var(--half) var(--gut); }
  .fact-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--fg); border-bottom: 1px solid var(--fg); }
  .fact { position: relative; padding: clamp(28px, 3vw, 48px) clamp(14px, 2vw, 28px); overflow: hidden; isolation: isolate; transition: color .5s var(--ease); }
  .fact + .fact { border-left: 1px solid var(--line); }
  .fact::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--brand); transform: scaleY(0); transform-origin: bottom; transition: transform .6s var(--ease); }
  .fact:hover { color: #fff; }
  .fact:hover::before { transform: scaleY(1); }
  .fact b { display: block; font-family: "Unbounded"; font-weight: 800; font-size: clamp(40px, 5.4vw, 96px); line-height: 1; letter-spacing: -.055em; }
  .fact b em { font-style: normal; color: #ed1c2e; }
  .fact h4 { margin-top: 18px; font-family: "Unbounded"; font-weight: 600; font-size: clamp(15px, 1.2vw, 18px); letter-spacing: -.02em; }
  .fact p { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--muted); transition: color .5s; }
  .fact:hover p { color: rgba(255,255,255,.75); }

  /* challenge / solution */
  .story { padding: var(--half) var(--gut); display: grid; grid-template-columns: 1fr 2fr; gap: clamp(32px, 6vw, 120px); }
  .story-label { position: sticky; top: 14vh; align-self: start; }
  .story-label h3 { font-family: "Unbounded"; font-weight: 800; font-size: clamp(30px, 3.6vw, 60px); letter-spacing: -.045em; text-transform: uppercase; margin-top: 18px; line-height: .95; }
  .story-text p { font-size: clamp(19px, 1.8vw, 28px); line-height: 1.45; letter-spacing: -.01em; }
  .story-text p + p { margin-top: 1em; }
  .story-text p.muted { color: var(--muted); font-size: clamp(16px, 1.3vw, 19px); }
  .points { list-style: none; margin-top: 40px; border-top: 1px solid var(--line); }
  .points li { display: grid; grid-template-columns: 60px 1fr; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); font-size: 17px; line-height: 1.5; }
  .points li span { font-family: "Unbounded"; font-size: 13px; color: var(--muted); padding-top: 4px; }

  /* integrations: patient → site → MIS → CRM → Salebot */
  .flow { padding: var(--half) var(--gut); background: var(--ice); color: var(--graphite); }
  [data-theme="dark"] .flow { background: #0f1620; color: #e6ecf3; }
  .flow .tag, .flow .tag b { color: inherit; }
  .flow .sec-head p { color: inherit; opacity: .7; }
  .flow-line { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; padding-top: 70px; }
  .flow-track { position: absolute; top: 28px; left: 10%; right: 10%; height: 2px; background: rgba(21,75,139,.18); }
  .flow-track i { display: block; height: 100%; background: var(--brand); transform-origin: left; transform: scaleX(var(--p, 0)); }
  .flow-track::after { content: ""; position: absolute; top: 50%; left: calc(var(--p, 0) * 100%); width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #ed1c2e; box-shadow: 0 0 0 6px rgba(237,28,46,.18); opacity: calc(var(--p, 0) * 10); }
  .node { position: relative; text-align: center; }
  .node .dot { position: absolute; top: -56px; left: 50%; width: 30px; height: 30px; margin-left: -15px; border-radius: 50%; border: 2px solid var(--brand); background: var(--ice); transition: background .4s, transform .5s cubic-bezier(.3,1.6,.5,1); }
  [data-theme="dark"] .node .dot { background: #0f1620; }
  .node.on .dot { background: var(--brand); transform: scale(1.15); }
  .node-card { padding: 24px 18px; border-radius: 20px; background: #fff; border: 1px solid rgba(21,75,139,.12); box-shadow: 0 20px 40px -30px rgba(10,30,60,.4); opacity: .45; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
  [data-theme="dark"] .node-card { background: #16202e; border-color: rgba(255,255,255,.08); }
  .node.on .node-card { opacity: 1; transform: none; }
  .node-card small { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .55; }
  .node-card b { display: block; margin-top: 8px; font-family: "Unbounded"; font-weight: 700; font-size: clamp(16px, 1.4vw, 22px); letter-spacing: -.03em; color: var(--brand); }
  [data-theme="dark"] .node-card b { color: #7fa6d6; }
  .node-card p { margin-top: 10px; font-size: 14px; line-height: 1.5; opacity: .75; }
  .booking { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 4vw, 64px); align-items: center; margin-top: clamp(60px, 8vw, 120px); }
  .booking .browser > img { aspect-ratio: auto; }
  .booking h3 { font-family: "Unbounded"; font-weight: 800; font-size: clamp(26px, 3vw, 48px); line-height: 1; letter-spacing: -.045em; text-transform: uppercase; }
  .booking ul { list-style: none; margin-top: 28px; }
  .booking li { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid rgba(21,75,139,.15); font-size: 16px; line-height: 1.5; }
  .booking li::before { content: "✦"; color: #ed1c2e; }

  /* selling structure: sticky long screenshot scrolls to the active section */
  .struct { padding: var(--half) var(--gut); display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(32px, 5vw, 90px); }
  .struct-head { grid-column: 1 / -1; }
  .st-item { min-height: 64vh; display: flex; flex-direction: column; justify-content: center; border-top: 1px solid var(--line); opacity: .25; transition: opacity .6s var(--ease); }
  .st-item.on { opacity: 1; }
  .st-item b { font-family: "Playfair Display"; font-style: italic; font-weight: 400; font-size: clamp(22px, 2vw, 32px); color: var(--brand); }
  [data-theme="dark"] .st-item b { color: #7fa6d6; }
  .st-item h3 { font-family: "Unbounded"; font-weight: 700; font-size: clamp(22px, 2.4vw, 40px); letter-spacing: -.035em; line-height: 1.05; margin: 14px 0 18px; }
  .st-item p { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 480px; }
  .st-frame { position: sticky; top: 13vh; align-self: start; }
  .st-view { position: relative; aspect-ratio: 1440 / 1000; overflow: hidden; background: #fff; }
  .st-view img { position: absolute; left: 0; top: 0; width: 100%; transform: translateY(var(--y, 0%)); transition: transform 1.2s cubic-bezier(.6, 0, .2, 1); }
  .st-badge { position: absolute; left: 18px; bottom: 18px; z-index: 2; padding: 9px 16px; border-radius: 100px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 600; }

  /* key screens */
  .screens { padding: var(--half) var(--gut); }
  .shots { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(28px, 4vw, 64px) clamp(16px, 2vw, 32px); }
  .shot:nth-child(1) { grid-column: 1 / 8; }
  .shot:nth-child(2) { grid-column: 8 / 13; margin-top: 16vh; }
  .shot:nth-child(3) { grid-column: 1 / 6; }
  .shot:nth-child(4) { grid-column: 6 / 13; margin-top: 10vh; }
  .shot:hover .browser > img { transform: scale(1.04); }
  .shot figcaption { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; }
  .shot figcaption b { font-family: "Unbounded"; font-weight: 600; font-size: clamp(15px, 1.3vw, 19px); letter-spacing: -.02em; }
  .shot figcaption span { font-size: 14px; color: var(--muted); text-align: right; max-width: 60%; }
  .phones-head { margin-top: clamp(100px, 12vw, 180px); text-align: center; }
  .phones-head h3 { font-family: "Unbounded"; font-weight: 800; font-size: clamp(28px, 4vw, 64px); letter-spacing: -.045em; text-transform: uppercase; line-height: .95; }
  .phones-head h3 .serif { color: var(--brand); font-weight: 400; }
  .phones { display: flex; justify-content: center; gap: clamp(14px, 2.4vw, 40px); margin-top: clamp(40px, 5vw, 72px); }
  .phones .phone { width: clamp(150px, 16vw, 250px); flex-shrink: 0; will-change: transform; }
  .phones .phone:nth-child(even) { margin-top: 90px; }

  /* design system */
  .ds { padding: var(--half) var(--gut); border-top: 1px solid var(--line); }
  .ds-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(24px, 3vw, 48px); margin-top: clamp(40px, 5vw, 72px); }
  .swatches { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 12px; min-height: 380px; }
  .sw { position: relative; border-radius: 22px; padding: 22px; display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid var(--line); transition: transform .5s var(--ease); text-align: left; }
  .sw:hover { transform: translateY(-8px); }
  .sw b { font-family: "Unbounded"; font-weight: 600; font-size: 15px; }
  .sw span { font-size: 13px; opacity: .7; margin-top: 4px; }
  .sw em { position: absolute; top: 18px; right: 18px; font-style: normal; font-size: 12px; opacity: 0; transition: opacity .3s; }
  .sw.copied em { opacity: 1; }
  .type { display: grid; grid-template-rows: 1fr 1fr; gap: 12px; }
  .type-card { border-radius: 22px; border: 1px solid var(--line); padding: 26px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; overflow: hidden; }
  .type-card .aa { font-family: Calibri, Carlito, "Segoe UI", sans-serif; font-size: clamp(80px, 9vw, 150px); line-height: .8; }
  .type-card small { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .type-card b { display: block; font-size: 20px; margin-top: 6px; font-weight: 600; }
  .type-card p { font-size: 13px; color: var(--muted); margin-top: 6px; }
  .ui-demo { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; flex-shrink: 0; }
  .ui-btn { padding: 12px 20px; border-radius: 10px; background: var(--brand); color: #fff; font-family: Calibri, Carlito, "Segoe UI", sans-serif; font-size: 15px; }
  .ui-slots { display: flex; gap: 6px; }
  .ui-slots span { padding: 7px 10px; border-radius: 8px; border: 1px solid rgba(21,75,139,.25); font-family: Calibri, Carlito, "Segoe UI", sans-serif; font-size: 13px; }
  .ui-slots span.on { background: var(--brand); border-color: var(--brand); color: #fff; }
  .live-hint { margin-top: 24px; font-size: 13px; color: var(--muted); }

  /* results */
  .results { padding: var(--half) var(--gut); border-top: 1px solid var(--line); }
  .nums { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(40px, 5vw, 72px); border-top: 1px solid var(--line); }
  .num { padding: 32px 24px 32px 0; border-right: 1px solid var(--line); }
  .num:last-child { border-right: 0; }
  .num + .num { padding-left: 24px; }
  .num b { display: block; font-family: "Unbounded"; font-weight: 800; font-size: clamp(44px, 6vw, 104px); letter-spacing: -.055em; line-height: 1; }
  .num b em { font-style: normal; color: var(--brand); }
  [data-theme="dark"] .num b em { color: #7fa6d6; }
  .num span { display: block; margin-top: 12px; font-size: 15px; color: var(--muted); max-width: 220px; line-height: 1.45; }
  .review { margin-top: clamp(60px, 8vw, 120px); display: grid; grid-template-columns: 1fr 2.2fr; gap: clamp(24px, 5vw, 80px); align-items: start; }
  .review blockquote { font-family: "Playfair Display"; font-style: italic; font-size: clamp(24px, 2.8vw, 46px); line-height: 1.25; letter-spacing: -.01em; }
  .review cite { display: block; margin-top: 24px; font-style: normal; font-size: 14px; color: var(--muted); }

  /* next */
  .next { display: block; position: relative; padding: clamp(80px, 10vw, 160px) var(--gut); border-top: 1px solid var(--line); overflow: hidden; isolation: isolate; transition: color .6s var(--ease); }
  .next::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--fg); transform: scaleY(0); transform-origin: bottom; transition: transform .7s var(--ease); }
  .next:hover { color: var(--bg); }
  .next:hover::before { transform: scaleY(1); }
  .next small { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; opacity: .6; }
  .next div { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 20px; }
  .next b { font-family: "Unbounded"; font-weight: 800; font-size: clamp(44px, 10vw, 190px); line-height: .9; letter-spacing: -.055em; text-transform: uppercase; transition: transform .7s var(--ease); }
  .next:hover b { transform: translateX(2vw); }
  .next i { font-style: normal; font-size: clamp(40px, 6vw, 100px); transition: transform .7s var(--ease); }
  .next:hover i { transform: rotate(-45deg); }

  @media (max-width: 960px) {
    .flow-line { grid-template-columns: 1fr; gap: 14px; padding: 0 0 0 52px; }
    .flow-track { top: 0; bottom: 0; left: 15px; right: auto; width: 2px; height: auto; }
    .flow-track i { width: 100%; height: 100%; transform-origin: top; transform: scaleY(var(--p, 0)); }
    .flow-track::after { left: 50%; top: calc(var(--p, 0) * 100%); }
    .node { text-align: left; }
    .node .dot { top: 50%; left: -52px; margin: -15px 0 0 0; }
    .booking { grid-template-columns: 1fr; }
  }
  @media (max-width: 860px) {
    .meta { grid-template-columns: 1fr 1fr; }
    .fact-grid { grid-template-columns: 1fr 1fr; }
    .fact:nth-child(3) { border-left: 0; }
    .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
    .story, .struct, .review { grid-template-columns: 1fr; }
    .story-label { position: static; }
    .hs-phone { bottom: -14%; right: 3%; }
    .st-frame { position: relative; top: 0; order: -1; }
    .st-item { min-height: auto; padding: 28px 0; opacity: 1; }
    .shot:nth-child(n) { grid-column: 1 / -1; margin-top: 0; }
    .phones { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; margin-left: calc(-1 * var(--gut)); margin-right: calc(-1 * var(--gut)); padding: 0 var(--gut) 20px; scrollbar-width: none; }
    .phones .phone { width: 58vw; scroll-snap-align: center; transform: none !important; }
    .phones .phone:nth-child(even) { margin-top: 0; }
    .ds-grid { grid-template-columns: 1fr; }
    .swatches { grid-template-columns: 1fr 1fr; min-height: 0; }
    .sw { min-height: 140px; }
    .type-card { flex-wrap: wrap; }
    .nums { grid-template-columns: 1fr 1fr; }
    .num { padding: 24px 12px 24px 0 !important; border-right: 0; border-bottom: 1px solid var(--line); }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  }
