:root{
  --bg: #ffffff;
  --text: #0e0f12;
  --muted: rgba(14,15,18,.70);
  --card: #0e0f12;
  --card2:#13151a;
  --stroke: rgba(14,15,18,.12);
  --stroke2: rgba(255,255,255,.10);
  --lime: #d9ff6a;
  --lime2: #c7ff3b;
  --shadow: 0 18px 55px rgba(0,0,0,.12);
  --r-xl: 32px;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 14px;
  --container: 1120px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  padding-top: 70px;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background: #ffffff;
}


a{color:inherit;text-decoration:none}
p{margin:0 0 14px}
h1,h2,h3,h4{margin:0 0 12px; letter-spacing:-0.03em}
h1{font-size: clamp(34px, 4.2vw, 52px); line-height:1.02}
h2{font-size: clamp(26px, 3.2vw, 36px); line-height:1.05}
h3{font-size: 20px; line-height:1.15}
h4{font-size: 16px; line-height:1.15; margin-bottom:8px}
.lead{font-size: 16px; color:var(--muted); line-height:1.6}
.container{max-width:var(--container); padding:0 18px; margin:0 auto}

.header{
  position:fixed; top:0; left:0; right:0; z-index:50;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(18px) saturate(180%);
  }
.header__inner{
  display:flex; align-items:center; justify-content:space-between;
  height:70px;
}
.header.header--scrolled{background: rgba(255,255,255,.45); box-shadow: 0 10px 30px rgba(0,0,0,.10);}
.brand{display:flex; align-items:center; gap:10px; font-weight:700}
.brand__dot{width:10px;height:10px;border-radius:999px;background:var(--lime2); box-shadow:0 0 0 6px rgba(217,255,106,.35)}
.brand__name{font-size:18px}
.brand__accent{color:var(--text)}
.brand--small .brand__name{font-size:16px}
.nav{display:flex; gap:18px; align-items:center; font-weight:500; color:rgba(14,15,18,.80)}
.nav a{padding:8px 10px; border-radius:12px}
.nav a:hover{background:rgba(14,15,18,.06)}

.burger{
  display:none;
  width:44px; height:44px; border-radius:14px;
  border:1px solid var(--stroke);
  background:#fff;
}
.burger span{display:block; height:2px; width:18px; background:var(--text); margin:5px auto; border-radius:999px}

.mobile-menu{
  border-bottom:1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}
.mobile-menu__inner{padding:14px 0; display:grid; gap:8px}
.mobile-menu a{padding:12px 14px; border-radius:14px; border:1px solid var(--stroke)}
.mobile-menu a:hover{background:rgba(14,15,18,.05)}

.hero{padding:54px 0 26px}
.hero__grid{
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap:26px;
  align-items:stretch;
}
.hero__content{
  padding: 6px 0;
}
.hero__cta{display:flex; gap:12px; flex-wrap:wrap; margin:18px 0 18px}
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:10px;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid var(--stroke);
  background:#d9ff6a;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover{transform: translateY(-1px); box-shadow: 0 10px 30px rgba(0,0,0,.10)}
.btn--primary{background: var(--lime2); border-color: rgba(0,0,0,.06)}
.btn--ghost{background: transparent}
.btn--dark{background: var(--card); color:#fff; border-color: rgba(255,255,255,.12)}
.btn--full{width:100%; margin-top:12px}

.hero__stats{
  display:flex; gap:12px; flex-wrap:wrap;
  margin-top: 10px;
}
.stat{
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgb(255, 255, 255);
}
.stat__num{font-weight:700}
.stat__label{font-size: 12px; color:var(--muted); margin-top:4px}

.hero__visual{
  position:relative;
  min-height: 420px;
}
.glass-card{
  position:absolute;
  border-radius: var(--r-xl);
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.glass-card--light{left:0; top:8px; width: 62%; height: 145px}
.glass-card--dark{right:0; top:0; width: 52%; height: 180px; background: rgba(14,15,18,.92); border: 1px solid rgba(255,255,255,.12)}
.glass-card__top{display:flex; align-items:center; justify-content:space-between; padding: 14px 14px 6px}
.glass-card__body{padding: 10px 14px 14px}
.glass-card__body--dark{color:rgba(255,255,255,.86)}
.glass-card__body--dark p{color:rgba(255,255,255,.72); line-height:1.5}

.pill{
  display:inline-flex; align-items:center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(14,15,18,.10);
  background: rgba(255,255,255,.72);
}
.pill--dark{
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.86);
}
.spark{color:rgba(255,255,255,.86); font-size:18px}

.orb{
  width: 86px; height: 86px; border-radius: 999px;
  background:
    radial-gradient(circle at 30% 30%, rgba(14,15,18,.18), rgba(14,15,18,.04) 55%, rgba(14,15,18,0) 70%),
    radial-gradient(circle at 60% 60%, rgba(217,255,106,.75), rgba(217,255,106,0) 65%);
  filter: blur(.2px);
  opacity:.9;
}
.lines{margin-top:10px; display:grid; gap:8px}
.line{height:10px;border-radius:999px;background:rgba(14,15,18,.07)}
.line:nth-child(2){width:78%}
.line:nth-child(3){width:62%}

.mini-grid{margin-top:14px; display:grid; grid-template-columns:repeat(3,1fr); gap:8px}
.mini-tile{height:18px;border-radius:8px;background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.10)}

.hero__accent-block{
  position:absolute;
  left:0; right:0; bottom:0;
  height: 220px;
  border-radius: var(--r-xl);
  background: rgba(217,255,106,.70);
  border: 1px solid rgba(14,15,18,.10);
  box-shadow: var(--shadow);
  padding: 16px 16px 16px;
  overflow:hidden;
}
.hero__accent-head{display:flex; gap:8px; flex-wrap:wrap}
.chip{
  display:inline-flex; align-items:center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(14,15,18,.10);
  background: rgba(255,255,255,.55);
}
.chip--dark{background: rgba(14,15,18,.86); border-color: rgba(255,255,255,.12); color: rgba(255,255,255,.90)}
.chip--lime{background: rgba(217,255,106,.92); border-color: rgba(0,0,0,.08)}
.hero__accent-body{margin-top:14px; max-width: 80%}
.hero__accent-title{font-size: 42px; font-weight: 700; letter-spacing:-0.04em}
.hero__accent-body p{color:rgba(14,15,18,.78); line-height:1.55}
.hero__accent-arrow{
  position:absolute; right:18px; bottom:18px;
  width: 54px; height: 54px; border-radius: 16px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid rgba(14,15,18,.12);
  background: rgba(255,255,255,.50);
  font-size: 26px;
}

.section{padding: 58px 0}
.section--muted{
  background: transparent;
  border-top: none;
  border-bottom: none;
}
.section__head{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap:18px; flex-wrap:wrap;
  margin-bottom: 22px;
}
.section__head p{max-width: 520px; color:var(--muted); line-height:1.5; margin:0}

.grid{display:grid; gap:14px}
.grid--solutions{grid-template-columns: repeat(12, 1fr)}
.grid--solutions .card{grid-column: span 6}
.grid--solutions .card--wide{grid-column: span 12}
.grid--industries{grid-template-columns: repeat(12, 1fr)}
.grid--industries .card{grid-column: span 4}
.grid--industries .card--wide{grid-column: span 8}
.grid--pricing{grid-template-columns: repeat(12, 1fr)}
.grid--pricing .price{grid-column: span 4}

