/* ==========================================================================
   HERO ACCORDION — luxury vertical accordion (pure CSS / SVG, zero media)
   Tokens come from brand-core.css / main.css :root
   ========================================================================== */
.hax {
  --hax-gold: var(--luxury-accent, #D6B56A);
  --hax-gold-soft: var(--luxury-accent-soft, #E8D39A);
  --hax-line: rgba(214, 181, 106, 0.15);
  --hax-line-strong: rgba(214, 181, 106, 0.35);
  --hax-ease: cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-sizing: border-box;
  padding-top: var(--header-height, 90px);
  min-height: calc(100vh - 90px);
  background: var(--lux-dark-bg, #07132B);
  color: var(--white, #fff);
  font-family: "PersianWebFont", "DM Sans", sans-serif;
  overflow: hidden;
}

.hax__panels {
  display: flex;
  flex-direction: column;
  height: calc(100svh - 85px);
  min-height: 600px;
}

/* ---------- Panel ---------- */
.hax__panel {
  position: relative;
  flex: 0 0 76px;
  min-height: 0;
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
  background: linear-gradient(160deg, var(--lux-dark-bg, #07132B), var(--bg-3, #0B1740));
  border-block-end: 1px solid var(--hax-line);
  outline: none;
  transition: all 0.65s var(--hax-ease);
}

.hax__panel.is-active {
  flex: 1 1 0;
  cursor: default;
}

.hax__panel:focus-visible {
  box-shadow: inset 0 0 0 2px var(--hax-gold);
}

.hax__panel::after {
  /* metallic edge sheen + readability veil */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(7, 19, 43, 0) 30%, rgba(7, 19, 43, 0.82) 100%);
  pointer-events: none;
}

/* ---------- Procedural art layer ---------- */
.hax__art {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.55;
  transition: opacity 0.65s var(--hax-ease);
  pointer-events: none;
}

.hax__panel.is-active .hax__art { opacity: 1; }

.hax__art svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Panel 01 — 3D Gas-Atomized Metal Powder (SLM / LPBF) Canvas 2D Simulation */
.hax__art--powder {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 10%, #0d1e3d 0%, #07132B 65%, #050d1e 100%);
  contain: layout style paint;
}

.hax__powder-cad {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hax__powder-canvas,
#powder-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 1;
}

/* Shared SVG strokes */
.hax__stroke { fill: none; stroke: var(--hax-gold); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hax__stroke--soft { stroke: rgba(214, 181, 106, 0.18); }

/* Panel 03 — radar rings + PSD curve */
.hax__ring {
  fill: none;
  stroke: var(--hax-gold);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: haxRing 6s ease-out infinite;
}
.hax__ring:nth-child(2) { animation-delay: 1.5s; }
.hax__ring:nth-child(3) { animation-delay: 3s; }
.hax__ring:nth-child(4) { animation-delay: 4.5s; }

@keyframes haxRing {
  0%   { transform: scale(0.15); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.hax__curve {
  fill: none;
  stroke: var(--hax-gold-soft);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 700;
  stroke-dashoffset: 700;
  animation: haxDraw 6s ease-in-out infinite alternate;
}

.hax__curve-fill { fill: url(#haxCurveGrad); }

@keyframes haxDraw { to { stroke-dashoffset: 0; } }

/* Panel 04 — lattice wireframe */
.hax__lattice {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: haxDraw 7s ease-in-out infinite alternate;
}

/* ---------- Collapsed label ---------- */
.hax__tab {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 76px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-inline: 20px;
  transition: opacity 0.35s ease;
}

.hax__num {
  font-family: "Mona Sans", "DM Sans", sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: var(--hax-gold);
  direction: ltr;
}

.hax__tab-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white, #fff);
  flex: 1;
}

.hax__chev {
  color: var(--hax-gold);
  transition: transform 0.5s var(--hax-ease);
}
.hax__panel.is-active .hax__chev { transform: rotate(180deg); }

.hax__panel.is-active .hax__tab { opacity: 0; pointer-events: none; }

/* ---------- Content ---------- */
.hax__content {
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  padding: 24px 20px 28px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px);
  transition: opacity 0.4s ease, transform 0.65s var(--hax-ease), visibility 0s linear 0.4s;
}

.hax__panel.is-active .hax__content {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0.25s;
}

.hax__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  margin-block-end: 16px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--white, #fff);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hax-line-strong);
  border-radius: 50px;
  backdrop-filter: blur(8px);
}

.hax__badge-num {
  font-family: "Mona Sans", ui-monospace, "DM Sans", monospace;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  line-height: 1;
  color: var(--hax-gold);
  padding-inline-end: 9px;
  border-inline-end: 1px solid var(--hax-line-strong);
  direction: ltr;
}

.hax__title {
  margin: 0 0 12px;
  transform: scale(0.8);
  transform-origin: left center;
  transition: transform 0.65s var(--hax-ease);
  color: var(--white, #fff);
  font-size: clamp(1.4rem, 1rem + 2vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
}

.hax__text {
  margin: 0 0 18px;
  max-width: 520px;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(0.9rem, 0.85rem + 0.2vw, 1rem);
  line-height: 1.8;
}

.hax__list {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.hax__list li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.92rem;
  line-height: 1.6;
}

.hax__check {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  font-size: 0.65rem;
  color: var(--hax-gold);
  border: 1px solid var(--hax-line-strong);
  border-radius: 50%;
  background: rgba(214, 181, 106, 0.08);
}

.hax .theme-btn {
  background-color: var(--theme, #123B8F);
  border: 1px solid var(--hax-line-strong);
  color: var(--white, #fff);
  transform: translateY(0);
}
.hax .theme-btn:hover {
  background-color: var(--hax-gold);
  border-color: var(--hax-gold);
  color: var(--header, #0B0F17);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--luxury-gold-glow, rgba(214, 181, 106, 0.32));
}

/* ---------- Desktop / tablet: vertical columns ---------- */
@media (min-width: 768px) {
  .hax__panels { flex-direction: row; min-height: 85vh; }

  .hax__panel {
    flex: 1 1 0;
    border-block-end: 0;
    border-inline-end: 1px solid var(--hax-line);
  }
  .hax__panel:last-child { border-inline-end: 0; }

  .hax__panel:not(.is-active) { flex: 0.7 1 0; }
  .hax__panel.is-active { flex: 3 1 0; }

  /* Collapsed: index on top, horizontal wrapping title centred below */
  .hax__tab {
    inset-block: 0;
    height: auto;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 18px;
    padding-block: 32px;
    padding-inline: 12px;
  }
  .hax__num { font-size: 1rem; font-family: "Mona Sans", ui-monospace, monospace; }
  .hax__tab-title {
    flex: 0 1 auto;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.6;
    text-align: center;
    text-wrap: balance;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .hax__chev { margin-block-start: auto; }
  .hax__chev,
  .hax__panel.is-active .hax__chev { transform: rotate(-90deg); }  /* LTR: points inline-end (right) */
  [dir="rtl"] .hax__chev,
  [dir="rtl"] .hax__panel.is-active .hax__chev { transform: rotate(90deg); } /* RTL: points left */

  .hax__content {
    padding: 48px clamp(28px, 4vw, 64px);
    width: 100%;
    min-width: min(560px, 55vw); /* avoids text re-wrapping while the panel animates */
  }

  .hax__text { margin-block-end: 22px; }
  .hax__list { grid-template-columns: 1fr; margin-block-end: 28px; }
}

/* Mirror directional icons (button arrows + chevrons) iin RTL */
[dir="rtl"] .hax .theme-btn .fa-arrow-up-right { transform: scaleX(-1); }

@media (prefers-reduced-motion: reduce) {
  .hax *, .hax *::before { animation: none !important; transition-duration: 0.01s !important; }
}


.hax__panel.is-active .hax__title { transform: scale(1); }
[dir="rtl"] .hax__title { transform-origin: right center; }

