/* ============================================================
   TEZ ERP — Complete Features Directory Stylesheet
   Rebuilt from reference design using shared font tokens.
   ============================================================ */

:root {
  --featBlue: #245eea;
  --featBlueHover: #184ccb;
  --featDark: #101820;
  --featCardBg: #111a28;
  --featLime: #d8e6fc;
  --featBorder: #d4d8dd;
  --featBody: #475569;
  --featMuted: #64748b;
  --featLightBg: #f0f6ff;
  --featPaper: #f4f6f8;
  --featLight: #fafbfc;
  --featChoiceBg: #10212a;
}

.featuresPage {
  color: var(--featDark);
  background: #ffffff;
  font-family: var(--font-body, 'Inter', sans-serif);
  overflow: clip;
}

/* ============ 1. HERO SECTION ============ */
.featuresHero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.75fr);
  gap: clamp(50px, 9vw, 150px);
  min-height: 690px;
  padding: clamp(64px, 6vw, 88px) 7vw 84px;
  color: #10212a;
  background: radial-gradient(circle at 82% 28%, rgba(56, 189, 248, 0.28), transparent 24%), linear-gradient(135deg, #fbfaf6 0 62%, #e5eef9 62%);
  font-family: var(--font-body, 'Inter', sans-serif);
  line-height: normal;
}

/* Fine grain from the supplied reference design. */
.featuresHero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

/* Decorative circle */
.featuresHero::after {
  content: '';
  position: absolute;
  right: -7vw;
  bottom: -23vw;
  width: 44vw;
  aspect-ratio: 1;
  border: 1px solid rgba(16, 33, 42, 0.13);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 4vw rgba(255, 255, 255, 0.16), 0 0 0 8vw rgba(255, 255, 255, 0.12);
}

.featuresHero > div {
  position: relative;
  z-index: 1;
  max-width: 830px;
}