.card{
  position:relative;
  border-radius: var(--r-xl);
  padding: 18px 18px 18px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.76);
  box-shadow: 0 12px 40px rgba(0,0,0,.06);
  overflow:hidden;
}
.card--dark{
  background: linear-gradient(180deg, rgba(14,15,18,.96), rgba(14,15,18,.92));
  color:#fff;
  border-color: rgba(255,255,255,.10);
}
.card--lime{
  background: rgba(217,255,106,.78);
  border-color: rgba(0,0,0,.08);
}
.card--outline{
  background: rgba(255,255,255,.76);
}
.card__corner{
  position:absolute; right:16px; top:16px;
  width: 40px; height: 40px; border-radius: 16px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.90);
}
.card--lime .card__corner{
  border-color: rgba(14,15,18,.12);
  background: rgba(255,255,255,.45);
  color: rgba(14,15,18,.95);
}
.card--outline .card__corner{
  border-color: rgba(14,15,18,.12);
  background: rgba(14,15,18,.03);
  color: rgba(14,15,18,.95);
}

.split{
  display:grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 16px;
  align-items:start;
}
.about__side{display:grid; gap:14px}
.about__expertise .list{margin:0; padding-left: 18px; color:rgba(255,255,255,.78)}
.about__badge .badge__title{font-weight:700; letter-spacing:-0.03em}
.about__badge .accent{color: var(--lime2)}
.badge__pills{display:flex; gap:8px; margin-top:10px; flex-wrap:wrap}

.list{margin:0; padding-left:18px}
.list li{margin: 8px 0; color:var(--muted)}
.card--dark .list li{color:rgba(255,255,255,.74)}

.timeline{display:grid; gap:12px}
.step{
  display:grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  padding: 16px;
  border-radius: var(--r-xl);
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.70);
}
.step__num{
  width: 46px; height: 46px; border-radius: 18px;
  display:flex; align-items:center; justify-content:center;
  background: rgba(217,255,106,.70);
  border:1px solid rgba(0,0,0,.08);
  font-weight: 700;
}
.step__body p{color:var(--muted); line-height:1.55}

.case{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 16px;
  align-items:center;
  margin-top: 18px;
}
.case--reverse{grid-template-columns: .9fr 1.1fr}
.case__text p{color:var(--muted); line-height:1.6}
.case__tags{display:flex; gap:8px; flex-wrap:wrap; margin-top: 12px}

.phone{
  position:relative;
  width: min(360px, 100%);
  margin-left:auto;
  border-radius: 52px;
  padding: 18px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.phone__screen{
  border-radius: 30px;
  overflow:hidden;
  background: #0b0c10;
  aspect-ratio: 9 / 19.5;
  position:relative;
}
.phone__img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}
.phone__nav{
  z-index: 5;
  position:absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  font-size: 26px;
  cursor:pointer;
}
.phone__nav:hover{background: rgba(255,255,255,.10)}
.phone__nav--prev{left: -8px}
.phone__nav--next{right: -8px}

.price__top p{color:rgba(255,255,255,.74); line-height:1.5}
.card--lime .price__top p{color:rgba(14,15,18,.72)}
.price__value{font-size: 28px; font-weight: 800; letter-spacing:-0.03em}
.price__value span{font-size: 14px; font-weight: 600; opacity:.75; margin-left:6px}

.checklist{list-style:none; padding:0; margin: 14px 0 0}
.checklist li{
  position:relative;
  padding-left: 26px;
  margin: 10px 0;
  line-height:1.45;
  color: rgba(255,255,255,.78);
}
.card--lime .checklist li{color: rgba(14,15,18,.78)}
.checklist li::before{
  content:"✓";
  position:absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  border-radius: 7px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: rgba(217,255,106,.90);
  color: rgba(14,15,18,.95);
  font-weight: 900;
  font-size: 12px;
}
.card--lime .checklist li::before{background: rgba(14,15,18,.92); color:#fff}

.contact-banner{
  border-radius: 48px;
  padding: 26px;
  background: linear-gradient(180deg, rgba(14,15,18,.98), rgba(14,15,18,.92));
  color:#fff;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 18px 65px rgba(0,0,0,.16);
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
  align-items:center;
}
.contact-banner__kicker{color: rgba(255,255,255,.70); margin-bottom:10px}
.contact-banner__left p{color: rgba(255,255,255,.72); line-height:1.6}
.contact-banner__right{display:grid; gap:12px}

.pill-btn{
  display:flex; align-items:center; justify-content:space-between;
  gap: 12px;
  border-radius: 999px;
  padding: 14px 16px;
  background: rgba(217,255,106,.92);
  border: 1px solid rgba(0,0,0,.08);
  color: rgba(14,15,18,.95);
  font-weight: 700;
}
.pill-btn--dark{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  color: rgba(255,255,255,.90);
}
.pill-btn__label{font-size: 12px; opacity:.75; font-weight:600}
.pill-btn__value{font-size: 16px}

.footer{
  display:flex; justify-content:space-between; align-items:center;
  gap: 14px;
  padding: 22px 4px 0;
}
.footer__meta{margin-top:6px; color:var(--muted); font-size: 12px}
.footer__right a{padding:10px 12px; border-radius:14px; border:1px solid var(--stroke)}
.footer__right a:hover{background: rgba(14,15,18,.05)}

@media (max-width: 980px){
  .hero__grid{grid-template-columns: 1fr}
  .hero__visual{min-height: 380px}
  .split{grid-template-columns: 1fr}
  .case, .case--reverse{grid-template-columns: 1fr}
  .case__phone{display:flex; justify-content:flex-start}
  .grid--solutions .card{grid-column: span 12}
  .grid--industries .card{grid-column: span 6}
  .grid--industries .card--wide{grid-column: span 12}
  .grid--pricing .price{grid-column: span 12}
  .contact-banner{grid-template-columns: 1fr}
  .nav{display:none}
  .burger{display:block}
}
@media (max-width: 540px){
  .hero{padding-top:38px}
  .hero__visual{min-height: 420px}
  .hero__accent-title{font-size: 36px}
  .phone__nav--prev{left: 6px}
  .phone__nav--next{right: 6px}
}

.section + .section{border-top: 1px solid rgba(14,15,18,.06);} 

.phone__screen{
  border-radius: 40px;
  overflow:hidden;
  background: #0b0c10;
  aspect-ratio: 9 / 19.5;
  position:relative;
  box-shadow: 0 18px 65px rgba(0,0,0,.16);
}
.phone__frame{
  position:absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events:none;
  filter: drop-shadow(0 22px 70px rgba(0,0,0,.22));
}

/* Aura reference background blobs (фон как в AuraBot.html) */
.bg-blob{
  position:fixed;
  width:520px;height:520px;
  border-radius:999px;
  background:
    radial-gradient(closest-side, rgba(255,255,255,.85), rgba(255,255,255,0) 70%),
    conic-gradient(from 180deg, rgba(0,0,0,.10), rgba(255,255,255,.45), rgba(0,0,0,.10));
  opacity:.85;
  pointer-events:none;
  mix-blend-mode:multiply;
  z-index:-1;
}
.bg-blob.b1{ top:-140px; left:-180px; transform: rotate(18deg); }
.bg-blob.b2{ top:-180px; right:-220px; transform: rotate(-14deg); width:560px; height:560px; opacity:.78; }
.bg-blob.b3{ bottom:-220px; left:-260px; transform: rotate(-22deg); width:620px; height:620px; opacity:.72; }

/* --- Phone frame v7: tight-cropped frame + correct screen inset --- */
.phone{
  position:relative;
  width: min(360px, 100%);
  aspect-ratio: 856 / 1780;
  margin-left:auto;
  border-radius: 52px; /* only affects hit-area */
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.phone__screen{
  position:absolute;
  /* Inset tuned for this frame; adjust if needed */
  left: 10%;
  right: 10%;
  top: 7.5%;
  bottom: 7.5%;
  border-radius: 36px;
  overflow:hidden;
  background:#000;
  box-shadow: 0 18px 55px rgba(0,0,0,.22);
}

.phone__img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

.phone__frame{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit: contain;
  pointer-events:none;
  z-index: 6;
  filter: drop-shadow(0 22px 70px rgba(0,0,0,.22));
}

.phone__nav{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:56px;
  height:56px;
  border-radius:18px;
  border:1px solid rgba(0,0,0,.20);
  background:rgba(255,255,255,.96);
  color:#0B0C10;
  font-size:30px;
  font-weight:900;
  cursor:pointer;
  z-index: 10;
  box-shadow:0 14px 34px rgba(0,0,0,.28);
}
.phone__nav--prev{ left:-18px; }
.phone__nav--next{ right:-18px; }

@media (max-width: 540px){
  .phone__nav--prev{ left: 6px; }
  .phone__nav--next{ right: 6px; }
}


/* --- v8 fix: images must not leak outside phone; only one visible at a time --- */
.phone__screen{ overflow:hidden !important; }
.phone__img{
  position:absolute;
  inset:0;
}
.phone__img[hidden]{
  display:none !important;
}

/* --- v9 portfolio phone: screenshots already include phone frame --- */
.phone--full{
  width: min(420px, 100%);
  padding: 0;
  margin-left:auto;
}
.phone__screen--full{
  position:relative;
  border-radius: 28px;
  overflow:hidden;
  background: transparent;
  aspect-ratio: 1 / 1;
  box-shadow: 0 18px 65px rgba(0,0,0,.18);
}
.phone__screen--full .phone__img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit: contain;
  background: transparent;
}
.phone__screen--full .phone__img[hidden]{ display:none !important; }

/* Text swap in portfolio */
.portfolio-text[hidden]{ display:none !important; }

/* --- v10: frameless media carousel (no phone frame) --- */
.media-carousel{
  position: relative;
  width: min(420px, 100%);
  margin-left: auto;
}
.media-carousel__screen{
  position: relative;
  overflow: hidden;
  background: transparent;
}
.media-carousel__img{
  position: absolute;
  inset: 0;
  width: 100%;
  
  max-height: 1000px;
  object-fit: contain;
}
.media-carousel__img[hidden]{ display:none !important; }

.media-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  border: none;
  font-size: 28px;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
  z-index: 5;
}
.media-nav--prev{ left: -22px; }
.media-nav--next{ right: -22px; }

