/* ---- wesolve custom layer (everything Tailwind utilities can't express) ---- */

[x-cloak] { display: none !important; }

/* ---- Hero entrance ---- */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-slide {
  opacity: 0;
  animation: fadeSlideIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--d, 0s);
}

/* ---- Scroll reveal (toggled by Alpine x-intersect) ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--d, 0s);
}
.reveal.is-visible {
  opacity: 1;
  /* "none" (not translateY(0)) — a lingering transform creates a containing
     block that silently breaks background-attachment: fixed (glow cards) */
  transform: none;
}

/* ---- Perspective grid floor ---- */
.hero-grid {
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.16) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(600px) rotateX(62deg);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.9), transparent 85%);
          mask-image: linear-gradient(to top, rgba(0,0,0,0.9), transparent 85%);
}

/* ---- Ops chips (live status labels) ---- */
.ops-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  background: rgba(10, 16, 28, 0.85);
  backdrop-filter: blur(6px);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: #8b97a8;
  white-space: nowrap;
}
.ops-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff4e1f;
  flex: none;
}

/* ---- Sector hover-expand gallery ---- */
.sector-card {
  flex: 1;
  transition: flex 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.sector-card:hover,
.sector-card:focus-visible {
  flex: 3.2;
}
.sector-card img {
  filter: saturate(0.55) brightness(0.85);
  transition: filter 0.7s ease, transform 0.7s ease;
}
.sector-card:hover img,
.sector-card:focus-visible img {
  filter: saturate(1) brightness(1);
  transform: scale(1.03);
}
.sector-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5, 8, 15, 0.9), rgba(5, 8, 15, 0.15) 45%, transparent);
}
/* Rotated label shown while the card is collapsed */
.sector-tab {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(242, 245, 249, 0.85);
  transition: opacity 0.4s ease;
}
.sector-card:hover .sector-tab,
.sector-card:focus-visible .sector-tab {
  opacity: 0;
}
/* Full caption revealed when expanded */
.sector-caption {
  position: absolute;
  left: 20px;
  bottom: 18px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease 0.15s, transform 0.5s ease 0.15s;
}
.sector-card:hover .sector-caption,
.sector-card:focus-visible .sector-caption {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Team cards: hover reveals a grid-textured bio panel ---- */
.team-bio {
  background-color: #0b1120;
  background-image:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 78, 31, 0.14), transparent 60%),
    linear-gradient(rgba(148, 163, 184, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.09) 1px, transparent 1px);
  background-size: 100% 100%, 36px 36px, 36px 36px;
}
/* Keyboard users get the same reveal as hover */
.group:focus-within .team-bio {
  opacity: 1;
}

/* ---- Customer logo cloud (marquee between masked divider lines) ---- */
.logo-fade {
  -webkit-mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
}
.logo-marquee {
  display: flex;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
}
.logo-track {
  flex: none;
  display: flex;
  align-items: center;
  gap: 5rem;
  padding-right: 5rem;
  min-width: max-content;
  animation: logo-scroll 32s linear infinite;
}
.logo-track li {
  list-style: none;
  flex: none;
}
.logo-track img {
  height: 2rem;
  width: auto;
  /* Force every brand mark to uniform white regardless of source color */
  filter: brightness(0) invert(1);
  opacity: 0.7;
  transition: opacity 0.3s ease;
}
.logo-track li:hover img {
  opacity: 1;
}
@keyframes logo-scroll {
  to { transform: translateX(-100%); }
}
/* Static white logo treatment (about page grid) */
.logo-white {
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.7;
  transition: opacity 0.3s ease;
}
.logo-white:hover {
  opacity: 1;
}

