/* ==========================================================================
   Apex Micro Systems - Modern HTML5/CSS/JS Top Banners
   Replaces legacy Flash banners (main-item.swf, main_01..04.swf)
   ========================================================================== */

/* ---------- Homepage 4-Panel Interactive Hero ---------- */
.apex-hero-grid {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 1020px;
  height: 272px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 14px;
  background: #0d1420;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  text-align: left;
  box-sizing: border-box;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.apex-hero-grid *,
.apex-hero-grid *::before,
.apex-hero-grid *::after {
  box-sizing: border-box;
}

.apex-hero-grid a.apex-panel,
.apex-hero-grid a.apex-panel:link,
.apex-hero-grid a.apex-panel:visited,
.apex-hero-grid a.apex-panel:active,
.apex-hero-grid a.apex-panel:hover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1 1 0%;
  min-width: 0;
  height: 100%;
  padding: 20px 18px 18px 18px;
  overflow: hidden;
  color: #ffffff;
  text-decoration: none;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
  transition: flex-grow 0.42s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.35s ease;
  outline: none;
}

.apex-hero-grid a.apex-panel:last-child {
  border-right: none;
}

/* Panel photo layer */
.apex-panel-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  transform: scale(1.01);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.4s ease;
  z-index: 0;
}

/* Readability gradient & color tint overlay */
.apex-panel-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(6, 10, 20, 0.72) 0%,
    rgba(6, 10, 20, 0.34) 44%,
    rgba(6, 10, 20, 0.86) 100%
  );
  transition: background 0.35s ease, opacity 0.35s ease;
  z-index: 1;
}

/* Sweep sheen highlight on hover/active */
.apex-panel-sheen {
  position: absolute;
  top: 0;
  left: -120%;
  width: 85%;
  height: 100%;
  background: linear-gradient(
    115deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.24) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-18deg);
  pointer-events: none;
  z-index: 2;
}

/* Top colored accent bar */
.apex-panel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: var(--panel-accent, #38bdf8);
  opacity: 0.9;
  transform: scaleX(0.65);
  transform-origin: left center;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
  z-index: 4;
}

/* Per-panel theme colors matching original main_01..04 */
.apex-panel--about    { --panel-accent: #ff9d1c; }
.apex-panel--services { --panel-accent: #38bdf8; }
.apex-panel--products { --panel-accent: #4ade80; }
.apex-panel--showcase { --panel-accent: #a78bfa; }

/* Header area */
.apex-panel-head {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.apex-panel-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
  white-space: nowrap;
}

.apex-panel-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.3s ease, background 0.3s ease;
}

/* Animated detail bullets */
.apex-panel-list {
  position: relative;
  z-index: 3;
  list-style: none;
  margin: 0;
  padding: 0;
}

.apex-panel-list li {
  position: relative;
  padding-left: 13px;
  margin: 4px 0;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  opacity: 0.74;
  transform: translateY(4px);
  transition: opacity 0.32s ease, transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), color 0.25s ease;
}

.apex-panel-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--panel-accent, #38bdf8);
  box-shadow: 0 0 6px var(--panel-accent, #38bdf8);
}

.apex-panel-quote {
  font-style: italic;
  color: #ffe8a3 !important;
}

/* Hover / focus / JS auto-spotlight active state */
.apex-hero-grid.is-interacting a.apex-panel:not(.is-active):not(:hover):not(:focus) {
  filter: brightness(0.78) saturate(0.88);
}

.apex-hero-grid a.apex-panel:hover,
.apex-hero-grid a.apex-panel:focus,
.apex-hero-grid a.apex-panel.is-active {
  flex-grow: 1.48;
  filter: brightness(1.04);
}

.apex-hero-grid a.apex-panel:hover .apex-panel-bg,
.apex-hero-grid a.apex-panel:focus .apex-panel-bg,
.apex-hero-grid a.apex-panel.is-active .apex-panel-bg {
  transform: scale(1.09);
}

.apex-hero-grid a.apex-panel:hover .apex-panel-shade,
.apex-hero-grid a.apex-panel:focus .apex-panel-shade,
.apex-hero-grid a.apex-panel.is-active .apex-panel-shade {
  background: linear-gradient(
    180deg,
    rgba(6, 10, 20, 0.64) 0%,
    rgba(6, 10, 20, 0.2) 42%,
    rgba(6, 10, 20, 0.84) 100%
  );
}

.apex-hero-grid a.apex-panel:hover::after,
.apex-hero-grid a.apex-panel:focus::after,
.apex-hero-grid a.apex-panel.is-active::after {
  transform: scaleX(1);
  opacity: 1;
}

.apex-hero-grid a.apex-panel:hover .apex-panel-arrow,
.apex-hero-grid a.apex-panel:focus .apex-panel-arrow,
.apex-hero-grid a.apex-panel.is-active .apex-panel-arrow {
  background: var(--panel-accent, #38bdf8);
  color: #0b1120;
  transform: translateX(3px);
}

.apex-hero-grid a.apex-panel:hover .apex-panel-sheen,
.apex-hero-grid a.apex-panel:focus .apex-panel-sheen,
.apex-hero-grid a.apex-panel.is-active .apex-panel-sheen {
  animation: apexSheenSweep 0.85s ease forwards;
}

.apex-hero-grid a.apex-panel:hover .apex-panel-list li,
.apex-hero-grid a.apex-panel:focus .apex-panel-list li,
.apex-hero-grid a.apex-panel.is-active .apex-panel-list li {
  opacity: 1;
  transform: translateY(0);
  color: #ffffff;
}

.apex-panel-list li:nth-child(1) { transition-delay: 0.03s; }
.apex-panel-list li:nth-child(2) { transition-delay: 0.08s; }
.apex-panel-list li:nth-child(3) { transition-delay: 0.13s; }
.apex-panel-list li:nth-child(4) { transition-delay: 0.18s; }
.apex-panel-list li:nth-child(5) { transition-delay: 0.23s; }

@keyframes apexSheenSweep {
  0%   { left: -120%; }
  100% { left: 150%; }
}

/* ---------- Subpage Animated Banners ---------- */
.apex-sub-banner {
  position: relative;
  width: 100%;
  max-width: 1020px;
  height: 214px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 14px;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  text-align: left;
  color: #ffffff;
  box-sizing: border-box;
  background-color: #06419f;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
}

.apex-sub-banner *,
.apex-sub-banner *::before,
.apex-sub-banner *::after {
  box-sizing: border-box;
}

/* Theme backgrounds using recovered original banner artwork */
.apex-sub-banner--orange {
  background-color: #fc8203;
  --sub-accent: #ffe082;
  --sub-pill-bg: rgba(120, 42, 0, 0.55);
}
.apex-sub-banner--orange .apex-sub-bg {
  background-image: url("images/banner_01.jpg");
}

.apex-sub-banner--blue {
  background-color: #06419f;
  --sub-accent: #7dd3fc;
  --sub-pill-bg: rgba(3, 28, 82, 0.58);
}
.apex-sub-banner--blue .apex-sub-bg {
  background-image: url("images/banner_02.jpg");
}

.apex-sub-banner--green {
  background-color: #3bbd03;
  --sub-accent: #d9f99d;
  --sub-pill-bg: rgba(15, 72, 4, 0.56);
}
.apex-sub-banner--green .apex-sub-bg {
  background-image: url("images/banner_03.jpg");
}

.apex-sub-banner--purple {
  background-color: #392a87;
  --sub-accent: #ddd6fe;
  --sub-pill-bg: rgba(30, 18, 88, 0.6);
}
.apex-sub-banner--purple .apex-sub-bg {
  background-image: url("images/banner_04.jpg");
}

.apex-sub-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
  animation: apexSubDrift 16s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes apexSubDrift {
  0%   { transform: scale(1) translateX(0); }
  100% { transform: scale(1.04) translateX(-8px); }
}

/* Subtle left contrast gradient so animated text is always razor-sharp */
.apex-sub-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.42) 0%,
    rgba(0, 0, 0, 0.25) 54%,
    rgba(0, 0, 0, 0.05) 78%,
    rgba(0, 0, 0, 0) 100%
  );
  z-index: 1;
}