/* --- v11 FIX: show phone images correctly --- */
.media-carousel__screen{
  width: 100%;
  aspect-ratio: 9 / 19.5; /* iPhone-like */
}

.media-carousel__img{
  position: relative;
  width: 100%;
  
  display: block;
}


/* --- v12: portfolio layout like reference (text left, phone right, arrows near phone) --- */
.case{
  display:grid;
  grid-template-columns: minmax(420px, 620px) minmax(280px, 520px);
  gap: 64px;
  align-items: center;
}
.case__text{ max-width: 620px; }
.case__phone{
  display:flex;
  justify-content:center;
  align-items:center;
}

.media-carousel{
  width: min(520px, 100%);
  margin-left: 0;
}

.media-carousel__screen{
  width: 100%;
  aspect-ratio: 9 / 19.5;
}

.media-nav{
  width: 52px;
  height: 52px;
  line-height: 52px;
  font-size: 30px;
  border-radius: 18px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 14px 34px rgba(0,0,0,.22);
}
.media-nav--prev{ left: -28px; }
.media-nav--next{ right: -28px; }

@media (max-width: 980px){
  .case{
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .case__phone{ justify-content:flex-start; }
  .media-carousel{ width: min(420px, 100%); }
  .media-nav--prev{ left: 6px; }
  .media-nav--next{ right: 6px; }
}


/* --- v13: bigger phone + align with text/arrows --- */
.case{ align-items: center !important; }
.case__phone{ align-self: center; }

.media-carousel{
  position: relative;
  width: clamp(360px, 34vw, 560px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.media-carousel__screen{
  height: clamp(560px, 72vh, 860px);
  aspect-ratio: 9 / 19.5;
}

.media-carousel__img{
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.media-nav{
  top: 50%;
  transform: translateY(-50%);
}
.media-nav--prev{ left: 140px; }
.media-nav--next{ right: 140px; }

@media (max-width: 980px){
  .media-carousel{
    width: min(420px, 100%);
  }
  .media-carousel__screen{
    height: clamp(520px, 70vh, 760px);
  }
  .media-nav--prev{ left: 6px; }
  .media-nav--next{ right: 6px; }
}


/* --- v14: bigger text + bigger phone (portfolio) --- */

/* Text scale */
.case__text h3{
  font-size: clamp(28px, 2.4vw, 36px);
  line-height: 1.15;
}
.case__text p{
  font-size: clamp(17px, 1.2vw, 20px);
  line-height: 1.6;
}
.case__text .card{
  font-size: 16px;
}
.case__tags .chip{
  font-size: 14px;
  padding: 8px 14px;
}

/* Phone scale */
.media-carousel{
  width: clamp(420px, 38vw, 640px);
}
.media-carousel__screen{
  height: clamp(640px, 78vh, 920px);
}

/* Arrows slightly bigger */
.media-nav{
  width: 60px;
  height: 60px;
  line-height: 60px;
  font-size: 34px;
}

@media (max-width: 980px){
  .case__text h3{
    font-size: 26px;
  }
  .case__text p{
    font-size: 16px;
  }
  .media-carousel{
    width: min(440px, 100%);
  }
  .media-carousel__screen{
    height: clamp(560px, 72vh, 820px);
  }
}


/* --- v15: EXTRA BIG phone (dominant visual) --- */
.media-carousel{
  width: clamp(520px, 44vw, 760px);
}

.media-carousel__screen{
  height: clamp(780px, 88vh, 1100px);
}

@media (max-width: 1200px){
  .media-carousel{
    width: clamp(460px, 60vw, 620px);
  }
  .media-carousel__screen{
    height: clamp(700px, 82vh, 920px);
  }
}

@media (max-width: 980px){
  .media-carousel{
    width: min(460px, 100%);
  }
  .media-carousel__screen{
    height: clamp(620px, 78vh, 860px);
  }
}


/* --- v16: REAL phone scaling (remove visual caps) --- */
.media-carousel{
  width: 820px !important;
}

.media-carousel__screen{
  height: auto !important;
}

.media-carousel__img{
  width: 100%;
  
  transform: scale(1.8);
  transform-origin: center;
}

@media (max-width: 1400px){
  .media-carousel{
    width: 700px !important;
  }
}
@media (max-width: 1100px){
  .media-carousel{
    width: 560px !important;
  }
  .media-carousel__img{
    transform: scale(1.05);
  }
}


/* --- v17: phone lower + bigger scale --- */
.media-carousel{
  margin-top: 120px;
}

@media (max-width: 1100px){
  .media-carousel{
    margin-top: 60px;
  }
}


/* --- v18: explicit phone height control (no height:auto) --- */
:root{
  --phone-height: 700px; /* 👈 РЕГУЛИРУЙ ВЫСОТУ ТЕЛЕФОНА ЗДЕСЬ */
}

.media-carousel__screen{
  height: var(--phone-height) !important;
}

.media-carousel__img{
  height: 100% !important;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}


/* --- v19: lift portfolio block up (no phone size change) --- */
#portfolio.section{
  padding-top: 64px !important;
  padding-bottom: 72px !important;
}
#portfolio .section__head{
  margin-bottom: 28px !important;
}
#portfolio .case{
  align-items: flex-start !important;
  gap: 56px !important;
  margin-top: 0 !important;
}
#portfolio .case__text{
  padding-top: 0 !important;
}
#portfolio .case__phone{
  align-self: flex-start !important;
  padding-top: 0 !important;
}
#portfolio .media-carousel{
  margin-top: 0 !important; /* убираем опускание */
}