/* ---- Timeline (sticky years + scroll-following beam) ---- */
.timeline-track {
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  overflow: hidden;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(148, 163, 184, 0.22) 6%,
    rgba(148, 163, 184, 0.22) 94%,
    transparent
  );
}
.timeline-beam {
  width: 100%;
  height: 0;
  border-radius: 2px;
  background: linear-gradient(to bottom, #ff4e1f, #b78cf5);
  transition: height 0.15s ease-out;
}
.timeline-dot {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #0a101c;
  box-shadow: inset 0 0 0 5px #05080f;
}

/* ---- Globe hero (services pages) ---- */
.globe-wrap {
  overflow: hidden;
}
.globe-wrap canvas {
  height: auto;
}

/* ---- Sparkles field (soft radial mask like the reference) ---- */
.sparkles-canvas {
  -webkit-mask-image: radial-gradient(60% 80% at 50% 60%, black 30%, transparent 75%);
          mask-image: radial-gradient(60% 80% at 50% 60%, black 30%, transparent 75%);
}

/* ---- Bento feature cards (hover gradient reveal + accent line) ---- */
.bento-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 1rem;
  background: rgba(10, 16, 28, 0.6);
  padding: 1.75rem;
}
.bento-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 60% at 50% 0%, rgba(255, 78, 31, 0.08), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.bento-card::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, #ff4e1f, rgba(255, 78, 31, 0));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.bento-card:hover::before {
  opacity: 1;
}
.bento-card:hover::after {
  transform: scaleX(1);
}
.bento-icon {
  width: 1.75rem;
  height: 1.75rem;
  color: #ff4e1f;
}

/* ---- Retro angled grid (hero-section-dark) ---- */
.retro-grid {
  position: absolute;
  inset: 0;
  overflow: hidden;
  perspective: 220px;
  opacity: 0.35;
  -webkit-mask-image: linear-gradient(to bottom, transparent 4%, black 40%, black 75%, transparent);
          mask-image: linear-gradient(to bottom, transparent 4%, black 40%, black 75%, transparent);
}
.retro-grid__plane {
  position: absolute;
  inset: -120% -60%;
  transform: rotateX(65deg);
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.35) 1px, transparent 0),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.35) 1px, transparent 0);
  background-size: 50px 50px;
  animation: retro-scroll 22s linear infinite;
}
@keyframes retro-scroll {
  to { background-position: 0 1000px; }
}

/* ---- Spotlight cards (EaseMize GlowCard, faithful port) ---- */
[data-glow] {
  --base: 20;                      /* orange */
  --spread: 60;
  --radius: 16;
  --border: 2;
  --backdrop: hsl(222 47% 7% / 0.75);
  --backup-border: rgba(148, 163, 184, 0.16);
  --size: 200;
  --outer: 1;
  --saturation: 100;
  --lightness: 60;
  --border-size: calc(var(--border, 2) * 1px);
  --spotlight-size: calc(var(--size, 150) * 1px);
  --hue: calc(var(--base) + (var(--xp, 0) * var(--spread, 0)));
  background-image: radial-gradient(
    var(--spotlight-size) var(--spotlight-size) at
    calc(var(--x, 0) * 1px)
    calc(var(--y, 0) * 1px),
    hsl(var(--hue, 210) calc(var(--saturation, 100) * 1%) calc(var(--lightness, 70) * 1%) / var(--bg-spot-opacity, 0.1)),
    transparent
  );
  background-color: var(--backdrop, transparent);
  background-size: calc(100% + (2 * var(--border-size))) calc(100% + (2 * var(--border-size)));
  background-position: 50% 50%;
  background-attachment: fixed;
  border: var(--border-size) solid var(--backup-border);
  border-radius: calc(var(--radius) * 1px);
  position: relative;
  touch-action: none;
  box-shadow: 0 1rem 2rem -1rem black;
}
/* Keep card content above the glow layers */
[data-glow] > *:not([data-glow]) {
  position: relative;
  z-index: 1;
}
[data-glow]::before,
[data-glow]::after {
  pointer-events: none;
  content: "";
  position: absolute;
  inset: calc(var(--border-size) * -1);
  border: var(--border-size) solid transparent;
  border-radius: calc(var(--radius) * 1px);
  background-attachment: fixed;
  background-size: calc(100% + (2 * var(--border-size))) calc(100% + (2 * var(--border-size)));
  background-repeat: no-repeat;
  background-position: 50% 50%;
  mask: linear-gradient(transparent, transparent), linear-gradient(white, white);
  mask-clip: padding-box, border-box;
  mask-composite: intersect;
}
[data-glow]::before {
  background-image: radial-gradient(
    calc(var(--spotlight-size) * 0.75) calc(var(--spotlight-size) * 0.75) at
    calc(var(--x, 0) * 1px)
    calc(var(--y, 0) * 1px),
    hsl(var(--hue, 210) calc(var(--saturation, 100) * 1%) calc(var(--lightness, 50) * 1%) / var(--border-spot-opacity, 1)),
    transparent 100%
  );
  filter: brightness(2);
}
[data-glow]::after {
  background-image: radial-gradient(
    calc(var(--spotlight-size) * 0.5) calc(var(--spotlight-size) * 0.5) at
    calc(var(--x, 0) * 1px)
    calc(var(--y, 0) * 1px),
    hsl(0 100% 100% / var(--border-light-opacity, 1)),
    transparent 100%
  );
}
[data-glow] [data-glow] {
  position: absolute;
  inset: 0;
  will-change: filter;
  opacity: var(--outer, 1);
  border-radius: calc(var(--radius) * 1px);
  border-width: calc(var(--border-size) * 20);
  filter: blur(calc(var(--border-size) * 10));
  background: none;
  pointer-events: none;
  border: none;
}
[data-glow] > [data-glow]::before {
  inset: -10px;
  border-width: 10px;
}

