/* ============================================================
   AEX DESIGN SYSTEM - LAYER 4: HOMEPAGE
   Compozitii specifice paginii principale.
   ============================================================ */

/* ============================================================
   HERO
   ============================================================ */
.aex-hero {
  position: relative;
  padding-block: clamp(3rem, 1.5rem + 6vw, 6.5rem) clamp(3.5rem, 2rem + 6vw, 7rem);
  overflow: hidden;
  isolation: isolate;
}
.aex-hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 130%;
  background: var(--aex-grad-glow);
  z-index: -2;
  pointer-events: none;
}
.aex-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--aex-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--aex-border) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: .38;
  mask-image: radial-gradient(80% 60% at 50% 25%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(80% 60% at 50% 25%, #000 0%, transparent 78%);
}
.aex-hero__inner {
  display: grid;
  gap: clamp(2.5rem, 1.5rem + 4vw, 4rem);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 66rem) {
  .aex-hero__inner { grid-template-columns: 1.06fr .94fr; }
}
.aex-hero__title {
  font-size: clamp(2.125rem, 1.45rem + 3.2vw, 3.65rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: var(--aex-fw-black);
  margin-bottom: var(--aex-sp-5);
}
.aex-hero__kicker {
  display: block;
  font-size: var(--aex-fs-sm);
  font-weight: var(--aex-fw-bold);
  letter-spacing: var(--aex-tracking-wide);
  text-transform: uppercase;
  color: var(--aex-text-brand);
  margin-bottom: var(--aex-sp-4);
}
.aex-hero__lead {
  font-size: var(--aex-fs-lg);
  line-height: var(--aex-lh-relaxed);
  color: var(--aex-text-muted);
  max-width: 40ch;
  text-wrap: pretty;
  margin-bottom: var(--aex-sp-8);
}
.aex-hero__actions { margin-bottom: var(--aex-sp-8); }
.aex-hero__proof {
  display: flex;
  flex-wrap: wrap;
  gap: var(--aex-sp-4) var(--aex-sp-6);
  padding-top: var(--aex-sp-6);
  border-top: 1px solid var(--aex-border);
}
.aex-hero__proof-item { display: flex; flex-direction: column; gap: 2px; }
.aex-hero__proof-value {
  font-size: var(--aex-fs-xl);
  font-weight: var(--aex-fw-black);
  line-height: 1;
  color: var(--aex-text);
  letter-spacing: var(--aex-tracking-tight);
}
.aex-hero__proof-label { font-size: var(--aex-fs-xs); color: var(--aex-text-subtle); }

/* --- Vizual hero: fereastra "aplicatie" --- */
.aex-appwin {
  position: relative;
  border-radius: var(--aex-r-xl);
  background: var(--aex-surface);
  border: 1px solid var(--aex-border);
  box-shadow: var(--aex-sh-xl);
  overflow: hidden;
  transform: perspective(1400px) rotateY(-7deg) rotateX(3deg);
  transition: transform var(--aex-dur-slow) var(--aex-ease-out);
}
.aex-appwin:hover { transform: perspective(1400px) rotateY(-3deg) rotateX(1deg) translateY(-4px); }
@media (max-width: 66rem) { .aex-appwin { transform: none; } .aex-appwin:hover { transform: translateY(-3px); } }

.aex-appwin__bar {
  display: flex;
  align-items: center;
  gap: var(--aex-sp-3);
  padding: .75rem 1rem;
  background: var(--aex-bg-subtle);
  border-bottom: 1px solid var(--aex-border);
}
.aex-appwin__dots { display: flex; gap: 6px; }
.aex-appwin__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--aex-border-strong); }
.aex-appwin__dots i:first-child { background: #ff5f57; }
.aex-appwin__dots i:nth-child(2) { background: #febc2e; }
.aex-appwin__dots i:nth-child(3) { background: #28c840; }
.aex-appwin__file {
  font-family: var(--aex-font-mono);
  font-size: var(--aex-fs-2xs);
  color: var(--aex-text-subtle);
}
.aex-appwin__body { padding: var(--aex-sp-4); display: grid; gap: var(--aex-sp-3); }

/* Grila tip foaie de calcul */
.aex-sheet {
  border: 1px solid var(--aex-border);
  border-radius: var(--aex-r-sm);
  overflow: hidden;
  font-family: var(--aex-font-mono);
  font-size: var(--aex-fs-2xs);
}
.aex-sheet__row { display: grid; grid-template-columns: 2.1rem 1fr 1fr 1fr; }
.aex-sheet__row + .aex-sheet__row { border-top: 1px solid var(--aex-border); }
.aex-sheet__cell { padding: .4rem .5rem; border-left: 1px solid var(--aex-border); color: var(--aex-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aex-sheet__cell:first-child { border-left: 0; background: var(--aex-bg-muted); color: var(--aex-text-subtle); text-align: center; }
.aex-sheet__row--head .aex-sheet__cell { background: var(--aex-bg-muted); color: var(--aex-text); font-weight: var(--aex-fw-bold); }
.aex-sheet__cell--ok { color: var(--aex-primary); font-weight: var(--aex-fw-bold); }
.aex-sheet__row--live { animation: aexRowIn .5s var(--aex-ease-out) both; }
.aex-sheet__row--live:nth-child(2) { animation-delay: .15s; }
.aex-sheet__row--live:nth-child(3) { animation-delay: .3s; }
.aex-sheet__row--live:nth-child(4) { animation-delay: .45s; }
.aex-sheet__row--live:nth-child(5) { animation-delay: .6s; }
@keyframes aexRowIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

/* Bara de progres "rulare macro" */
.aex-runbar {
  display: flex;
  align-items: center;
  gap: var(--aex-sp-3);
  padding: .625rem .75rem;
  border-radius: var(--aex-r-sm);
  background: var(--aex-primary-soft);
  border: 1px solid var(--aex-border-brand);
  font-size: var(--aex-fs-2xs);
  font-weight: var(--aex-fw-semi);
  color: var(--aex-text-brand);
}
.aex-runbar__track { flex: 1; height: 6px; border-radius: 3px; background: rgba(3,152,85,.16); overflow: hidden; }
.aex-runbar__fill {
  display: block; height: 100%;
  border-radius: 3px;
  background: var(--aex-grad-brand);
  animation: aexRun 2.8s var(--aex-ease) infinite;
}
@keyframes aexRun { 0% { width: 4%; } 60% { width: 92%; } 100% { width: 100%; } }

/* Mini-diagrama rezultat */
.aex-chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 74px;
  padding: var(--aex-sp-3);
  border: 1px solid var(--aex-border);
  border-radius: var(--aex-r-sm);
  background: var(--aex-bg-subtle);
}
.aex-chart span {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: var(--aex-grad-brand);
  opacity: .82;
  animation: aexBar 2.6s var(--aex-ease-out) infinite alternate;
  transform-origin: bottom;
}
.aex-chart span:nth-child(1) { height: 34%; animation-delay: 0s; }
.aex-chart span:nth-child(2) { height: 56%; animation-delay: .12s; }
.aex-chart span:nth-child(3) { height: 42%; animation-delay: .24s; }
.aex-chart span:nth-child(4) { height: 72%; animation-delay: .36s; }
.aex-chart span:nth-child(5) { height: 60%; animation-delay: .48s; }
.aex-chart span:nth-child(6) { height: 88%; animation-delay: .6s; }
.aex-chart span:nth-child(7) { height: 76%; animation-delay: .72s; }
.aex-chart span:nth-child(8) { height: 100%; animation-delay: .84s; background: var(--aex-grad-ai); opacity: 1; }
@keyframes aexBar { from { transform: scaleY(.72); } to { transform: scaleY(1); } }

/* Insigne plutitoare */
.aex-float {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: var(--aex-sp-2);
  padding: .5rem .8125rem;
  border-radius: var(--aex-r-full);
  background: var(--aex-surface);
  border: 1px solid var(--aex-border);
  box-shadow: var(--aex-sh-lg);
  font-size: var(--aex-fs-xs);
  font-weight: var(--aex-fw-semi);
  color: var(--aex-text);
  white-space: nowrap;
  animation: aexFloat 6s var(--aex-ease) infinite alternate;
}
.aex-float svg { width: 1rem; height: 1rem; color: var(--aex-primary); flex: none; }
.aex-float--tl { top: -3.5%; left: -5%; animation-delay: 0s; }
.aex-float--br { bottom: -4%; right: -5%; animation-delay: -3s; }
.aex-float--ai svg { color: var(--aex-accent); }
@keyframes aexFloat { from { transform: translateY(-6px); } to { transform: translateY(6px); } }
@media (max-width: 48rem) { .aex-float { display: none; } }

.aex-hero__visual { position: relative; }

/* ============================================================
   BANDA LOGO / TEHNOLOGII
   ============================================================ */
.aex-marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.aex-marquee__track {
  display: flex;
  gap: var(--aex-sp-10);
  width: max-content;
  animation: aexMarquee 32s linear infinite;
}
.aex-marquee:hover .aex-marquee__track { animation-play-state: paused; }
@keyframes aexMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.aex-marquee__item {
  display: inline-flex;
  align-items: center;
  gap: var(--aex-sp-3);
  font-size: var(--aex-fs-md);
  font-weight: var(--aex-fw-bold);
  color: var(--aex-text-subtle);
  letter-spacing: var(--aex-tracking-snug);
  white-space: nowrap;
  transition: color var(--aex-dur-fast) var(--aex-ease);
}
.aex-marquee__item:hover { color: var(--aex-text-brand); }
.aex-marquee__item svg { width: 1.5rem; height: 1.5rem; flex: none; }

/* ============================================================
   PLATFORME AUTOMATIZABILE
   ============================================================ */
.aex-platform {
  display: flex;
  align-items: center;
  gap: var(--aex-sp-4);
  padding: var(--aex-sp-4) var(--aex-sp-5);
  border-radius: var(--aex-r-md);
  border: 1px solid var(--aex-border);
  background: var(--aex-surface);
  transition: all var(--aex-dur) var(--aex-ease-out);
}
.aex-platform:hover { border-color: var(--aex-border-brand); transform: translateY(-3px); box-shadow: var(--aex-sh-md); }
.aex-platform__name { font-weight: var(--aex-fw-semi); color: var(--aex-text); font-size: var(--aex-fs-sm); }
.aex-platform__desc { font-size: var(--aex-fs-xs); color: var(--aex-text-muted); }

/* Insignele plutitoare ies putin din cadru - lasam loc pentru ele. */
.aex-hero__visual { padding-block: var(--aex-sp-4); }

/* Pe ecrane inguste butoanele hero ocupa toata latimea. */
@media (max-width: 30rem) {
  .aex-hero__actions .aex-btn { width: 100%; }
}

/* ============================================================
   HERO CU IMAGINE DE FUNDAL
   Imaginea are spatiu negativ in stanga; textul sta acolo,
   iar un gradient garanteaza contrastul indiferent de latime.
   ============================================================ */
.aex-hero--image {
  background: #080f1f;
  color: #fff;
  isolation: isolate;
  padding-block: clamp(3.5rem, 2rem + 7vw, 8rem);
  min-height: clamp(30rem, 26rem + 18vw, 44rem);
  display: flex;
  align-items: center;
}
/* Fundalul propriu al hero-ului inlocuieste grila si aura variantei deschise */
.aex-hero--image::before,
.aex-hero--image::after { display: none; }

.aex-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% center;
  z-index: -2;
  pointer-events: none;
}

/* Voal de contrast: dens in stanga, transparent in dreapta, ca imaginea sa ramana vizibila */
.aex-hero--image .aex-hero__inner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(100deg,
      rgba(8, 15, 31, .96) 0%,
      rgba(8, 15, 31, .90) 34%,
      rgba(8, 15, 31, .55) 58%,
      rgba(8, 15, 31, .18) 78%,
      rgba(8, 15, 31, .05) 100%);
}
.aex-hero--image .aex-hero__inner {
  position: relative;
  grid-template-columns: 1fr;
  width: 100%;
}
@media (min-width: 60rem) {
  .aex-hero--image .aex-hero__inner { grid-template-columns: minmax(0, 34rem) 1fr; }
}
/* Pe ecrane inguste imaginea are nevoie de un voal uniform, mai dens */
@media (max-width: 60rem) {
  .aex-hero--image .aex-hero__inner::before {
    background: linear-gradient(180deg, rgba(8, 15, 31, .88) 0%, rgba(8, 15, 31, .93) 100%);
  }
  .aex-hero__bg { object-position: 62% center; }
}

.aex-hero--image .aex-hero__copy { position: relative; z-index: 1; }
.aex-hero--image .aex-hero__kicker { color: var(--aex-brand-300); }
.aex-hero--image .aex-hero__title { color: #fff; }
body.aex .aex-hero--image .aex-hero__title { color: #fff; }
.aex-hero--image .aex-hero__lead { color: #b9c8da; }
.aex-hero--image .aex-hero__proof { border-top-color: rgba(255, 255, 255, .16); }
.aex-hero--image .aex-hero__proof-value { color: #fff; }
.aex-hero--image .aex-hero__proof-label { color: #93a7bd; }

/* Textul gradient are nevoie de tonuri mai luminoase pe fundal inchis */
.aex-hero--image .aex-gradient-text {
  background-image: linear-gradient(135deg, var(--aex-brand-400) 0%, var(--aex-brand-200) 100%);
}