/* On large screens, keep top aligned */
@media (min-width: 981px){
  #portfolio .media-nav{ top: 65% !important; } /* чуть ниже середины, чтобы совпало с рефом */
}

/* On small screens keep comfortable spacing */
@media (max-width: 980px){
  #portfolio.section{
    padding-top: 44px !important;
  }
  #portfolio .section__head{
    margin-bottom: 18px !important;
  }
}


/* --- v20: lift phone + arrows + align text with phone top (portfolio) --- */
:root{
  --portfolio-lift: -90px; /* 👈 регулируй: отрицательное = поднять вверх */
}

#portfolio .case__text,
#portfolio .case__phone{
  transform: translateY(var(--portfolio-lift));
}

#portfolio .case{
  align-items: flex-start !important;
}

/* Keep section head stable so it doesn't jump */
#portfolio .section__head{
  transform: translateY(0) !important;
}

/* On small screens reduce lift */
@media (max-width: 980px){
  :root{ --portfolio-lift: -40px; }
}


/* --- v21: lower ONLY text block, phone stays fixed --- */
:root{
  --portfolio-text-offset: 80px; /* 👈 НА СКОЛЬКО ОПУСТИТЬ ТЕКСТ */
}

#portfolio .case__text{
  transform: translateY(var(--portfolio-text-offset)) !important;
}

/* phone remains unchanged */
#portfolio .case__phone{
  transform: none !important;
}


/* --- v22: media-nav arrows update --- */
.media-nav{
  width: 60px !important;
  height: 60px !important;
  line-height: 10px !important;
  font-size: 40px !important;
  transform: translateY(-300%) !important;
}


/* --- v23: align phone + text horizontally and lift phone slightly --- */
:root{
  --phone-lift: -100px;      /* 👈 поднять ТЕЛЕФОН */
  --text-lift: 100px;       /* 👈 выровнять ТЕКСТ по телефону */
  --phone-shift-x: -180px; /* 👈 сдвиг ТЕЛЕФОНА влево (отрицательное = влево) */
}

#portfolio .case{
  align-items: flex-start !important;
}

#portfolio .case__phone{
  transform: translate(var(--phone-shift-x), var(--phone-lift)) !important;
}

#portfolio .case__text{
  transform: translateY(var(--text-lift)) !important;
}

/* keep arrows synced with phone */
.media-nav{
  transform: translateY(calc(50% + var(--phone-lift))) !important;
}

/* --- v24: separate Telegram text block --- */
.telegram-block{
  margin-bottom: 48px;
}
.telegram-block h2{
  font-size: 32px;
  margin-bottom: 12px;
}
.telegram-block .tags span{
  display:inline-block;
  margin-right:8px;
  padding:6px 12px;
  background:#111;
  color:#fff;
  border-radius:999px;
  font-size:14px;
}

/* --- v25: controllable lift for cosmetology case text block --- */
:root{
  --case-text-lift: -60px; /* 👈 регулируй: отрицательное = поднять вверх */
}
#portfolio .case-block{
  transform: translateY(var(--case-text-lift));
}

/* --- v30 smooth swap (no changes to phone/text sizes) --- */

/* 1) Phone images: stack with CSS grid (keeps your height/scale settings) */
#portfolio .media-carousel__screen{
  height: clamp(640px, 78vh, 920px);
}
#portfolio .media-carousel__img{
  grid-area: 1 / 1;
  opacity: 0;
  transition: opacity 650ms cubic-bezier(.2,.8,.2,1);
  will-change: opacity;
}
#portfolio .media-carousel__img.is-active{
  opacity: 1;
}

/* 2) Text blocks: overlap inside a fixed container to avoid layout jump */
#portfolio .case__text{
  position: relative;
}
#portfolio .portfolio-text{
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  opacity: 0;
  transition: opacity 650ms cubic-bezier(.2,.8,.2,1);
  will-change: opacity;
}
#portfolio .portfolio-text.is-active{
  opacity: 1;
}

/* --- v31 image sharpness: avoid blur (no resampling scale) --- */
#portfolio .media-carousel__img{
  transform: none !important; /* убираем scale, он даёт размытие */
  image-rendering: auto;
  -webkit-transform: translateZ(0); /* стабильнее рендер в некоторых браузерах */
  backface-visibility: hidden;
}

/* --- v32: increase phone size WITHOUT quality loss --- */
:root{
  --phone-height: 820px; /* ↑ увеличиваем реальный размер контейнера */
}

#portfolio .media-carousel{
  width: 520px; /* шире контейнер */
}

#portfolio .media-carousel__screen{
  height: clamp(640px, 78vh, 920px);
}

#portfolio .media-carousel__img{
  width: 100%;
  height: 100%;
  object-fit: contain; /* без обрезки и без мыла */
}


/* --- v33: FORCE bigger phone (no transform, no blur) --- */
:root{
  --phone-height: 900px; /* 👈 увеличь/уменьши */
  --phone-width: 620px;  /* 👈 увеличь/уменьши */
}

#portfolio .media-carousel{
  width: var(--phone-width) !important;
  max-width: 100% !important;
}

#portfolio .media-carousel__screen{
  height: clamp(640px, 78vh, 920px);
}

#portfolio .media-carousel__img{
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  transform: none !important; /* гарантия против размытия */
}


/* --- v35: ensure phone image can grow --- */
#portfolio .media-carousel__img{
  max-height: 1000px !important;
}


/* --- v36: bigger phone without quality loss (NO transform scaling) --- */
:root{
  --phone-height: 980px;   /* ↑ высота области телефона */
  --phone-width: 720px;    /* ↑ ширина области телефона */
}

#portfolio .media-carousel{
  width: var(--phone-width) !important;
  max-width: 100% !important;
}

#portfolio .media-carousel__screen{
  height: clamp(640px, 78vh, 920px);
}

#portfolio .media-carousel__img{
  max-height: 1200px !important; /* ↑ снимаем ограничение */
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  transform: none !important; /* гарантия против размытия */
}



/* 1. Remove ANY upper limits */
#portfolio .media-carousel,
#portfolio .media-carousel__screen,
#portfolio .media-carousel__img{
  max-height: none !important;
  max-width: none !important;
}

/* 2. Make phone REALLY bigger via layout, not transform */
#portfolio .media-carousel{
  width: 820px !important;
}

#portfolio .media-carousel__screen{
  height: clamp(640px, 78vh, 920px);
}

/* 3. Image follows container exactly */
#portfolio .media-carousel__img{
  width: auto !important;
  height: 100% !important;
  object-fit: contain !important;
  transform: none !important;
  image-rendering: auto;
}

/* 4. Make sure grid allows growth */
#portfolio .case{
  grid-template-columns: 1fr 820px !important;
}


/* === v38: bigger phone BUT fits layout (no blur, no scale) === */
:root{
  --phone-width: 600px;   /* регулируй ширину телефона */
  --phone-height: 920px;  /* регулируй высоту телефона */
}

/* grid: текст + телефон, без сжатия текста в колонку */
#portfolio .case{
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(420px, var(--phone-width));
  align-items: center;
  column-gap: 64px;
}

/* телефонный контейнер */
#portfolio .media-carousel{
  width: var(--phone-width);
  max-width: 100%;
  justify-self: center;
  align-self: center;
}

#portfolio .media-carousel__screen{
  height: clamp(640px, 78vh, 920px);
}

/* картинка — 100% контейнера, без transform */
#portfolio .media-carousel__img{
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain !important;
  transform: none !important;
}