.featuresHero > div > span {
  display: block;
  margin-bottom: 26px;
  color: #1e65d6;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.featuresHero h1 {
  max-width: 800px;
  margin: 0;
  font-family: var(--font-display, 'Inter', sans-serif);
  font-size: clamp(3.6rem, 5.7vw, 5.9rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.82;
  color: #10212a;
}

.featuresHero h1 em {
  color: #1e65d6;
  font-style: normal;
  font-weight: 400;
}

.featuresHero > div > p {
  max-width: 680px;
  margin: 42px 0 34px;
  color: #465860;
  font-size: clamp(1rem, 1.3vw, 1.22rem);
  line-height: 1.7;
  font-weight: 400;
}

.btn-features-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 19px;
  background: #10212a;
  color: #ffffff !important;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: normal;
  border: 1px solid #10212a;
  border-radius: 2px;
  text-decoration: none;
  box-shadow: none;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.btn-features-hero:hover {
  background: #10212a;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(16, 33, 42, 0.16);
}

/* Right Aside Feature Map Card */
.featuresHero aside {
  position: relative;
  z-index: 2;
  align-self: end;
  padding: 34px;
  border: 1px solid rgba(16, 33, 42, 0.2);
  background: rgba(251, 250, 246, 0.78);
  color: #10212a;
  box-shadow: 0 24px 70px rgba(18, 34, 42, 0.1);
  backdrop-filter: blur(16px);
}

.featuresHero aside small {
  margin: 0;
  color: #1e65d6;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.featuresHero aside strong {
  display: block;
  margin: 24px 0 -7px;
  font-family: var(--font-display, 'Inter', sans-serif);
  font-size: clamp(5rem, 8vw, 8rem);
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 0.9;
  color: #10212a;
}

.featuresHero aside b {
  margin: 0;
  font-family: var(--font-display, 'Inter', sans-serif);
  font-size: 1.55rem;
  font-weight: 500;
  color: #10212a;
}

.featuresHero aside p {
  margin: 48px 0 8px;
  color: #10212a;
  font-size: 1rem;
  font-weight: 700;
  line-height: normal;
}

.featuresHero aside > span {
  color: #465860;
  font-size: 0.82rem;
}

/* ============ 2. STICKY EXPLORER LAYOUT (sidebar + content) ============ */
.featuresExplorerWrap {
  display: grid;
  grid-template-columns: minmax(245px, .72fr) minmax(0, 2.7fr);
  border-top: 1px solid var(--featBorder);
}

/* Sticky Sidebar Category Index */
.featureIndex {
  position: sticky;
  grid-row: 1 / span 2;
  top: var(--header-height, 72px);
  align-self: start;
  height: calc(100vh - var(--header-height, 72px));
  padding: 30px 2.5vw 26px 4.5vw;
  border-right: 1px solid var(--featBorder);
  background: #eaedf2;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 24, 32, 0.2) transparent;
}

.featureIndex::-webkit-scrollbar {
  width: 4px;
}

.featureIndex::-webkit-scrollbar-track {
  background: transparent;
}

.featureIndex::-webkit-scrollbar-thumb {
  background: rgba(16, 24, 32, 0.18);
  border-radius: 4px;
}

.featureIndexSection + .featureIndexSection {
  margin-top: 25px;
}

.featureIndexSection h2 {
  margin: 0 0 11px;
  color: var(--featMuted);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  line-height: 1.2;
  text-transform: uppercase;
}

.featureIndexItem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  color: var(--featMuted);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.featureIndexItem:hover,
.featureIndexItem.active {
  color: var(--featBlue);
  transform: translateX(4px);
}

.featureIndexItem.active {
  font-weight: 700;
}

.featureIndexItem.active::before {
  content: '●';
  font-size: 7px;
  color: var(--featBlue);
}

.featureIndexCategory {
  display: contents;
  pointer-events: none;
}

.featureIndexDivider {
  display: none;
}

/* ============ 3. EDITORIAL INTRO ============ */
.featureIntro,
.featureCatalogue {
  grid-column: 2;
}

.featureIntro {
  padding: clamp(54px, 6vw, 76px) 7vw 96px;
  border-bottom: 1px solid var(--featBorder);
  background: var(--featLight);
}

.featureIntro > span {
  display: block;
  margin-bottom: 18px;
  color: var(--featBlue);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.featureIntro h2 {
  max-width: 940px;
  margin: 0;
  font-family: var(--font-display, 'Inter', sans-serif);
  font-size: clamp(2.8rem, 5vw, 5.2rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.96;
  color: var(--featDark);
}

.featureIntro p {
  max-width: 690px;
  margin: 22px 0 0 auto;
  color: var(--featBody);
  font-size: 1.05rem;
  line-height: 1.7;
  font-weight: 400;
}

/* ============ 4. FEATURE CATALOGUE (8 Groups) ============ */
.featureCatalogue {
  background: var(--featLight);
}

.featureGroup {
  scroll-margin-top: var(--header-height, 72px);
  background: var(--featLight);
}

.featureGroup header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 20px;
  align-items: center;
  padding: 34px 7vw 28px;
  border-bottom: 1px solid var(--featBorder);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.featureGroup header:hover {
  background-color: rgba(36, 94, 234, 0.02);
}

.featureGroupTitle h2 {
  margin: 0;
  font-family: var(--font-display, 'Inter', sans-serif);
  font-size: clamp(1.8rem, 3.5vw, 3.6rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--featDark);
}

.featureGroupTitle p {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--featMuted);
  font-size: 15px;
  line-height: 1.55;
}

.featureGroup header > b {
  padding: 7px 13px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #144997;
  background: var(--featLime);
  border: 1px solid #bfdbfe;
  white-space: nowrap;
  border-radius: 4px;
}

/* Toggle + button on extreme right */
.featureGroupToggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(16, 24, 32, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.35s cubic-bezier(0.22, 0.61, 0.28, 1);
  padding: 0;
  outline: none;
}

.featureGroupToggle::before,
.featureGroupToggle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--featDark, #101820);
  transform: translate(-50%, -50%);
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.28, 1), opacity 0.25s ease, background-color 0.25s ease;
}