/* ---- Tilted product shot (features-7) ---- */
.tilt-mask {
  -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 96%);
          mask-image: linear-gradient(to bottom, black 70%, transparent 96%);
}
.tilt-shot {
  transform: perspective(1400px) rotateX(9deg) skewX(-2deg);
  transform-origin: top center;
}

/* ---- Image accordion tabs ---- */
.acc-tab {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(242, 245, 249, 0.85);
  transition: opacity 0.4s ease;
  pointer-events: none;
}
@media (max-width: 767px) {
  .acc-tab {
    left: 20px;
    bottom: 16px;
    transform: none;
    writing-mode: horizontal-tb;
  }
}

/* ---- Blue accent theme (CommerceSuite page) ---- */
.theme-blue [data-glow] {
  --base: 225; /* blue */
  --spread: 40;
}
.theme-blue .suite-list li::marker {
  color: #4f7cff;
}
/* Link-blue bullet text, like the reference block */
.suite-list--links li {
  color: #9db8ff;
}
.suite-list--dim li {
  color: rgba(148, 163, 184, 0.7);
}

/* ---- Bento (features-11) masks & tiles ---- */
.mask-fade-b {
  -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 98%);
          mask-image: linear-gradient(to bottom, black 70%, transparent 98%);
}
.mask-radial-r {
  -webkit-mask-image: radial-gradient(120% 120% at 100% 50%, black 60%, transparent 95%);
          mask-image: radial-gradient(120% 120% at 100% 50%, black 60%, transparent 95%);
}
.keycap {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(148, 163, 184, 0.08);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.keycap--accent {
  border-color: rgba(255, 78, 31, 0.5);
  background: rgba(255, 78, 31, 0.1);
  box-shadow:
    0 6px 16px rgba(255, 78, 31, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.tile {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.07);
}

/* ---- Process step dots (how-we-work strip) ---- */
.step-dot {
  display: inline-flex;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid rgba(148, 163, 184, 0.5);
  position: relative;
}
.step-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.7);
}
.step-dot--active {
  border-color: #ff4e1f;
  box-shadow: 0 0 12px 2px rgba(255, 78, 31, 0.45);
}
.step-dot--active::after {
  background: #ff4e1f;
}

/* ---- CommerceSuite event-bus section ---- */
.suite-card {
  flex: 1;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 1rem;
  background: rgba(5, 8, 15, 0.6);
  padding: 1.5rem;
}
.suite-list {
  columns: 1;
  font-size: 0.875rem;
  line-height: 2;
  color: rgba(242, 245, 249, 0.75);
}
.suite-list li {
  list-style: disc inside;
}
.suite-list li::marker {
  color: #ff4e1f;
}
.suite-list--dim li::marker {
  color: rgba(148, 163, 184, 0.5);
}
.queue-chip {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 3px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 78, 31, 0.45);
  background: rgba(255, 78, 31, 0.12);
  color: #ff8a5e;
  box-shadow: 0 0 14px rgba(255, 78, 31, 0.25);
}
.queue-chip--dim {
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(148, 163, 184, 0.06);
  color: rgba(148, 163, 184, 0.6);
  box-shadow: none;
}
.event-bus {
  background: linear-gradient(
    90deg,
    #ff4e1f 0%,
    rgba(255, 78, 31, 0.8) 62%,
    rgba(148, 163, 184, 0.15) 66%,
    rgba(148, 163, 184, 0.12) 100%
  );
  box-shadow: 0 0 18px rgba(255, 78, 31, 0.35);
}
.bus-chip {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 2%;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 6px;
  background: #ff4e1f;
  color: #05080f;
  white-space: nowrap;
  animation: bus-run 9s linear infinite;
}
@keyframes bus-run {
  0% { left: 1%; }
  100% { left: 88%; }
}
@media (prefers-reduced-motion: reduce) {
  .bus-chip { animation: none; left: 30%; }
}