/* стрелки остаются на месте относительно карусели */
#portfolio .media-nav{
  position: absolute;
  top: 50%;
  transform: translateY(calc(-120% + var(--phone-lift))) !important;
}

/* адаптив: на узких экранах складываем в колонку */
@media (max-width: 1100px){
  #portfolio .case{
    grid-template-columns: 1fr;
    row-gap: 28px;
  }
  #portfolio .media-carousel{
    width: min(var(--phone-width), 92vw);
  }
  #portfolio .media-carousel__screen{
  height: clamp(640px, 78vh, 920px);
}
}


:root{
  --portfolio-text-col: 560px;   /* ширина левого прямоугольника (текста) */
  --portfolio-gap: 120px;        /* расстояние между текстом и телефоном */
  --portfolio-right-pad: 80px;   /* отступ справа от края для телефона */
}

/* Make the whole section use full container width and push phone block right */
#portfolio .case{
  grid-template-columns: var(--portfolio-text-col) 1fr !important;
  column-gap: var(--portfolio-gap) !important;
  align-items: start !important;
}

/* Left text column should not get squeezed */
#portfolio .case-content{
  max-width: var(--portfolio-text-col) !important;
}

/* Right block (phone + nav) */
#portfolio .media-wrap,
#portfolio .media-carousel{
  justify-self: end !important;
}

#portfolio .media-wrap{
  padding-right: var(--portfolio-right-pad) !important;
}

/* Keep phone centered inside its own block */
#portfolio .media-carousel{
  margin: 0 !important;
}

/* Place arrows relative to phone block, not between columns */
#portfolio .media-nav.prev{
  left: -84px !important;
}
#portfolio .media-nav.next{
  right: -84px !important;
}

/* Responsive: reduce gap/padding */
@media (max-width: 1300px){
  :root{
    --portfolio-gap: 72px;
    --portfolio-right-pad: 24px;
    --portfolio-text-col: 520px;
  }
}
@media (max-width: 1100px){
  #portfolio .case{
    grid-template-columns: 1fr !important;
    column-gap: 0 !important;
    row-gap: 24px !important;
    align-items: start !important;
  }
  #portfolio .media-wrap{
    padding-right: 0 !important;
    justify-self: center !important;
  }
  #portfolio .media-nav.prev{ left: 16px !important; }
  #portfolio .media-nav.next{ right: 16px !important; }
}


/* === v40: portfolio layout + phone position tweak (move left + lift up). Text untouched. === */
:root{
  --portfolio-text-col: 560px;   /* ширина левого текстового блока */
  --portfolio-gap: 120px;        /* расстояние между текстом и телефоном */
  --portfolio-right-pad: 20px;   /* МЕНЬШЕ отступ справа -> телефон уходит влево */
  --portfolio-phone-lift: -70px; /* телефон выше (отрицательное = вверх) */
}

/* Two-column layout: left text fixed, right phone area */
#portfolio .case{
  grid-template-columns: var(--portfolio-text-col) 1fr !important;
  column-gap: var(--portfolio-gap) !important;
  align-items: start !important;
}

/* Keep left column stable */
#portfolio .case-content{
  max-width: var(--portfolio-text-col) !important;
}

/* Right side: phone + arrows aligned and pushed right with small padding */
#portfolio .media-wrap,
#portfolio .media-carousel{
  justify-self: end !important;
}

#portfolio .media-wrap{
  padding-right: var(--portfolio-right-pad) !important;
  transform: translateY(var(--portfolio-phone-lift)) !important;
}

/* Arrows: stay around the phone and move with it */
#portfolio .media-nav.prev{ left: -84px !important; }
#portfolio .media-nav.next{ right: -84px !important; }

/* Responsive: reduce gap/padding */
@media (max-width: 1300px){
  :root{
    --portfolio-gap: 72px;
    --portfolio-right-pad: 12px;
    --portfolio-text-col: 520px;
    --portfolio-phone-lift: -50px;
  }
}
@media (max-width: 1100px){
  #portfolio .case{
    grid-template-columns: 1fr !important;
    column-gap: 0 !important;
    row-gap: 24px !important;
    align-items: start !important;
  }
  #portfolio .media-wrap{
    padding-right: 0 !important;
    justify-self: center !important;
    transform: none !important;
  }
  #portfolio .media-nav.prev{ left: 16px !important; }
  #portfolio .media-nav.next{ right: 16px !important; }
}


/* v45: реально уменьшаем "пустоту" между Портфолио и Тарифами
   Причина была в большой фиксированной высоте экрана телефона в портфолио:
   .media-carousel__screen { height: clamp(640px, 78vh, 920px); }
*/
#portfolio.section{
  padding-bottom: 20px !important;
  margin-bottom: 0 !important;
}
#pricing.section{
  padding-top: 20px !important;
}

/* уменьшаем высоту блока телефона в портфолио */
#portfolio .media-carousel__screen{
  height: clamp(640px, 78vh, 920px);
}

/* на мобильных ещё компактнее */
@media (max-width: 640px){
  #portfolio .media-carousel__screen{
  height: clamp(640px, 78vh, 920px);
}
}

/* v47: control gap between portfolio and pricing without resizing phone */
#portfolio.section{
  padding-bottom: 32px !important;
}
#pricing.section{
  padding-top: 32px !important;
}


/* v48: remove "air" under Portfolio caused by transform lifting the phone
   Transform doesn't affect document flow, so we компенсируем lift отрицательным margin. */
#portfolio .case__phone{
  margin-bottom: var(--phone-lift) !important; /* --phone-lift is negative => pulls next section up */
}

/* v49: make gap even tighter */
#portfolio.section{
  padding-bottom: 16px !important;
}
#pricing.section{
  padding-top: 16px !important;
}
#portfolio .case__phone{
  margin-bottom: calc(var(--phone-lift) - 40px) !important;
}


/* v56: Portfolio text blocks — keep layout, add vertical регулировка (move text up/down) */
:root{
  --portfolio-text-shift-a: -10px; /* negative = выше, positive = ниже */
  --portfolio-text-shift-b: 50px; /* negative = выше, positive = ниже */
}

/* We shift only the inner content, so the text box size/position stays the same */
#portfolio .portfolio-text__inner{
  transform: translateY(0px);
  will-change: transform;
}
#portfolio .portfolio-text--a .portfolio-text__inner{
  transform: translateY(var(--portfolio-text-shift-a));
}
#portfolio .portfolio-text--b .portfolio-text__inner{
  transform: translateY(var(--portfolio-text-shift-b));
}


/* v57: Portfolio chips rows — add vertical регулировка (move chips up/down) */
:root{
  --portfolio-tags-shift-a: 0px; /* negative = выше, positive = ниже */
  --portfolio-tags-shift-b: -50px; /* negative = выше, positive = ниже */
}

/* Shift only inner content so size/position of tags block stays the same */
#portfolio .case__tags-inner{
  transform: translateY(0px);
  will-change: transform;
}
#portfolio .case__tags--a .case__tags-inner{
  transform: translateY(var(--portfolio-tags-shift-a));
}
#portfolio .case__tags--b .case__tags-inner{
  transform: translateY(var(--portfolio-tags-shift-b));
}


#portfolio .media-carousel{ max-width: 320px; } 
  #portfolio .media-nav.prev{ left: -40px !important; }
  #portfolio .media-nav.next{ right: -40px !important; }



/* =========================================================
   vMOBILE v2: аккуратная мобильная верстка без потерь на ПК
   Десктоп НЕ трогаем: только <= 900 / 768 / 420
   ========================================================= */

