/* Кейс — Косметология МКС: 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);
    --olive: #bab58d;
    --olive-ink: #8a845c;
    --cream: #fef6eb;
    --graphite: #414141;
    --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);
    --olive-ink: #cfc9a2;
  }

  .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(--olive-ink); font-weight: 400; }
  .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 the Figma exports */
  .browser { border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 50px 100px -40px rgba(60,55,30,.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 / 860; 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(60,55,30,.6); }
  .phone img { width: 100%; aspect-ratio: 360 / 640; 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(28px, 8.5vw, 170px); line-height: .88; letter-spacing: -.055em; text-transform: uppercase; margin-top: 24px; }
  .case-hero h1 .serif { font-size: 1.05em; color: var(--olive-ink); }
  .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, 15vw, 240px); 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; }

  /* hero «Капля»: video fills the screen, then closes into the browser window (clip insets driven by skript.js) */
  .cz-hero { position: relative; height: 230vh; padding: 0; }
  .cz-stage { position: sticky; top: 0; height: 100vh; overflow: hidden; background: var(--cream); }
  .cz-media { position: absolute; inset: 0; clip-path: inset(var(--ct, 0px) var(--cr, 0px) var(--cb, 0px) var(--cl, 0px) round var(--crad, 0px)); will-change: clip-path; }
  .cz-media video { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(var(--vs, 1.08)); }
  /* cream haze over the video where the text sits: top for the menu, left and bottom for the title */
  .cz-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(254,246,235,.75) 0%, rgba(254,246,235,0) 26%), linear-gradient(90deg, rgba(254,246,235,.9) 0%, rgba(254,246,235,.6) 42%, rgba(254,246,235,0) 72%), linear-gradient(0deg, rgba(254,246,235,.8) 0%, rgba(254,246,235,0) 40%); opacity: var(--veil, 1); }
  .cz-frame { position: absolute; left: var(--fl, 14vw); top: var(--ft, 20vh); width: var(--fw, 72vw); border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 50px 100px -40px rgba(60,55,30,.45); opacity: var(--fo, 0); pointer-events: none; }
  .cz-frame img { display: block; width: 100%; aspect-ratio: 1440 / 860; object-fit: cover; object-position: top; }
  .cz-title { position: absolute; inset: 0; display: flex; flex-direction: column; padding: clamp(110px, 13vw, 160px) var(--gut) clamp(36px, 6vh, 72px); color: #2c2b27; opacity: var(--to, 1); transform: translateY(var(--ty, 0px)); pointer-events: var(--tp, auto); }
  .cz-title h1 { margin-top: auto; font-family: "Unbounded"; font-weight: 800; font-size: clamp(40px, 9vw, 170px); line-height: .88; letter-spacing: -.055em; text-transform: uppercase; }
  .cz-title h1 .serif { font-size: 1.05em; color: var(--olive-ink); }
  .cz-title .hero-lead p { color: rgba(44,43,39,.72); }
  .cz-title .hero-lead p strong { color: #2c2b27; }
  .cz-title .visit { background: #2c2b27; color: var(--cream); }
  .cz-title .crumbs ol, .cz-title .crumbs li:last-child { color: #2c2b27; }
  .cz-hint { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: rgba(44,43,39,.6); opacity: var(--to, 1); }
  .cz-meta { padding: var(--half) var(--gut) 0; }
  .cz-meta .meta { margin-top: 0; }

  /* 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(--olive); transform: scaleY(0); transform-origin: bottom; transition: transform .6s var(--ease); }
  .fact:hover { color: #1d1b12; }
  .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 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(29,27,18,.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; }

  /* selling structure: sticky long design scrolls to the active section */
  .struct { padding: var(--half) var(--gut); display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(32px, 5vw, 90px); background: var(--cream); color: #2c2b27; }
  [data-theme="dark"] .struct { background: #16140f; color: #ece6da; }
  .struct .tag, .struct .tag b { color: inherit; }
  .struct .sec-head p { color: inherit; opacity: .65; }
  .struct-head { grid-column: 1 / -1; }
  .st-item { min-height: 58vh; display: flex; flex-direction: column; justify-content: center; border-top: 1px solid rgba(0,0,0,.1); opacity: .25; transition: opacity .6s var(--ease); }
  [data-theme="dark"] .st-item { border-color: rgba(255,255,255,.1); }
  .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(--olive-ink); }
  .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; opacity: .7; 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-card { border-radius: 22px; overflow: hidden; background: #fff; box-shadow: 0 50px 100px -40px rgba(60,55,30,.4); }
  /* each step shows its whole section of the page, fitted into the card; steps cross-fade (positioned by skript.js) */
  .st-view img { position: absolute; left: 0; top: 0; width: 100%; transform-origin: 0 0; transition: opacity .35s var(--ease); }
  .st-view img.swap { opacity: 0; }
  .st-badge { position: absolute; left: 18px; bottom: 18px; z-index: 2; padding: 9px 16px; border-radius: 100px; background: var(--graphite); color: #fff; font-size: 13px; font-weight: 600; }

  /* wall of pages: three columns drifting at different speeds */
  .wall { padding: var(--half) 0; overflow: hidden; background: var(--graphite); color: #f4f1ea; }
  .wall .sec-head { padding: 0 var(--gut); }
  .wall .tag, .wall .tag b { color: inherit; }
  .wall .h2 .serif { color: var(--olive); }
  .wall .sec-head p { color: inherit; opacity: .6; }
  .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.6vw, 24px); padding: 0 var(--gut); height: 150vh; overflow: hidden; }
  .col { display: flex; flex-direction: column; gap: clamp(12px, 1.6vw, 24px); will-change: transform; }
  .tile { position: relative; border-radius: 16px; overflow: hidden; background: #fff; }
  .tile img { width: 100%; aspect-ratio: 4 / 3.4; object-fit: cover; object-position: top; transition: transform 1.2s var(--ease); }
  .tile:hover img { transform: scale(1.05); }
  .tile span { position: absolute; left: 12px; bottom: 12px; padding: 7px 13px; border-radius: 100px; background: rgba(20,20,20,.72); backdrop-filter: blur(6px); color: #fff; font-size: 12px; font-weight: 600; }

  /* service states */
  .states { padding: var(--half) var(--gut); }
  .state-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 1.6vw, 24px); }
  /* clean screenshots, captions as a quiet numbered line under them (no plates) */
  .state img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 30px 60px -34px rgba(60,55,30,.4); transition: transform .6s var(--ease); }
  .state:hover img { transform: translateY(-8px); }
  .state figcaption { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: baseline; padding: 18px 2px 0; }
  .state figcaption em { grid-row: span 2; font-family: "Playfair Display"; font-style: italic; font-size: 22px; line-height: 1; color: var(--olive-ink); }
  .state figcaption b { font-family: "Unbounded"; font-weight: 600; font-size: 15px; letter-spacing: -.02em; }
  .state figcaption span { margin-top: 4px; font-size: 13px; line-height: 1.45; color: var(--muted); }
  /* phones */
  .mobile { padding: var(--half) var(--gut); border-top: 1px solid var(--line); }
  .phones { display: flex; justify-content: center; align-items: flex-start; gap: clamp(14px, 2.4vw, 40px); }
  .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: 1.25fr 1fr; gap: 12px; }
  .type-card { position: relative; 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.spec { background: #bcb893 url(../img/cosmetology/type-berold.jpg) center / cover no-repeat; color: #fff; align-items: flex-start; min-height: 220px; }
  .type-card .aa { font-family: "Manrope"; font-weight: 500; font-size: clamp(80px, 9vw, 150px); line-height: .8; letter-spacing: -.04em; }
  .type-card small { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .type-card.spec small { color: rgba(255,255,255,.85); }
  .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; }
  .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(--olive-ink); }
  .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); }


  @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; }
    .cz-hero { height: 200vh; }
    .cz-title .hero-lead { gap: 20px; }
    .cz-title h1 { font-size: 8.3vw; }
    .st-frame { position: relative; top: 0; order: -1; }
    .st-item { min-height: auto; padding: 28px 0; opacity: 1; }
    .cols { grid-template-columns: 1fr 1fr; height: 120vh; }
    .cols .col:nth-child(3) { display: none; }
    .state-grid { grid-template-columns: 1fr 1fr; }
    .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; }
    .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; }
  }