/* Sweeping tech light line (homage to Flash motion graphics) */
.apex-sub-scanline {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 34%;
  background: linear-gradient(
    105deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: apexBannerSweep 10.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes apexBannerSweep {
  0%, 15%   { left: -45%; opacity: 0; }
  22%       { opacity: 1; }
  48%       { left: 115%; opacity: 0.7; }
  52%, 100% { left: 115%; opacity: 0; }
}

/* Content container */
.apex-sub-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  max-width: 620px;
  padding: 22px 32px;
}

/* Eyebrow typewriter line ("Your new business leader") */
.apex-sub-eyebrow {
  min-height: 20px;
  margin: 0 0 6px 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--sub-accent, #ffe082);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  opacity: 1;
  transition: opacity 0.45s ease;
}

.apex-sub-eyebrow.is-fading {
  opacity: 0;
}

.apex-sub-cursor {
  display: inline-block;
  width: 2px;
  height: 13px;
  margin-left: 3px;
  vertical-align: -2px;
  background: var(--sub-accent, #ffe082);
  animation: apexCursorBlink 0.75s step-end infinite;
}

@keyframes apexCursorBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* Main kinetic title ("Apex Micro Systems, Inc.") */
.apex-sub-title {
  margin: 0 0 8px 0;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.4px;
  color: #ffffff;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.48);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.apex-sub-title.is-fading {
  opacity: 0;
  transform: translateY(-6px);
}

.apex-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(14px) rotateY(-65deg) scale(0.85);
  transition: opacity 0.42s ease, transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

.apex-char.is-in {
  opacity: 1;
  transform: translateY(0) rotateY(0deg) scale(1);
}

/* Tagline ("Modernize your business for maximum efficiency") */
.apex-sub-tagline {
  margin: 0 0 14px 0;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.apex-sub-tagline.is-in {
  opacity: 1;
  transform: translateX(0);
}

/* Bottom badge bar */
.apex-sub-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.apex-sub-meta.is-in {
  opacity: 1;
  transform: translateY(0);
}

.apex-sub-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--sub-pill-bg, rgba(0, 0, 0, 0.42));
  border: 1px solid rgba(255, 255, 255, 0.32);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.apex-sub-phone {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  opacity: 0.94;
}

/* Responsive fallback on narrow screens */
@media (max-width: 720px) {
  .apex-hero-grid {
    flex-wrap: wrap;
    height: auto;
  }
  .apex-hero-grid a.apex-panel,
  .apex-hero-grid a.apex-panel:link {
    flex: 1 1 50%;
    min-height: 185px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  }
  .apex-sub-banner {
    height: auto;
    min-height: 190px;
  }
  .apex-sub-content {
    padding: 20px 22px;
  }
  .apex-sub-title {
    font-size: 25px;
  }
}

@media (max-width: 460px) {
  .apex-hero-grid a.apex-panel,
  .apex-hero-grid a.apex-panel:link {
    flex: 1 1 100%;
    border-right: none;
  }
}

/* Accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .apex-sub-bg,
  .apex-sub-scanline,
  .apex-sub-cursor,
  .apex-panel-sheen {
    animation: none !important;
  }
  .apex-char,
  .apex-sub-tagline,
  .apex-sub-meta,
  .apex-panel-list li {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
