/* ==========================================================================
   Services — four illustrated tiles in a staggered bento
   Each illustration is built from HTML/CSS and sized in `em`; its root font-size
   is derived from the container (cqw/cqh), so it scales to any tile.
   ========================================================================== */

.services::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 40% at 50% 0%, rgba(71, 123, 255, 0.12), transparent 70%);
  pointer-events: none;
}
.services .container { position: relative; }
.services__title { max-width: 12em; }

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.7rem, 1.2vw, 1.1rem);
}
.tile--design, .tile--redesign { grid-column: span 7; }
.tile--dev, .tile--landing { grid-column: span 5; }
@media (max-width: 900px) {
  .tile--design, .tile--redesign, .tile--dev, .tile--landing { grid-column: 1 / -1; }
}

/* ---------- Tile shell ---------- */

.tile {
  --mx: 50%;
  --my: 50%;
  --tint: rgba(71, 123, 255, 0.24);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 1.7rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01));
}
.tile--design { --tint: rgba(124, 92, 255, 0.26); }
.tile--dev { --tint: rgba(71, 123, 255, 0.26); }
.tile--landing { --tint: rgba(255, 140, 90, 0.18); }
.tile--redesign { --tint: rgba(91, 138, 255, 0.24); }

.tile > article { position: relative; z-index: 2; display: flex; flex-direction: column; height: 100%; }

/* border that glows where the pointer is */
.tile__fx { position: absolute; inset: 0; z-index: 3; --mx: 50%; --my: 50%; border-radius: inherit; pointer-events: none; }
.tile__fx::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background:
    radial-gradient(460px circle at var(--mx) var(--my), rgba(143, 176, 255, 0.95), transparent 45%),
    linear-gradient(180deg, var(--line-strong), var(--line));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
.tile__fx::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(71, 123, 255, 0.14), transparent 60%);
  opacity: 0;
  transition: opacity 0.6s;
  pointer-events: none;
}
.tile:hover .tile__fx::after { opacity: 1; }

.tile__art {
  position: relative;
  height: clamp(15.5rem, 24vw, 21rem);
  container-type: size;
  overflow: hidden;
  background: radial-gradient(70% 90% at 50% 125%, var(--tint), transparent 70%);
}
/* faint blueprint grid behind the illustration */
.tile__art::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 2.2rem 2.2rem;
  -webkit-mask-image: radial-gradient(60% 75% at 50% 50%, #000 10%, transparent 100%);
  mask-image: radial-gradient(60% 75% at 50% 50%, #000 10%, transparent 100%);
}

.tile__text {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.3rem;
  align-items: start;
  margin-top: auto;
  padding: 1.5rem clamp(1.3rem, 2.2vw, 2.1rem) clamp(1.5rem, 2.3vw, 2.1rem);
  border-top: 1px solid var(--line);
}
.tile__num {
  font-family: var(--serif);
  font-size: clamp(3rem, 4.4vw, 4.4rem);
  line-height: 0.78;
  color: transparent;
  -webkit-text-stroke: 1px rgba(143, 176, 255, 0.55);
  transition: -webkit-text-stroke-color 0.5s;
}
.tile:hover .tile__num { -webkit-text-stroke-color: #b4cbff; }
.tile__text h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 2.7vw, 2.7rem);
  line-height: 1.04;
  letter-spacing: -0.012em;
}
.tile__text p { margin-top: 0.65rem; max-width: 28em; font-size: 0.96rem; color: var(--muted); }

@media (max-width: 520px) {
  .tile__text { grid-template-columns: 1fr; gap: 0.7rem; }
}

/* ---------- Shared illustration pieces ---------- */

.stage {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  transition: transform 1.1s var(--ease);
}
.tile:hover .stage { transform: translate(-50%, -50%) scale(1.045); }

.glass {
  position: absolute;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025));
  border: 0.07em solid rgba(255, 255, 255, 0.15);
  border-radius: 1em;
  box-shadow: 0 1.4em 3em -1.2em rgba(0, 0, 0, 0.85), inset 0 0.07em 0 rgba(255, 255, 255, 0.1);
}
.sk { display: block; width: var(--w, 100%); height: 0.62em; border-radius: 99em; background: rgba(255, 255, 255, 0.17); }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.55em); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes sheen { 0%, 30% { transform: translateX(-120%); } 70%, 100% { transform: translateX(120%); } }

/* ---------- 01 · Design ---------- */

.stage--design { width: 36em; height: 16em; font-size: min(calc(100cqw / 37), calc(100cqh / 16.6)); }