.featureGroupToggle::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.featureGroup:not(.is-active) header:hover .featureGroupToggle {
  border-color: var(--featBlue, #245eea);
  background: #ffffff;
}

.featureGroup:not(.is-active) header:hover .featureGroupToggle::before,
.featureGroup:not(.is-active) header:hover .featureGroupToggle::after {
  background: var(--featBlue, #245eea);
}

.featureGroup.is-active .featureGroupToggle {
  background: var(--featBlue, #245eea);
  border-color: var(--featBlue, #245eea);
  transform: rotate(180deg);
}

.featureGroup.is-active header:hover .featureGroupToggle {
  background: var(--featBlueHover, #184ccb);
  border-color: var(--featBlueHover, #184ccb);
}

.featureGroup.is-active .featureGroupToggle::before {
  background: #ffffff;
}

.featureGroup.is-active .featureGroupToggle::after {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg) scaleX(0);
}

/* Expandable Body Container for Feature List (Universal: Desktop & Mobile) */
.featureGroupBody {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  opacity: 0;
  transition: grid-template-rows 0.45s cubic-bezier(0.22, 0.61, 0.28, 1), opacity 0.3s ease;
}

.featureGroup.is-active .featureGroupBody {
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows 0.45s cubic-bezier(0.22, 0.61, 0.28, 1), opacity 0.35s ease 0.05s;
}

.featureGroupBodyInner {
  min-height: 0;
  overflow: hidden;
}

/* Instant height calculation during programmatic jump */
.featureCatalogue.no-anim .featureGroupBody {
  transition: none !important;
}

/* Feature List Grid — 2-column with slide-in hover */
.featureList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.featureList article {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 82px;
  padding: 18px 4vw;
  border-right: 1px solid var(--featBorder);
  border-bottom: 1px solid var(--featBorder);
  overflow: hidden;
  transition: color 0.22s ease;
}

/* Slide-in dark background on hover */
.featureList article::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--featDark);
  transform: translateX(-101%);
  transition: transform 0.36s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.featureList article:hover {
  color: #ffffff;
}

.featureList article:hover::before {
  transform: translateX(0);
}

.featureList article:nth-child(even) {
  border-right: 0;
}

.featureList article small,
.featureList article b {
  position: relative;
  z-index: 1;
}

.featureList article small {
  color: var(--featBlue);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.featureList article:hover small {
  color: #38bdf8;
}

.featureList article b {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: clamp(0.88rem, 1.1vw, 1.05rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* ============ 5. CHOICE & FINAL CTA ============ */
.featuresChoice {
  position: relative;
  padding: clamp(100px, 13vw, 180px) 10vw;
  text-align: left;
  color: #ffffff;
  background: var(--featChoiceBg);
  font-family: var(--font-body, 'Inter', sans-serif);
  line-height: normal;
  overflow: hidden;
}

/* Fine grain retained from the supplied reference design. */
.featuresChoice::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

/* Decorative rings */
.featuresChoice::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -7vw;
  z-index: 0;
  width: 38vw;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  box-shadow: 0 0 0 4vw rgba(255, 255, 255, 0.03), 0 0 0 8vw rgba(255, 255, 255, 0.025);
}

.featuresChoice > * {
  position: relative;
  z-index: 1;
}

.featuresChoice > span {
  display: block;
  margin-bottom: 26px;
  color: #38bdf8;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.featuresChoice h2 {
  max-width: 760px;
  margin: 0;
  font-family: var(--font-display, 'Inter', sans-serif);
  font-size: clamp(3.1rem, 6vw, 6.2rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.96;
  color: #ffffff;
}

.featuresChoice > p {
  max-width: 600px;
  margin: 34px 0;
  color: #b8c4c9;
  font-size: 1.08rem;
  line-height: 1.7;
  font-weight: 400;
}

.featuresChoice > div {
  display: flex;
  align-items: center;
  gap: 16px;
}

.link-compare {
  padding: 14px 8px;
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.link-compare:hover {
  border-color: rgba(255, 255, 255, 0.8);
  color: #ffffff;
}

.btn-features-final {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 19px;
  background: #245eea;
  color: #ffffff !important;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.84rem;
  border: 1px solid #245eea;
  border-radius: 3px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(36, 94, 234, 0.25);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.btn-features-final:hover {
  background: #184ccb;
  border-color: #184ccb;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(24, 76, 203, 0.35);
}

/* ============ 6. REVEAL ANIMATION ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ RESPONSIVE ============ */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Tablet / medium screens */
@media (max-width: 1100px) {
  .featuresExplorerWrap {
    display: block;
  }

  /* 1. Shorter sticky bar with compact height and clean frosted blur */
  .featureIndex {
    position: sticky;
    top: var(--header-height, 72px);
    z-index: 50;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    width: 100%;
    height: auto;
    padding: 7px 4vw 8px;
    background: rgba(234, 237, 242, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 0;
    border-bottom: 1px solid var(--featBorder, #d4d8dd);
    box-shadow: 0 4px 16px rgba(16, 24, 32, 0.05);
    overflow: visible;
  }

  .featureIndexSection {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    margin: 0;
    padding: 0;
  }

  .featureIndexSection + .featureIndexSection {
    margin-top: 0;
  }

  /* Only category titles appear in the sticky bar on mobile */
  .featureIndexItem {
    display: none !important;
  }

  /* 2. No pills! Clean text with equal spacing and alignment */
  .featureIndexCategory {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 5px 6px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: inherit;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    pointer-events: auto;
  }

  .featureIndexCategory h2 {
    margin: 0;
    color: #556575;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.25;
    transition: color 0.2s ease, font-weight 0.2s ease;
  }

  .featureIndexCategory:hover h2 {
    color: var(--featDark, #101820);
  }

  .featureIndexCategory.is-current h2 {
    color: var(--featBlue, #245eea);
    font-weight: 800;
  }

  /* 2b. Thin horizontal divider lines fading at edges, not touching screen edges */
  .featureIndexDivider {
    display: block;
    grid-column: 1 / -1;
    width: 86%;
    height: 1px;
    margin: 2px auto;
    background: linear-gradient(
      90deg,
      rgba(16, 24, 32, 0) 0%,
      rgba(16, 24, 32, 0.16) 18%,
      rgba(16, 24, 32, 0.16) 82%,
      rgba(16, 24, 32, 0) 100%
    );
    pointer-events: none;
  }

  /* 2c. Thin vertical divider lines fading at top & bottom, not touching edges or horizontal lines (no overlap) */
  .featureIndexSection:nth-of-type(1)::after,
  .featureIndexSection:nth-of-type(3)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 52%;
    background: linear-gradient(
      180deg,
      rgba(16, 24, 32, 0) 0%,
      rgba(16, 24, 32, 0.18) 25%,
      rgba(16, 24, 32, 0.18) 75%,
      rgba(16, 24, 32, 0) 100%
    );
    pointer-events: none;
  }

  /* 3. 5th Section (Platform Capabilities) takes an entire row */
  .featureIndexSection:nth-of-type(5) {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  .featureIntro,
  .featureCatalogue {
    grid-column: auto;
  }

  .featureIntro {
    padding: 50px 6vw;
  }

  .featureIntro p {
    margin-left: 0;
  }

  /* 4. Feature Group accordion layout on mobile */
  .featureGroup {
    scroll-margin-top: calc(var(--header-height, 72px) + 95px);
  }

  .featureGroup header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 26px 56px 24px 6vw;
    cursor: pointer;
  }

  .featureGroup header > b {
    font-size: 11px;
    letter-spacing: 0.1em;
  }

  .featureGroupToggle {
    display: flex !important;
    position: absolute;
    top: 26px;
    right: 6vw;
    width: 32px;
    height: 32px;
    margin-left: 0;
  }

  .featureList {
    grid-template-columns: 1fr;
  }

  .featureList article,
  .featureList article:nth-child(even) {
    border-right: 0;
    padding: 16px 6vw;
  }

  /* Remove sticky touch-hover slide on mobile */
  .featureList article:hover {
    color: inherit;
  }

  .featureList article::before,
  .featureList article:hover::before {
    transform: translateX(-101%);
  }

  .featureList article:hover small {
    color: var(--featBlue);
  }
}

@media (max-width: 820px) {
  .featuresHero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 85px 6vw 70px;
    background: #fbfaf6;
  }

  .featuresHero h1 {
    font-size: clamp(3.25rem, 12vw, 5rem);
  }

  .featuresHero aside {
    max-width: 460px;
  }

  .featuresChoice {
    padding: 95px 7vw;
  }
}

/* Small mobile */
@media (max-width: 560px) {
  .featureIndex {
    top: var(--header-height, 60px);
    padding: 5px 3vw 6px;
  }

  .featureIndexSection {
    min-height: 26px;
  }

  .featureIndexCategory h2 {
    font-size: 10px;
    letter-spacing: 0.03em;
  }

  .featureGroup {
    scroll-margin-top: calc(var(--header-height, 60px) + 88px);
  }

  .featureGroup header {
    padding: 22px 50px 20px 5vw;
  }

  .featureGroupToggle {
    top: 22px;
    right: 5vw;
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 520px) {
  .featuresHero {
    padding-top: 68px;
  }

  .featuresHero h1 {
    letter-spacing: -0.075em;
  }

  .featuresHero > div > p {
    margin-top: 30px;
  }

  .featuresHero aside {
    padding: 27px;
  }

  .featuresChoice > div {
    flex-direction: column;
    align-items: stretch;
  }
}