/* ---- Cyber matrix hero (character grid) ---- */
#tiles {
  display: grid;
  grid-template-columns: repeat(var(--columns, 20), 1fr);
  grid-template-rows: repeat(var(--rows, 12), 1fr);
  position: absolute;
  inset: 0;
}
.tile {
  --intensity: 0;
  position: relative;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 1.05rem;
  user-select: none;
  opacity: calc(0.09 + var(--intensity) * 0.91);
  color: hsl(14 100% calc(50% + var(--intensity) * 30%));
  text-shadow: 0 0 calc(var(--intensity) * 15px) hsl(14 100% 50%);
  transform: scale(calc(1 + var(--intensity) * 0.2));
  transition: color 0.2s ease, text-shadow 0.2s ease, transform 0.2s ease;
}
.tile.glitch {
  animation: glitch-anim 0.2s ease;
}
@keyframes glitch-anim {
  0% { transform: scale(1); color: #ff4e1f; }
  50% { transform: scale(1.2); color: #fff; text-shadow: 0 0 10px #fff; }
  100% { transform: scale(1); color: #ff4e1f; }
}

/* ---- Hero-modern lower deck (hosting page) ---- */
.ctrl-chip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(180px circle at 50% 20%, rgba(255, 255, 255, 0.12), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.ctrl-chip:hover::after {
  opacity: 1;
}
.proto-spot {
  background: radial-gradient(
    190px circle at var(--hx, 50%) var(--hy, 50%),
    rgba(255, 255, 255, 0.14),
    transparent 72%
  );
}
.hero3-glow {
  animation: hero3-glow 9s ease-in-out infinite;
}
.hero3-drift {
  animation: hero3-drift 12s ease-in-out infinite;
}
@keyframes hero3-glow {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.18); opacity: 0.35; }
}
@keyframes hero3-drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-14px, -18px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero3-glow,
  .hero3-drift { animation: none; }
}

/* ---- CPU architecture lights (svg-ui port): glows travel the traces ---- */
.cpu-light {
  offset-anchor: 10px 0px;
  animation: cpu-path-run 0s linear infinite;
  animation-timing-function: cubic-bezier(0.75, -0.01, 0, 0.99);
}
.cpu-line-1 { offset-path: path("M 10 20 h 79.5 q 5 0 5 5 v 30"); animation-duration: 5s; animation-delay: 1s; }
.cpu-line-2 { offset-path: path("M 180 10 h -69.7 q -5 0 -5 5 v 30"); animation-duration: 2s; animation-delay: 6s; }
.cpu-line-3 { offset-path: path("M 130 20 v 21.8 q 0 5 -5 5 h -10"); animation-duration: 6s; animation-delay: 4s; }
.cpu-line-4 { offset-path: path("M 170 80 v -21.8 q 0 -5 -5 -5 h -50"); animation-duration: 3s; animation-delay: 3s; }
.cpu-line-5 { offset-path: path("M 135 65 h 15 q 5 0 5 5 v 10 q 0 5 -5 5 h -39.8 q -5 0 -5 -5 v -20"); animation-duration: 4s; animation-delay: 9s; }
.cpu-line-6 { offset-path: path("M 94.8 95 v -36"); animation-duration: 7s; animation-delay: 3s; }
.cpu-line-7 { offset-path: path("M 88 88 v -15 q 0 -5 -5 -5 h -10 q -5 0 -5 -5 v -5 q 0 -5 5 -5 h 14"); animation-duration: 4s; animation-delay: 0s; }
.cpu-line-8 { offset-path: path("M 30 30 h 25 q 5 0 5 5 v 6.5 q 0 5 5 5 h 20"); animation-duration: 5s; animation-delay: 8s; }
@keyframes cpu-path-run {
  0% { offset-distance: 0%; }
  100% { offset-distance: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .cpu-light { animation: none; visibility: hidden; }
}

/* ---- Focus visibility ---- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #ff4e1f;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .fade-slide { animation: none; opacity: 1; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .logo-track { animation: none; }
  .sector-card,
  .sector-card img,
  .sector-caption,
  .sector-tab { transition: none; }
  html { scroll-behavior: auto; }
}