.d-win { left: 1em; top: 0.8em; width: 24.5em; height: 14.4em; }
.d-bar, .c-bar { display: flex; align-items: center; gap: 0.45em; height: 1.7em; padding: 0 0.9em; border-bottom: 0.07em solid rgba(255, 255, 255, 0.1); }
.d-bar i, .c-bar i { width: 0.5em; height: 0.5em; border-radius: 50%; background: rgba(255, 255, 255, 0.25); }

.d-sel {
  position: absolute;
  left: 1.3em; top: 2.9em;
  width: 14.2em; height: 7.6em;
  display: flex; flex-direction: column; justify-content: center; gap: 0.6em;
  padding: 1.1em 1.3em;
  border: 0.1em solid #477bff;
  background: rgba(71, 123, 255, 0.09);
}
.hd { position: absolute; width: 0.75em; height: 0.75em; background: #fff; border: 0.1em solid #477bff; border-radius: 0.15em; }
.hd--tl { left: -0.42em; top: -0.42em; }
.hd--tr { right: -0.42em; top: -0.42em; }
.hd--bl { left: -0.42em; bottom: -0.42em; }
.hd--br { right: -0.42em; bottom: -0.42em; }
.d-btn { display: block; width: 4.8em; height: 1.6em; margin-top: 0.35em; border-radius: 99em; background: linear-gradient(135deg, #7aa0ff, #477bff); box-shadow: 0 0 1.6em rgba(71, 123, 255, 0.75); }

.d-img { position: absolute; right: 1.3em; top: 2.9em; width: 7.2em; height: 7.6em; overflow: hidden; border-radius: 0.8em; background: linear-gradient(150deg, #477bff, #7c5cff 58%, #ff9a63); }
.d-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.38) 50%, transparent 65%); animation: sheen 5.5s ease-in-out infinite; }
.d-row { position: absolute; left: 1.3em; right: 1.3em; bottom: 1.2em; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1em; }
.d-row .sk { height: 0.5em; }

.d-pal { left: 23.4em; top: 0; width: 11.6em; height: 3.7em; display: flex; align-items: center; justify-content: center; gap: 0.85em; border-radius: 99em; animation: float 6s ease-in-out infinite; }
.d-pal i { width: 1.5em; height: 1.5em; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 0.14em rgba(255, 255, 255, 0.14); }

.d-type { left: 25.6em; top: 6.3em; width: 9.4em; height: 9.2em; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.7em; animation: float 7s -2s ease-in-out infinite; }
.d-type b {
  margin-bottom: 0.15em;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 4.4em;
  line-height: 0.9;
  background: linear-gradient(135deg, #fff 25%, #8fb0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.d-cursor { position: absolute; left: 5.9em; top: 8.9em; display: flex; align-items: flex-start; animation: d-cursor 7s ease-in-out infinite; }
.d-cursor svg { width: 1.9em; height: 1.9em; fill: #fff; stroke: #0b1020; stroke-width: 1.1; stroke-linejoin: round; filter: drop-shadow(0 0.3em 0.5em rgba(0, 0, 0, 0.5)); }
.d-cursor em { margin: 1.4em 0 0 -0.3em; padding: 0.3em 0.7em; border-radius: 0.4em; background: #477bff; color: #fff; font-size: 0.62em; font-style: normal; font-weight: 600; letter-spacing: 0.08em; }
@keyframes d-cursor {
  0% { transform: translate(10em, 4em); opacity: 0; }
  12% { opacity: 1; }
  40% { transform: translate(0, 0); }
  46% { transform: translate(0, 0) scale(0.88); }
  52% { transform: translate(0, 0) scale(1); }
  80% { transform: translate(0, 0); opacity: 1; }
  100% { transform: translate(10em, 4em); opacity: 0; }
}

/* ---------- 02 · Development ---------- */

.stage--dev { width: 28em; height: 16em; font-size: min(calc(100cqw / 29), calc(100cqh / 16.6)); }

.c-win { left: 0; top: 1em; width: 20.4em; height: 14em; }
.c-bar span { margin-left: auto; font: 500 0.62em ui-monospace, SFMono-Regular, Menlo, monospace; color: rgba(255, 255, 255, 0.4); }
.c-code { counter-reset: l; display: grid; gap: 0.2em; padding: 0.9em 1em; }
.c-code p {
  counter-increment: l;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5em;
  height: 1.35em;
  padding-left: calc(var(--i, 0) * 1.2em + 1.9em);
  animation: type 9s ease-in-out calc(var(--n) * 0.45s - 3s) infinite backwards;
}
.c-code p::before { content: counter(l); position: absolute; left: 0; width: 1.1em; text-align: right; font: 0.6em ui-monospace, SFMono-Regular, Menlo, monospace; color: rgba(255, 255, 255, 0.28); }
.c-code p:last-child::after { content: ''; width: 0.14em; height: 1em; margin-left: 0.2em; background: #8fb0ff; animation: blink 1s steps(1) infinite; }
.c-code s { display: block; width: var(--w); height: 0.58em; border-radius: 99em; text-decoration: none; }
.t1 { background: #477bff; } .t2 { background: #9b7bff; } .t3 { background: #ff9a63; } .t4 { background: #6fe3c4; } .t5 { background: rgba(255, 255, 255, 0.28); }
@keyframes type {
  0% { clip-path: inset(0 100% 0 0); }
  8%, 86% { clip-path: inset(0 0 0 0); }
  94%, 100% { clip-path: inset(0 100% 0 0); }
}

.c-ring { left: 17.4em; top: 0; width: 9.6em; height: 9.6em; display: grid; place-items: center; border-radius: 50%; animation: float 6.5s -1s ease-in-out infinite; }
.c-ring svg { width: 72%; height: 72%; overflow: visible; }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 2.4; }
.ring {
  fill: none;
  stroke: #8fb0ff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0.06;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  filter: drop-shadow(0 0 0.35em rgba(71, 123, 255, 0.9));
  animation: ring 6s ease-in-out infinite;
}
@keyframes ring { 0% { stroke-dashoffset: 1; } 40%, 85% { stroke-dashoffset: 0.04; } 100% { stroke-dashoffset: 1; } }
.bolt { fill: #fff; filter: drop-shadow(0 0 0.4em rgba(143, 176, 255, 0.9)); }

.c-dev { padding: 0.35em; border-radius: 0.9em; }
.c-dev i { display: block; width: 100%; height: 100%; border-radius: 0.6em; background: linear-gradient(160deg, rgba(71, 123, 255, 0.6), rgba(124, 92, 255, 0.35)); }
.c-dev--tablet { left: 21.2em; top: 9.9em; width: 6.8em; height: 5.4em; animation: float 7s -3s ease-in-out infinite; }
.c-dev--phone { left: 17.8em; top: 10.8em; width: 3.2em; height: 5.2em; animation: float 5.5s -1s ease-in-out infinite; }

/* ---------- 03 · Landing pages ---------- */

.stage--landing { width: 24em; height: 16em; font-size: min(calc(100cqw / 25), calc(100cqh / 16.6)); }

.l-page { left: 1.2em; top: 0.4em; width: 12.8em; height: 15.2em; display: flex; flex-direction: column; gap: 0.55em; padding: 1.1em; }
.l-nav { display: flex; gap: 0.4em; margin-bottom: 0.5em; }
.l-nav i { width: 0.45em; height: 0.45em; border-radius: 50%; background: rgba(255, 255, 255, 0.28); }
.l-img { flex: 1; min-height: 0; margin-top: 0.3em; border-radius: 0.7em; background: linear-gradient(150deg, rgba(124, 92, 255, 0.85), rgba(71, 123, 255, 0.55) 60%, rgba(255, 154, 99, 0.6)); }
.l-cta { position: relative; display: block; align-self: center; width: 7.6em; height: 2.1em; margin-top: 0.5em; border-radius: 99em; background: linear-gradient(135deg, #7aa0ff, #477bff); box-shadow: 0 0 1.8em rgba(71, 123, 255, 0.85); }
.l-cta::before, .l-cta::after { content: ''; position: absolute; inset: 0; border-radius: inherit; border: 0.1em solid rgba(143, 176, 255, 0.85); animation: ripple 2.8s ease-out infinite; }
.l-cta::after { animation-delay: 1.4s; }
@keyframes ripple { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(1.5, 2.4); opacity: 0; } }

.l-chip {
  left: 13.4em; top: var(--t);
  width: 10em; height: 3.1em;
  display: flex; align-items: center; gap: 0.7em;
  padding: 0 0.9em;
  border-radius: 0.95em;
  animation: chip 6.6s ease-in-out calc(var(--d, 0s) - 2s) infinite backwards;
}
.l-chip svg { flex: none; width: 1.4em; height: 1.4em; fill: none; stroke: #8fb0ff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.l-chip span { display: grid; gap: 0.4em; }
.l-chip .sk { height: 0.42em; }
@keyframes chip {
  0% { opacity: 0; transform: translate(1.4em, 1em); }
  12%, 70% { opacity: 1; transform: none; }
  86%, 100% { opacity: 0; transform: translate(-0.8em, -0.8em); }
}

/* ---------- 04 · Redesign ---------- */

@property --split { syntax: '<percentage>'; inherits: true; initial-value: 50%; }
@keyframes split { from { --split: 26%; } to { --split: 72%; } }

.stage--redesign { width: 36em; height: 16em; font-size: min(calc(100cqw / 37), calc(100cqh / 16.6)); }

.r-frame {
  position: absolute;
  left: 1.5em; top: 0.5em;
  width: 33em; height: 15em;
  overflow: hidden;
  border: 0.07em solid rgba(255, 255, 255, 0.16);
  border-radius: 1.1em;
  box-shadow: 0 1.6em 3.4em -1.4em rgba(0, 0, 0, 0.85);
  animation: split 9s ease-in-out infinite alternate;
}
.r-old, .r-new { position: absolute; inset: 0; padding: 1.3em; }

.r-old { background: #161a22; }
.r-old__nav { display: flex; gap: 0.7em; margin-bottom: 0.8em; }
.r-old__nav i { width: 2.2em; height: 0.5em; background: #3a4150; }
.r-old__banner { height: 3.6em; margin-bottom: 0.8em; border: 0.1em dashed #4a5262; background: repeating-linear-gradient(45deg, #1c212b 0 0.6em, #222835 0.6em 1.2em); }
.r-old__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7em; margin-bottom: 0.8em; }
.r-old__cols span {
  height: 4.6em;
  border: 0.1em solid #3a4150;
  background:
    linear-gradient(#4a5262, #4a5262) 0.5em 0.6em / 60% 0.35em no-repeat,
    linear-gradient(#303746, #303746) 0.5em 1.5em / 80% 0.3em no-repeat,
    linear-gradient(#303746, #303746) 0.5em 2.2em / 70% 0.3em no-repeat,
    linear-gradient(#303746, #303746) 0.5em 2.9em / 84% 0.3em no-repeat;
}
.r-old__btns { display: flex; gap: 0.5em; }
.r-old__btns i { width: 3em; height: 1em; border: 0.1em solid #4a5262; background: #242a36; }

.r-new {
  display: flex; flex-direction: column; gap: 0.6em;
  padding: 2.2em 2.4em;
  background:
    radial-gradient(70% 90% at 85% 0%, rgba(124, 92, 255, 0.55), transparent 70%),
    radial-gradient(60% 80% at 10% 110%, rgba(71, 123, 255, 0.35), transparent 70%),
    #0a0f21;
  clip-path: inset(0 0 0 var(--split));
}
.sk--hero { height: 1.4em; background: #f5f7ff; }
.r-new .sk--hero:nth-of-type(2) { background: linear-gradient(90deg, #8fb0ff, #7c5cff); }
.sk--b { height: 0.55em; margin-top: 0.3em; background: rgba(255, 255, 255, 0.24); }
.r-new__btn { display: block; width: 7em; height: 2em; margin-top: 0.7em; border-radius: 99em; background: linear-gradient(135deg, #7aa0ff, #477bff); box-shadow: 0 0 1.6em rgba(71, 123, 255, 0.8); }
.r-new__cards { position: absolute; left: 2.4em; right: 2.4em; bottom: 1.5em; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1em; }
.r-new__cards i { position: relative; height: 3.2em; border-radius: 0.8em; }
.r-new__shard { position: absolute; right: 2.4em; top: 1.2em; width: 9em; height: 10.5em; background: linear-gradient(160deg, rgba(143, 176, 255, 0.9), rgba(71, 123, 255, 0.5) 45%, rgba(124, 92, 255, 0.5) 70%, rgba(255, 154, 99, 0.55)); clip-path: polygon(54% 0, 100% 44%, 48% 100%, 0 48%); filter: drop-shadow(0 0 1.4em rgba(71, 123, 255, 0.55)); }

.r-handle { position: absolute; top: 0; bottom: 0; left: var(--split); width: 0.14em; margin-left: -0.07em; background: #a9c8ff; box-shadow: 0 0 1.2em #477bff; }
.r-handle::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 2.3em; height: 2.3em;
  margin: -1.15em 0 0 -1.15em;
  border: 0.14em solid #a9c8ff;
  border-radius: 50%;
  background: #0b1020 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 7l-5 5 5 5M15 7l5 5-5 5'/></svg>") center / 60% no-repeat;
  box-shadow: 0 0 1.2em rgba(71, 123, 255, 0.9);
}
.r-lab { position: absolute; top: 0.9em; padding: 0.4em 0.9em; border: 0.1em solid rgba(255, 255, 255, 0.2); border-radius: 99em; background: rgba(5, 7, 13, 0.55); color: rgba(245, 247, 255, 0.85); font-size: 0.62em; font-style: normal; letter-spacing: 0.2em; text-transform: uppercase; }
.r-lab--l { left: 1.6em; }
.r-lab--r { right: 1.6em; }
