/* =========================================================
   صفحه‌ی خدمات — کارت‌های سه‌بعدی
   هر کارت: کج‌شدن با ماوس + بازتاب نور + یک شیء سه‌بعدی اختصاصی
   ⚠️ روی والدهای زنجیره‌ی preserve-3d هرگز overflow: hidden / filter
   نگذارید؛ عمق سه‌بعدی را صاف (flat) می‌کند.
   ========================================================= */

.page { padding-top: var(--header-h); }

.services {
  position: relative;
  isolation: isolate;
  padding: clamp(64px, 7vw, 112px) var(--gutter);                /* بالا = پایین */
}

.services__glow {
  position: absolute;
  z-index: -1;
  inset: -10% 0 auto 0;
  height: 70vh;
  background: radial-gradient(60% 60% at 70% 0%, rgba(255, 106, 0, .16), transparent 70%);
  pointer-events: none;
}

.services__title {
  margin: 0 0 clamp(28px, 3.5vw, 48px);
  font-size: var(--fs-h);
  font-weight: 800;
  line-height: 1.3;
  color: var(--brand);
}

/* ۵ کارت: ردیف اول ۳ تا، ردیف دوم ۲ تای پهن‌تر */
.services__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(18px, 2vw, 28px);
}
.svc { grid-column: span 2; }
/* ردیف دوم: دو کارت هم‌اندازه‌ی بالا، وسط؛ ستون اول و ششم = مکعب‌های شیشه‌ای (RTL: ستون ۱ سمت راست) */
.svc:nth-child(4) { grid-row: 2; grid-column: 2 / span 2; }
.svc:nth-child(5) { grid-row: 2; grid-column: 4 / span 2; }
.svc-deco--right { grid-row: 2; grid-column: 1; }
.svc-deco--left  { grid-row: 2; grid-column: 6; }

/* ---------------------------------------------------------
   کارت
   --------------------------------------------------------- */
.svc {
  --rx: 0deg;        /* کج‌شدن — از JS */
  --ry: 0deg;
  --gx: 50%;         /* موقعیت بازتاب نور */
  --gy: 0%;
  --go: 0;           /* شدت بازتاب */
  perspective: 1100px;
  /* ورود با اسکرول */
  opacity: 0;
  transform: translate3d(0, 70px, 0) rotateX(-18deg);
  transform-origin: 50% 100%;
  transition: opacity .9s var(--ease-out), transform 1.2s var(--ease-out);
}
.svc.is-in { opacity: 1; transform: none; }

.svc__inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--surface-line);
  border-radius: 24px;
  background:
    radial-gradient(80% 55% at 50% 0%, rgba(255, 106, 0, .13), transparent 70%),
    linear-gradient(180deg, #170b05, #110804);
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .6s var(--ease-out), border-color .5s var(--ease-out), box-shadow .6s var(--ease-out);
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, .9);
}
.svc.is-tilting .svc__inner { transition: border-color .5s var(--ease-out), box-shadow .6s var(--ease-out); }
.svc:hover .svc__inner,
.svc.is-active .svc__inner {
  border-color: rgba(255, 140, 60, .35);
  box-shadow: 0 40px 80px -40px rgba(255, 106, 0, .35), 0 30px 60px -40px rgba(0, 0, 0, .9);
}

/* صحنه‌ی شیء */
.svc__stage {
  position: relative;
  height: clamp(240px, 21vw, 300px);
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  transform: translateZ(50px);
}

.svc__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 clamp(24px, 2.4vw, 36px) clamp(24px, 2.4vw, 34px);
  transform: translateZ(30px);
  transform-style: preserve-3d;
}

.svc__title {
  margin: 0;
  font-size: var(--fs-h);
  font-weight: 700;
  line-height: 1.5;
}
.svc__text {
  flex: 1;
  margin: 12px 0 24px;
  font-size: var(--fs-t);
  font-weight: 300;
  line-height: 2;
  color: var(--fg-dim);
  text-wrap: pretty;
}