/* Large phones / small tablets: сохраняем "главную" в 2 колонки (не сплющено) */
@media (max-width: 900px){
  .container{ padding-left: 18px; padding-right: 18px; }
  .section{ padding: 48px 0; }

  /* Hero: две колонки, но гибко */
  .hero__grid{
    display: grid;
    grid-template-columns: 1.15fr 0.85fr; /* текст шире, визуал уже */
    gap: 18px;
    align-items: start;
  }
  .hero h1{ font-size: 40px; line-height: 1.05; }
  .hero__sub{ font-size: 15px; line-height: 1.55; }
  .hero__actions{ gap: 10px; flex-wrap: wrap; }
  .hero__actions .btn{ padding: 12px 14px; }

  .hero__cards{ grid-template-columns: 1fr; gap: 10px; }
}

/* Phones: можно в 1 колонку, но не "сплющено" */
@media (max-width: 768px){

  .container{ padding-left: 16px; padding-right: 16px; }
  .section{ padding: 44px 0; }

  .section__head h2{ font-size: 28px; line-height: 1.15; }
  .section__head p{ font-size: 15px; line-height: 1.55; }

  /* Header: аккуратно, без сжатия */
  .nav__links{ display:none; }
  .nav{ gap: 10px; }
  .nav__cta{ padding: 12px 14px; border-radius: 14px; font-size: 14px; }

  /* Hero: на телефонах в 1 колонку, но с нормальными размерами */
  .hero__grid{
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .hero h1{ font-size: 34px; line-height: 1.08; }
  .hero__actions{ flex-direction: column; align-items: stretch; gap: 10px; }
  .hero__actions .btn{ width: 100%; }

  /* Portfolio: СНАЧАЛА телефон, снизу текст (как ты просишь) */
  #portfolio .case{
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }
  #portfolio .case__phone{
    order: 1;
    transform: none !important; /* чтобы не уезжал */
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 0; /* не наезжаем на текст */
  }
  #portfolio .case__text{
    order: 2;
  }

  /* Ограничиваем телефон по ширине, чтобы не лез на текст */
  #portfolio .media-carousel{
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
  }
  #portfolio .media-carousel__screen{
    height: min(72vh, 640px);
  }

  /* Стрелки ближе к телефону и не перекрывают текст */
  #portfolio .media-nav.prev{ left: -44px !important; right:auto !important; }
  #portfolio .media-nav.next{ right: -44px !important; left:auto !important; }

  /* Тексты в портфолио — компактнее, но читабельно */
  #portfolio .portfolio-text h3{ font-size: 18px; line-height: 1.25; }
  #portfolio .portfolio-text p{ font-size: 14px; line-height: 1.55; }
  #portfolio .list li{ font-size: 14px; line-height: 1.5; }

  #portfolio .case__tags{ margin-top: 12px; gap: 8px; flex-wrap: wrap; }
  .chip{ font-size: 13px; padding: 9px 11px; border-radius: 999px; }

  /* Pricing: карточки НЕ такие большие */
  #pricing .pricing-grid{
    grid-template-columns: 1fr;
    gap: 10px;
  }
  #pricing .pricing-card{
    padding: 14px;
    border-radius: 18px;
  }
  #pricing .pricing-card h3{ font-size: 17px; }
  #pricing .price{ font-size: 30px; }
  #pricing .pricing-card .btn{ width: 100%; padding: 12px 14px; }

  /* Footer */
  .footer__grid{ grid-template-columns: 1fr; gap: 12px; }
}

/* Small phones */
@media (max-width: 420px){
  .hero h1{ font-size: 30px; }
  #portfolio .media-carousel{ max-width: 310px; }
  #portfolio .media-nav.prev{ left: -38px !important; }
  #portfolio .media-nav.next{ right: -38px !important; }
  #pricing .pricing-card{ padding: 12px; }
}


/* vMOBILE v3 FIX: hero cards should not overlap on phones */
@media (max-width: 768px){

  .hero__visual{
    min-height: auto !important;
    height: auto !important;
    padding-bottom: 0 !important;
  }

  /* Make both glass cards part of normal flow */
  .glass-card{
    position: relative !important;
    inset: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 12px 0 !important;
  }

  /* Ensure their internal sizing stays nice */
  .glass-card__top{ padding: 12px 12px 0 12px !important; }
  .glass-card__body{ padding: 12px !important; }
  .glass-card__body p{ font-size: 14px !important; line-height: 1.5 !important; }

  /* Accent green card should be below, not absolute */
  .hero__accent-block{
    position: relative !important;
    inset: auto !important;
    height: auto !important;
    margin-top: 10px !important;
  }

  .hero__accent-arrow{
    position: absolute; /* keep corner arrow inside the card */
  }
}


/* vMOBILE v4: Hero visual — 2 cards side-by-side + Flexible below (no overlap) */
@media (max-width: 768px){

  .hero__visual{
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    align-items: start !important;
  }

  /* left: 'Персонализированное общение' (light) */
  .glass-card--light{
    grid-column: 1 / 2 !important;
  }

  /* right: 'Welcome' (dark) */
  .glass-card--dark{
    grid-column: 2 / 3 !important;
  }

  /* bottom: Flexible */
  .hero__accent-block{
    grid-column: 1 / -1 !important;
    margin-top: 0 !important;
  }

  /* Ensure cards don't become too tall on tiny screens */
  .glass-card{
    margin: 0 !important; /* grid handles spacing */
    min-height: 0 !important;
  }
}

/* Narrow phones: stack if too tight */
@media (max-width: 420px){
  .hero__visual{
    grid-template-columns: 1fr !important;
  }
  .glass-card--light,
  .glass-card--dark{
    grid-column: 1 / -1 !important;
  }
}

/* =========================================================
   vMOBILE Safety Net: защита от переполнений/наездов
   (строго только для мобильных)
   ========================================================= */
@media (max-width: 768px){
  /* Prevent horizontal scroll due to long words or fixed-width children */
  body{ overflow-x: hidden; }
  img, svg, video, canvas{ max-width: 100%; height: auto; }

  /* Grids/flex items are allowed to shrink */
  .hero__grid > *,
  .split > *,
  .case > *,
  .contact-banner > *{
    min-width: 0;
  }

  /* Better text wrapping inside cards */
  .card, .stat, .step, .contact-banner{
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}



/* === Mobile fix: equal feature cards, no overlap, above Flexible === */
@media (max-width: 768px) {
  .features,
  .features__grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .features .card {
    position: relative;
    width: 100%;
    min-height: 180px;
    z-index: 2;
  }

  .features .card--flexible {
    z-index: 1;
  }
}


/* === Mobile strict equal height for Welcome & Personalized cards === */
@media (max-width: 768px) {
  .features .card--welcome,
  .features .card--personal {
    height: 220px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}


/* === Mobile visual alignment fix (match Welcome card height) === */
@media (max-width: 768px) {
  .features .card--personal {
    height: 260px;
    min-height: 260px;
  }

  .features .card--welcome {
    height: 260px;
    min-height: 260px;
  }
}


/* === Mobile fix: Portfolio phone higher, arrows centered on phone, text stays within section === */
@media (max-width: 768px){
  /* reduce пустоту и приподнять телефон */
  #portfolio .case{
    margin-top: 0 !important;
  }
  #portfolio .case__phone{
    margin-top: -32px; /* поднимаем телефон ближе к заголовку */
    margin-bottom: 14px; /* чтобы текст не прилипал */
  }

  /* делаем высоту экрана по aspect-ratio, чтобы стрелки центрировались по телефону */
  #portfolio .media-carousel__screen{
    height: auto !important;
    max-height: 70vh;
  }
  #portfolio .media-carousel__img{
    width: 100%;
    height: auto !important;
    display:block;
  }

  /* стрелки ровно по середине телефона */
  #portfolio .media-nav{
    top: 50% !important;
    transform: translateY(-50%) !important;
  }
  #portfolio .media-nav.prev{ left: -36px !important; }
  #portfolio .media-nav.next{ right: -36px !important; }

  /* гарантируем, что текст портфолио не уедет под следующий раздел */
  #portfolio{ padding-bottom: 72px; }
  #portfolio .case__text{
    position: relative;
    z-index: 2;
    margin-top: 10px;
  }
}


/* =====================================================================
   MOBILE PATCH: Portfolio (fix overlap + align arrows) — isolated to #portfolio
   ===================================================================== */
@media (max-width: 768px){
  /* RESET problematic desktop/old overrides ONLY inside portfolio */
  #portfolio .case{
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    align-items: stretch !important;
    margin: 0 !important;
  }

  #portfolio .case__phone,
  #portfolio .case__text,
  #portfolio .media-carousel,
  #portfolio .media-carousel__screen,
  #portfolio .media-carousel__img{
    position: relative !important;
    inset: auto !important;
    transform: none !important;
  }

  /* phone first, text second */
  #portfolio .case__phone{ order: 1 !important; }
  #portfolio .case__text{ order: 2 !important; }

  /* Force sane carousel sizing (override any 820px !important from desktop tweaks) */
  #portfolio .media-carousel{
    width: min(340px, 100%) !important;
    max-width: 340px !important;
    margin: -20px auto 0 !important; /* чуть приподнять телефон */
    padding: 0 !important;
  }

  /* Keep phone proportions; make its height count in layout */
  #portfolio .media-carousel__screen{
    width: 100% !important;
    aspect-ratio: 9 / 19.5 !important;
    height: auto !important;
    max-height: 72vh !important;
  }
  #portfolio .media-carousel__img{
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
  }

  /* Arrows — correct selectors (media-nav--prev/--next) and centered on phone */
  #portfolio .media-nav{
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 5 !important;
  }
  #portfolio .media-nav--prev{ left: -36px !important; right: auto !important; }
  #portfolio .media-nav--next{ right: -36px !important; left: auto !important; }

  /* Make sure text can't overlap next section */
  #portfolio{
    position: relative !important;
    padding-bottom: 140px !important; /* гарантированный разрыв перед тарифами */
  }
  #portfolio .case__text{
    margin-top: 0 !important;
  }
}



/* === CRITICAL FIX (mobile): remove translateY transforms that cause overlap ===
   In #portfolio, text/phone were moved via transform (doesn't affect layout),
   so the next section (#pricing) visually overlaps. On mobile we disable transforms
   and use real spacing instead.
*/
@media (max-width: 768px){
  /* neutralize portfolio "lift" variables if any */
  :root{
    --portfolio-lift: 0px !important;
    --portfolio-text-offset: 0px !important;
  }

  #portfolio .case__text,
  #portfolio .case__phone{
    transform: none !important;
  }

  /* use real layout spacing instead of transforms */
  #portfolio .case{
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  /* phone first then text */
  #portfolio .case__phone{ order: 1 !important; margin-top: -20px !important; }
  #portfolio .case__text{ order: 2 !important; }

  /* guarantee space before pricing */
  #portfolio{ padding-bottom: 140px !important; }
}



/* === FINAL mobile fix: stop negative margin pulling Pricing onto Portfolio ===
   Root cause: #portfolio .case__phone has margin-bottom: calc(var(--phone-lift) - 40px) !important;
   and --phone-lift is negative => margin-bottom becomes negative => next section overlaps.
*/
@media (max-width: 768px){
  :root{
    --phone-lift: 0px !important;
    --text-lift: 0px !important;
    --portfolio-text-offset: 0px !important;
    --portfolio-lift: 0px !important;
    --portfolio-text-shift-a: 0px !important;
    --portfolio-text-shift-b: 0px !important;
    --portfolio-tags-shift-a: 0px !important;
    --portfolio-tags-shift-b: 0px !important;
  }

  #portfolio .case__phone{
    transform: none !important;
    margin-bottom: 20px !important; /* positive gap so Pricing starts below */
  }

  #portfolio .case__text{
    transform: none !important;
  }

  #portfolio .portfolio-text__inner{
    transform: none !important;
  }

  #portfolio.section{
    padding-bottom: 60px !important;
  }
  #pricing.section{
    padding-top: 32px !important;
  }
}



/* === Mobile fine-tune: lift portfolio text slightly higher === */
@media (max-width: 768px){
  #portfolio .case__phone{
    margin-bottom: -30px !important; /* было 20px */
  }

  #portfolio.section{
    padding-bottom: 100px !important; /* меньше пустоты, выше текст */
  }
}


/* === Mobile fix: make Portfolio longer so Pricing starts lower (no overlap) === */
@media (max-width: 768px){
  /* increase section height (real spacing) */
  #portfolio.section{
    padding-bottom: 450px !important; /* было 80px — увеличиваем, чтобы тарифы не заходили */
  }

  /* extra safety: ensure Pricing doesn't get pulled up by any negative margins */
  #pricing.section{
    margin-top: 0 !important;
    padding-top: 120px !important;
  }
}

@media (max-width: 768px){

  /* 1) Общие настройки тегов (если нужно): размер, отступы, перенос строк */
  #portfolio .case__tags-inner{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  /* можно менять размер самих “чипов” */
  #portfolio .chip{
    padding: var(--chip-py, 10px) var(--chip-px, 14px);
    font-size: var(--chip-fz, 13px);
    line-height: 1;
  }

  /* 2) Блок A: Салоны красоты / Запись / Уведомления */
  #portfolio .case__tags--a{
    /* ✅ МЕНЯЙ ТУТ: высота/минимальная высота этого блока */
    min-height: var(--tags-a-min-h, 56px);

    /* ✅ МЕНЯЙ ТУТ: внутренние отступы блока */
    padding: var(--tags-a-py, 12px) var(--tags-a-px, 0px);
  }

  /* 3) Блок B: Косметология / Админ-бот / Слоты */
  #portfolio .case__tags--b{
    /* ✅ МЕНЯЙ ТУТ: высота/минимальная высота этого блока */
    min-height: var(--tags-b-min-h, 56px);

    /* ✅ МЕНЯЙ ТУТ: внутренние отступы блока */
    padding: var(--tags-b-py, 12px) var(--tags-b-px, 0px);
  }

  /* 4) Пример: если хочешь быстро “приподнять”/“опустить” только эти блоки */
  #portfolio .case__tags--a{ margin-top: var(--tags-a-mt, 5px); }
  #portfolio .case__tags--b{ margin-top: var(--tags-b-mt, -55px); }
}


/* ===============================
   FIX: показываем carousel images на mobile
   =============================== */
@media (max-width: 768px){

  #portfolio .media-carousel__screen{
    position: relative;
    overflow: hidden;
  }

  #portfolio .media-carousel__img{
    display: block !important;
    position: absolute !important;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 1;
  }

  #portfolio .media-carousel__img.is-active{
    opacity: 1;
    z-index: 2;
  }

}