/* دکمه‌ی «اطلاعات بیشتر» — سمت چپ کادر (RTL: flex-end) */
.more {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 22px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  color: #fff;
  font-size: var(--fs-t);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transform: translateZ(20px);
  transition: background .35s var(--ease-out), border-color .35s var(--ease-out);
}
.more__label { overflow: hidden; text-overflow: ellipsis; }
.more__icon { flex: none; transition: transform .45s var(--ease-out); }
.more:hover,
.more:focus-visible { background: var(--brand); border-color: var(--brand); }
.more:hover .more__icon,
.more:focus-visible .more__icon { transform: translateX(-5px); }
.more:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
/* کل کارت قابل کلیک — با JS (لینک transform دارد و ::after نمی‌تواند کل کارت را بپوشاند) */
.svc__inner { cursor: pointer; }

/* بازتاب نور — خودش overflow دارد، نه والدها */
.svc__glare {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  overflow: hidden;
  pointer-events: none;
  transform: translateZ(1px);
}
.svc__glare::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(500px circle at var(--gx) var(--gy), rgba(255, 200, 150, .14), transparent 45%);
  opacity: var(--go);
  transition: opacity .5s var(--ease-out);
}

/* ---------------------------------------------------------
   اشیای سه‌بعدی — پایه
   --------------------------------------------------------- */
.obj {
  --sz: clamp(170px, 15vw, 210px);
  position: relative;
  top: 22px;   /* کمی پایین‌تر از مرکز تا لایه‌های بالارفته از لبه‌ی کارت بیرون نزنند */
  width: var(--sz);
  height: var(--sz);
  transform-style: preserve-3d;
}
.obj * { transform-style: preserve-3d; }

/* ========== ۰۱ هویت بصری: لایه‌های برند که از هم باز می‌شوند ========== */
.obj--identity {
  --gap: 16px;
  transform: rotateX(58deg) rotateZ(-42deg);
  animation: bob 6s ease-in-out infinite;
}
.svc:hover .obj--identity,
.svc.is-active .obj--identity { --gap: 30px; }

.plate {
  position: absolute;
  inset: 14%;
  border-radius: 14px;
  transition: transform .9s var(--ease-out);
}
.plate--card {
  transform: translateZ(0);
  background: linear-gradient(135deg, #5a1d02, #3a1201);
  box-shadow: 0 0 0 1px rgba(255, 140, 60, .25), 0 30px 40px rgba(0, 0, 0, .5);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 7px;
  padding: 16%;
}
.plate--card i { display: block; height: 5px; border-radius: 3px; background: rgba(255, 170, 110, .45); }
.plate--card i:nth-child(1) { width: 60%; }
.plate--card i:nth-child(2) { width: 85%; }
.plate--card i:nth-child(3) { width: 40%; }

.plate--palette {
  transform: translateZ(calc(var(--gap) * 1));
  background: rgba(255, 106, 0, .12);
  box-shadow: inset 0 0 0 1px rgba(255, 160, 90, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10%;
}
.plate--palette b { width: 20%; aspect-ratio: 1; border-radius: 50%; }
.plate--palette b:nth-child(1) { background: #ff6a00; }
.plate--palette b:nth-child(2) { background: #ffb26b; }
.plate--palette b:nth-child(3) { background: #fff3e8; }

.plate--type {
  transform: translateZ(calc(var(--gap) * 2));
  background: rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
  display: grid;
  place-items: center;
}
.plate--type span {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: calc(var(--sz) * .26);
  line-height: 1;
  color: rgba(255, 255, 255, .9);
}

.plate--mark {
  transform: translateZ(calc(var(--gap) * 3));
  inset: 22%;
  border-radius: 8px;
  background:
    linear-gradient(to top right, rgba(255, 255, 255, .14) 50%, transparent 50%),
    linear-gradient(135deg, #ff9a3d, #ff6a00 55%, #e8500c);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .35), 0 20px 40px -10px rgba(255, 106, 0, .6);
}
.plate--mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(200, 50, 0, .35);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

/* ========== ۰۲ گرافیک: آرت‌بورد با منحنی بزیه + اشکال شناور ========== */
.obj--graphic {
  top: 44px;   /* اشکال شناور بالاتر از آرت‌بورد می‌روند؛ جبران ارتفاع */
  transform: rotateX(56deg) rotateZ(-38deg);
  animation: bob 6.5s ease-in-out infinite;
}
.artboard {
  position: absolute;
  inset: 6%;
  border-radius: 14px;
  background:
    linear-gradient(rgba(255, 140, 60, .1) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, rgba(255, 140, 60, .1) 1px, transparent 1px) 0 0 / 20px 20px,
    #1d0d05;
  box-shadow: 0 0 0 1px rgba(255, 140, 60, .3), 0 40px 50px rgba(0, 0, 0, .55);
}
.artboard__svg { width: 100%; height: 100%; }
.bezier {
  fill: none;
  stroke: #ff6a00;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  animation: draw 4.5s var(--ease-io) infinite;
}
.handle { fill: none; stroke: rgba(255, 255, 255, .45); stroke-width: 1.5; stroke-dasharray: 3 4; }
.node { fill: #fff; stroke: #ff6a00; stroke-width: 2; }
.knob { fill: #ff6a00; }
@keyframes draw {
  0%       { stroke-dashoffset: 260; }
  45%, 75% { stroke-dashoffset: 0; }
  100%     { stroke-dashoffset: -260; }
}

.shape {
  position: absolute;
  transition: transform 1s var(--ease-out);
}
.shape--circle {
  width: 26%; height: 26%;
  left: 12%; top: 14%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffc08a, #ff6a00 60%, #c94a05);
  transform: translateZ(50px);
  animation: hover-a 5s ease-in-out infinite;
}
.shape--tri {
  width: 28%; height: 28%;
  right: 10%; top: 30%;
  background: linear-gradient(135deg, #fff3e8, #ffb26b);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: translateZ(80px);
  animation: hover-b 6s ease-in-out infinite;
}
.shape--square {
  width: 20%; height: 20%;
  left: 40%; bottom: 10%;
  border-radius: 4px;
  border: 3px solid #fff;
  transform: translateZ(110px);
  animation: spin-z 9s linear infinite;
}
.svc:hover .shape--circle,
.svc.is-active .shape--circle { translate: 0 0 16px; }
.svc:hover .shape--tri,
.svc.is-active .shape--tri { translate: 0 0 24px; }
.svc:hover .shape--square,
.svc.is-active .shape--square { translate: 0 0 30px; }

@keyframes hover-a { 0%, 100% { transform: translateZ(50px); } 50% { transform: translateZ(70px); } }
@keyframes hover-b { 0%, 100% { transform: translateZ(80px) rotateZ(0); } 50% { transform: translateZ(100px) rotateZ(12deg); } }
@keyframes spin-z  { from { transform: translateZ(110px) rotateZ(0); } to { transform: translateZ(110px) rotateZ(360deg); } }

/* ========== ۰۳ عکاسی: لنز با حلقه‌های لایه‌ای و دیافراگم چرخان ========== */
.obj--lens {
  --z: 14px;
  top: 6px;   /* لنز گرد است و تا پایین صحنه می‌رسد؛ کمی بالاتر از بقیه */
  transform: rotateX(16deg) rotateY(-32deg);
  animation: sway 7s ease-in-out infinite;
}
.svc:hover .obj--lens,
.svc.is-active .obj--lens { --z: 26px; }
.ring {
  position: absolute;
  border-radius: 50%;
  transition: transform .9s var(--ease-out);
}
.ring--1 {
  inset: 0;
  background: radial-gradient(circle, #2a0f04 55%, #4a1a05 56%, #2a0f04 70%);
  box-shadow: 0 0 0 2px rgba(255, 140, 60, .35), 0 30px 50px rgba(0, 0, 0, .6);
  transform: translateZ(0);
}
.ring--2 {
  inset: 8%;
  background: repeating-conic-gradient(from 0deg, #ff6a00 0 3deg, #c94a05 3deg 6deg);
  -webkit-mask: radial-gradient(circle, transparent 78%, #000 79%);
  mask: radial-gradient(circle, transparent 78%, #000 79%);
  transform: translateZ(var(--z));
  animation: spin-ring 14s linear infinite;
}
.ring--3 {
  inset: 16%;
  background: #1a0903;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
  transform: translateZ(calc(var(--z) * 2));
}
.ring--4 {
  inset: 24%;
  display: grid;
  place-items: center;
  background: #0e0502;
  transform: translateZ(calc(var(--z) * 2.6));
}
.aperture { width: 92%; height: 92%; }
.aperture g {
  fill: #ff6a00;
  stroke: #1a0903;
  stroke-width: 1.5;
  transform-origin: 50px 50px;
  animation: aperture 5s var(--ease-io) infinite;
}
.ring--glass {
  inset: 22%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .55), transparent 22%),
    radial-gradient(circle at 70% 75%, rgba(255, 160, 90, .25), transparent 35%),
    rgba(255, 255, 255, .04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3);
  transform: translateZ(calc(var(--z) * 3.4));
}
@keyframes spin-ring { to { rotate: 360deg; } }
@keyframes aperture {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50%      { transform: rotate(60deg) scale(.82); }
}

/* ========== ۰۴ ادمین: گوشی + اعلان‌های شناور ========== */
.obj--admin {
  transform: rotateX(14deg) rotateY(-30deg) rotateZ(3deg);
  animation: sway 7.5s ease-in-out infinite;
}
.phone {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52%;
  height: 96%;
  margin: -48% 0 0 -26%;
}
.phone__back {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: #3a1201;
  transform: translateZ(-10px);
  box-shadow: 0 30px 50px rgba(0, 0, 0, .6);
}
.phone__screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18% 10% 10%;
  border-radius: 22px;
  background: linear-gradient(180deg, #1f0c04, #120602);
  box-shadow: inset 0 0 0 3px #ff6a00, inset 0 0 0 5px #120602;
}
.ui { display: block; border-radius: 4px; }
.ui--bar  { height: 8%; background: rgba(255, 255, 255, .12); }
.ui--post { flex: 1; border-radius: 8px; background: linear-gradient(135deg, #ff9a3d, #ff6a00 60%, #c94a05); }
.ui--line { height: 5%; background: rgba(255, 255, 255, .16); }
.ui--short { width: 60%; }

.bubble {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #fff;
  color: #ff6a00;
  box-shadow: 0 12px 24px rgba(0, 0, 0, .35);
  animation: rise 4s var(--ease-io) infinite;
}
.bubble svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bubble--1 { right: -6%; top: 22%; --z: 60px; background: #ff6a00; color: #fff; }
.bubble--1 svg { fill: currentColor; stroke: none; }
.bubble--2 { left: -4%;  top: 40%; --z: 80px; animation-delay: -1s; }
.bubble--3 { right: 2%;  top: 62%; --z: 45px; animation-delay: -2s; }
.bubble--4 { left: 8%;   top: 12%; --z: 100px; animation-delay: -3s; width: 36px; height: 36px; border-radius: 50%; background: #ffb26b; color: #3a1201; }
@keyframes rise {
  0%   { transform: translateZ(var(--z)) translateY(16px) scale(.85); opacity: 0; }
  20%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translateZ(var(--z)) translateY(-26px) scale(1); opacity: 0; }
}
.svc:hover .bubble,
.svc.is-active .bubble { animation-duration: 2.6s; }

/* ========== ۰۵ وب: پنجره‌های مرورگر لایه‌لایه ========== */
.obj--web {
  --sp: 1;
  transform: rotateX(18deg) rotateY(-34deg);
  animation: sway 8s ease-in-out infinite;
}
.svc:hover .obj--web,
.svc.is-active .obj--web { --sp: 1.9; }
.win {
  position: absolute;
  width: 92%;
  height: 66%;
  left: 4%;
  top: 17%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 14px repeat(2, 1fr);
  gap: 7px;
  padding: 0 10px 10px;
  border-radius: 12px;
  transition: transform .9s var(--ease-out);
}
.win__bar {
  grid-column: 1 / -1;
  align-self: center;
  height: 6px;
  width: 26px;
  border-radius: 3px;
  background:
    radial-gradient(circle, currentColor 2.5px, transparent 3px) 0 50% / 9px 6px repeat-x;
  color: rgba(255, 255, 255, .5);
}
.win--back {
  transform: translate3d(calc(18px * var(--sp)), calc(-18px * var(--sp)), calc(-40px * var(--sp)));
  background: #2a0f04;
  box-shadow: 0 0 0 1px rgba(255, 140, 60, .25), 0 30px 50px rgba(0, 0, 0, .55);
}
.win--mid {
  transform: translateZ(0);
  background: rgba(30, 12, 4, .92);
  box-shadow: 0 0 0 1px rgba(255, 140, 60, .35);
  grid-template-rows: 14px repeat(4, 1fr);
  grid-template-columns: 1fr;
}
.win--front {
  transform: translate3d(calc(-18px * var(--sp)), calc(18px * var(--sp)), calc(40px * var(--sp)));
  background: linear-gradient(180deg, #ff8a2a, #ff6a00);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .35), 0 24px 40px -10px rgba(255, 106, 0, .55);
}
.win--front .win__bar { color: rgba(255, 255, 255, .8); }
.blk { border-radius: 6px; }
.blk--img  { background: rgba(255, 140, 60, .28); grid-row: span 2; }
.blk--hero { grid-column: 1 / -1; background: rgba(255, 255, 255, .85); }
.blk--col  { grid-column: span 1; background: rgba(255, 255, 255, .45); }
.blk--col:last-child { grid-column: span 2; }
.code {
  display: block;
  align-self: center;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, #ff6a00 0 30%, rgba(255, 255, 255, .3) 30% 70%, #ffb26b 70%);
  width: 80%;
}
.code--2 { width: 55%; margin-right: 14%; }
.code--3 { width: 70%; margin-right: 14%; }
.code--4 { width: 40%; }

/* ---------- حرکات مشترک ---------- */
@keyframes bob {
  0%, 100% { translate: 0 0 0; }
  50%      { translate: 0 0 14px; }
}
@keyframes sway {
  0%, 100% { translate: 0 -6px; }
  50%      { translate: 0 6px; }
}

/* ---------------------------------------------------------
   ریسپانسیو
   --------------------------------------------------------- */
@media (max-width: 1099px) {
  .services__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .svc,
  .svc:nth-child(4),
  .svc:nth-child(5) { grid-row: auto; grid-column: span 1; }
  /* آخری: هم‌اندازه‌ی بقیه، وسط */
  .svc:nth-child(5) { grid-column: 1 / -1; justify-self: center; width: calc(50% - clamp(18px, 2vw, 28px) / 2); }
}

@media (max-width: 639px) {
  .services__grid { grid-template-columns: 1fr; gap: 18px; }
  .svc:nth-child(5) { grid-column: auto; width: auto; justify-self: stretch; }
  .svc__stage { height: 230px; }
  .obj { --sz: 160px; top: 26px; }
  .svc.is-active .obj--identity { --gap: 24px; }
  .obj--graphic { top: 50px; }
  .obj--lens { top: 0; }
  .svc__inner { border-radius: 20px; }
  .svc__glare { border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .svc { transform: none; transition: opacity .3s linear; }
  .obj, .obj *, .bezier, .aperture g { animation: none !important; }
  .bezier { stroke-dashoffset: 0; }
  .gcube { animation: none !important; }
  .bubble { opacity: 1; transform: translateZ(var(--z)); }
}

/* ---------------------------------------------------------
   نسخه‌ی صفحه‌ی اول (بعد از اسکرول موشن، قبل از مکعب همکاری)
   فاصله‌ی بالا و پایین برابر است؛ JS (services.js) فاصله‌ی داخلی
   مکعبِ بعدی را اندازه می‌گیرد و padding پایین را طوری تنظیم
   می‌کند که فاصله‌ی دیداری پایین = فاصله‌ی دیداری بالا شود.
   --------------------------------------------------------- */
.services--home {
  --gap-min: clamp(72px, 8vw, 128px);
  padding-top: var(--gap-min);
  padding-bottom: 0;
}

/* ---------------------------------------------------------
   مکعب‌های شیشه‌ای تزئینی (دو طرف ردیف دوم)
   --------------------------------------------------------- */
.svc-deco {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
  perspective: 900px;
  pointer-events: none;
}
.svc-deco::before {               /* هاله‌ی نارنجی زیر مکعب */
  content: "";
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 106, 0, .22), transparent);
  filter: blur(10px);
}

.gcube {
  --c: 110px;
  --dur: 16s;
  position: relative;
  width: var(--c);
  height: var(--c);
  transform-style: preserve-3d;
  animation: gspin var(--dur) linear infinite;
}
.gcube__f {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 190, 140, .55);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 140, 60, .05) 55%, rgba(255, 106, 0, .12));
  box-shadow: inset 0 0 22px rgba(255, 106, 0, .22), 0 0 18px rgba(255, 106, 0, .08);
}
.gcube__f--front  { transform: translateZ(calc(var(--c) / 2)); }
.gcube__f--back   { transform: rotateY(180deg) translateZ(calc(var(--c) / 2)); }
.gcube__f--right  { transform: rotateY(90deg)  translateZ(calc(var(--c) / 2)); }
.gcube__f--left   { transform: rotateY(-90deg) translateZ(calc(var(--c) / 2)); }
.gcube__f--top    { transform: rotateX(90deg)  translateZ(calc(var(--c) / 2)); }
.gcube__f--bottom { transform: rotateX(-90deg) translateZ(calc(var(--c) / 2)); }

/* هسته‌ی نارنجی داخل مکعب شیشه‌ای — ارجاع به «Orange Squre» */
.gcube--core {
  position: absolute;
  inset: 29%;                       /* هسته = ۴۲٪ ضلع مکعب شیشه‌ای */
  width: auto;
  height: auto;
  animation: gspin-rev 9s linear infinite;
}
.gcube--core .gcube__f {
  border: 0;
  border-radius: 3px;
  background: linear-gradient(135deg, #ff9a3d, #ff6a00 55%, #e8500c);
  box-shadow: 0 0 24px rgba(255, 106, 0, .55);
}
.gcube--lg  { --c: clamp(96px, 8vw, 128px); }
.gcube--lg .gcube--core { --core: calc(clamp(96px, 8vw, 128px) * .42); }
.gcube--md  { --c: clamp(70px, 5.6vw, 90px); --dur: 13s; }
.gcube--md .gcube--core { --core: calc(clamp(70px, 5.6vw, 90px) * .42); }
.gcube--sm  { --c: 46px; --dur: 11s; position: absolute; top: 14%; right: 18%; animation-direction: reverse; }
.gcube--xs  { --c: 28px; --dur: 9s;  position: absolute; bottom: 16%; left: 20%; }
/* هسته: وجه‌ها با اندازه‌ی خود هسته جابه‌جا شوند */
.gcube--core .gcube__f--front  { transform: translateZ(calc(var(--core) / 2)); }
.gcube--core .gcube__f--back   { transform: rotateY(180deg) translateZ(calc(var(--core) / 2)); }
.gcube--core .gcube__f--right  { transform: rotateY(90deg)  translateZ(calc(var(--core) / 2)); }
.gcube--core .gcube__f--left   { transform: rotateY(-90deg) translateZ(calc(var(--core) / 2)); }
.gcube--core .gcube__f--top    { transform: rotateX(90deg)  translateZ(calc(var(--core) / 2)); }
.gcube--core .gcube__f--bottom { transform: rotateX(-90deg) translateZ(calc(var(--core) / 2)); }

/* شناوری آرام + چرخش */
.gcube--a { animation: gspin 11s linear infinite reverse, gfloat 5s ease-in-out infinite; }
.gcube--c { animation: gspin 9s linear infinite, gfloat 4s ease-in-out -2s infinite; }
@keyframes gspin     { from { transform: rotateX(-22deg) rotateY(0deg); }   to { transform: rotateX(-22deg) rotateY(360deg); } }
@keyframes gspin-rev { from { transform: rotateX(35deg) rotateY(360deg) rotateZ(0deg); } to { transform: rotateX(35deg) rotateY(0deg) rotateZ(360deg); } }
@keyframes gfloat    { 0%, 100% { translate: 0 -8px; } 50% { translate: 0 8px; } }

/* باید بعد از تعریف پایه‌ی .svc-deco بیاید (هم‌ارزی specificity ⇒ ترتیب مهم است) */
@media (max-width: 1099px) {
  .svc-deco { display: none; }
}