@media (max-width: 768px){
  :root{
    --m-phone-max: 800px;    /* можно 520..680 */
    --m-phone-w: 300vw;      /* 96vw..100vw */
    --m-phone-scale: 1.6;   /* 1.00..1.20 (увеличивает именно размер) */

    --m-arrow-size: 58px;
    --m-arrow-gap: 16px;
  }

  /* телефон может быть шире контейнера */
  #portfolio .case__phone{
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  #portfolio .case__phone .media-carousel{
    width: min(var(--m-phone-w), var(--m-phone-max)) !important;
    max-width: min(var(--m-phone-w), var(--m-phone-max)) !important;
    margin: 0 auto !important;
    position: relative !important;
  }

  /* снимаем любые ограничения по высоте — пусть масштабируется от ширины */
  #portfolio .case__phone .media-carousel__screen{
    width: 100% !important;
    aspect-ratio: 9 / 19.5 !important;
    height: auto !important;
    max-height: none !important; /* ключ */
    position: relative !important;

    transform: scale(var(--m-phone-scale)) !important;
    transform-origin: center top;
  }

  /* чтобы scale не давал горизонтальный скролл */
  #portfolio{ overflow-x: clip; }
  body{ overflow-x: hidden; }

  /* стрелки симметрично относительно увеличенного телефона */
  #portfolio .case__phone .media-nav{
    width: var(--m-arrow-size) !important;
    height: var(--m-arrow-size) !important;
    line-height: var(--m-arrow-size) !important;
    border-radius: 20px !important;
    top: 80% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
  }
  #portfolio .case__phone .media-nav--prev{ left: calc(var(--m-arrow-gap) * 3) !important; }
  #portfolio .case__phone .media-nav--next{ right: calc(var(--m-arrow-gap) * 3) !important; }
}


/* =====================================================================
   Mobile tweak: lift phone up + improve perceived sharpness (WEB untouched)
   ===================================================================== */
@media (max-width: 768px){
  :root{
    --m-phone-lift: -635px;   /* подними выше: -20px .. -60px */
  }

  /* Поднимаем блок телефона вверх */
  #portfolio .case__phone{
    margin-top: var(--m-phone-lift) !important;
  }

  /* Чуть лучше рендер при трансформациях (особенно iOS/Safari) */
  #portfolio .case__phone .media-carousel__screen,
  #portfolio .case__phone .media-carousel__img{
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    image-rendering: auto;
  }

  /* Если делаешь scale > 1.1, источники должны быть 2x, иначе будет мыло */
}




/* =====================================================================
   MOBILE CONTROL: move WHOLE portfolio text blocks up/down (WEB untouched)
   Controls both: (A) Интеллектуальная система... and (B) Система записи...
   ===================================================================== */
@media (max-width: 768px){
  :root{
    --m-text-a-shift: 115px;  /* весь текст блока A */
    --m-text-b-shift: 175px;  /* весь текст блока B */
  }

  /* A: первый текстовый блок (тот, который НЕ portfolio-text--b) */
  #portfolio .portfolio-text:not(.portfolio-text--b) .portfolio-text__inner{
    transform: translateY(var(--m-text-a-shift)) !important;
  }

  /* B: второй текстовый блок */
  #portfolio .portfolio-text--b .portfolio-text__inner{
    transform: translateY(var(--m-text-b-shift)) !important;
  }
}



/* =====================================================================
   MOBILE: make pricing cards more compact (WEB untouched)
   ===================================================================== */
@media (max-width: 768px){
  /* Карточки тарифов */
  #pricing .price.card{
    padding: 14px 14px 14px !important;   /* было крупнее */
    border-radius: 28px !important;
  }

  #pricing .price__top h3{
    font-size: 24px !important;
    margin: 0 0 8px !important;
  }

  #pricing .price__value{
    font-size: 24px !important;          /* было 28px */
    line-height: 1.1 !important;
    margin: 0 0 8px !important;
  }
  #pricing .price__value span{
    font-size: 13px !important;
  }

  #pricing .price__top p{
    font-size: 14px !important;
    margin: 0 0 10px !important;
    line-height: 1.4 !important;
  }

  /* Список преимуществ — плотнее */
  #pricing .checklist{
    margin: 10px 0 0 !important;
  }
  #pricing .checklist li{
    padding-left: 22px !important; /* было 26px */
    margin: 7px 0 !important;      /* было 10px */
    line-height: 1.35 !important;
    font-size: 14px !important;
  }
  #pricing .checklist li::before{
    width: 16px !important;
    height: 16px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    top: 1px !important;
  }

  /* Кнопка — ниже по высоте */
  #pricing .btn--full{
    padding: 14px 16px !important;
    border-radius: 22px !important;
    font-size: 16px !important;
    margin-top: 14px !important;
  }
}



/* ===============================
   Animated green background (web + mobile)
   =============================== */
:root{
  --bg-accent: rgba(191, 255, 96, 0.28);
  --bg-accent-2: rgba(191, 255, 96, 0.12);
}

body{
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after{
  content:"";
  position: fixed;
  inset: -20vh -20vw;
  pointer-events: none;
  z-index: -1;
  filter: blur(18px);
  opacity: 0.75;
  transform-origin: center;
}

body::before{
  background:
    radial-gradient(closest-side, var(--bg-accent), transparent 65%),
    radial-gradient(closest-side, var(--bg-accent-2), transparent 70%);
  animation: bgSpin1 18s linear infinite;
}

body::after{
  background:
    radial-gradient(closest-side, rgba(191,255,96,0.18), transparent 60%),
    radial-gradient(closest-side, rgba(191,255,96,0.10), transparent 72%);
  animation: bgSpin2 26s linear infinite;
  mix-blend-mode: multiply;
}

@keyframes bgSpin1{
  from { transform: rotate(0deg) scale(1.05); }
  to   { transform: rotate(360deg) scale(1.05); }
}

@keyframes bgSpin2{
  from { transform: rotate(360deg) scale(1.10); }
  to   { transform: rotate(0deg) scale(1.10); }
}

/* ===============================
   Black frame + subtle green gradient
   =============================== */
.hero-frame{
  border: 1px solid rgba(191,255,96,0.35);
  background:
    linear-gradient(135deg, rgba(191,255,96,0.10), rgba(0,0,0,0.85) 35%, rgba(0,0,0,0.92)),
    rgba(0,0,0,0.88);
  border-radius: 22px;
  padding: 16px 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  backdrop-filter: blur(6px);
}

.hero-frame p{
  margin: 0;
  color: rgba(255,255,255,0.86);
}

@media (max-width: 768px){
  body::before, body::after{
    filter: blur(22px);
    opacity: 0.65;
  }
  .hero-frame{
    padding: 14px 14px;
    border-radius: 18px;
  }
}



/* ===============================
   Hero title frame (web + mobile)
   =============================== */
.hero-title-frame{
  display: inline-block;
  border: 1px solid rgba(191,255,96,0.35);
  background:
    linear-gradient(135deg, rgba(191,255,96,0.14), rgba(0,0,0,0.85) 40%, rgba(0,0,0,0.92)),
    rgba(0,0,0,0.9);
  border-radius: 28px;
  padding: 18px 22px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
}

.hero-title-frame h1,
.hero-title-frame h2{
  margin: 0;
  color: #fff;
}

@media (max-width: 768px){
  .hero-title-frame{
    padding: 14px 16px;
    border-radius: 22px;
  }
}



/* ===============================
   Hero full frame (title + text + buttons)
   =============================== */
.hero-title-frame{
  display: inline-block;
  border: 1px solid rgba(191,255,96,0.35);
  background:
    linear-gradient(135deg, rgba(191,255,96,0.14), rgba(0,0,0,0.85) 40%, rgba(0,0,0,0.92)),
    rgba(0,0,0,0.9);
  border-radius: 32px;
  padding: 22px 24px 26px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
  max-width: 880px;
}

.hero-title-frame h1{
  margin: 0 0 14px;
  color: #fff;
}

.hero-title-frame p{
  margin: 0 0 20px;
  color: rgba(255,255,255,0.82);
  line-height: 1.5;
}

.hero-title-frame .hero-actions{
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

@media (max-width: 768px){
  .hero-title-frame{
    padding: 16px 16px 18px;
    border-radius: 22px;
  }
  .hero-title-frame .hero-actions{
    gap: 10px;
  }
}
