/* ============================================================
   SavTech HRMS landing — redesigned section layouts + interactions.
   Loaded after landing.css + landing-dark.css. Reuses the design
   tokens (--space/--radius/--surface/--text/--magenta/--violet).
   All new classes are namespaced `rx-` to avoid clashing.
   ============================================================ */

/* Accent colours used by the rx-* components. Light defaults here; the dark
   theme brightens them (see landing-dark.css). Both themes therefore get
   accessible contrast without duplicating every rule. */
:root { --rx-accent: var(--magenta-600); --rx-accent-2: var(--violet-500); }

/* ---- shared: cursor spotlight on cards -------------------------------- */
.rx-spot { position: relative; overflow: hidden; }
.rx-spot::before {
  content: ""; position: absolute; inset: 0; z-index: 0; opacity: 0;
  transition: opacity .35s var(--ease);
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%),
              color-mix(in srgb, var(--magenta-500) 22%, transparent), transparent 60%);
}
.rx-spot:hover::before { opacity: 1; }
.rx-spot > * { position: relative; z-index: 1; }

/* ============================================================ MARQUEE */
.rx-marquee {
  overflow: hidden; padding: var(--space-6) 0;
  border-block: 1px solid var(--border-faint);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.rx-marquee__label {
  text-align: center; color: var(--text-subtle);
  font-family: var(--font-display); font-size: var(--text-xs);
  letter-spacing: .14em; text-transform: uppercase; margin-bottom: var(--space-5);
}
.rx-marquee__track {
  display: flex; gap: var(--space-3); width: max-content;
  animation: rx-scroll 34s linear infinite;
}
.rx-marquee:hover .rx-marquee__track { animation-play-state: paused; }
.rx-mchip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 10px var(--space-4); white-space: nowrap;
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--surface); color: var(--text);
  font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--text-md);
}
.rx-mchip svg { width: 16px; height: 16px; color: var(--rx-accent-2); }
@keyframes rx-scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .rx-marquee__track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
}

/* ============================================================ BENTO */
.rx-bento {
  display: grid; grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr; gap: var(--space-4);
  grid-auto-flow: row dense;
}
.rx-cell {
  padding: var(--space-6);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform .28s var(--ease), border-color .28s var(--ease), box-shadow .28s var(--ease);
}
.rx-cell:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.rx-cell--lg   { grid-column: span 2; grid-row: span 2; }
.rx-cell--wide { grid-column: span 2; }
.rx-cell__icon {
  width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: var(--space-4);
  border-radius: var(--radius-lg);
  color: var(--rx-accent);
  background: color-mix(in srgb, var(--magenta-500) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--magenta-500) 30%, transparent);
}
.rx-cell__icon svg { width: 22px; height: 22px; }
.rx-cell--lg .rx-cell__icon { color: var(--rx-accent-2);
  background: color-mix(in srgb, var(--violet-500) 18%, transparent);
  border-color: color-mix(in srgb, var(--violet-500) 32%, transparent); }
.rx-cell h3 { font-family: var(--font-display); font-size: var(--text-xl); margin-bottom: var(--space-2); color: var(--text); }
.rx-cell--lg h3 { font-size: var(--text-3xl); }
.rx-cell p { color: var(--text-muted); line-height: var(--leading-relaxed); font-size: var(--text-base); }
.rx-cell--lg p { font-size: var(--text-lg); }
.rx-cell__meta { margin-top: var(--space-5); display: flex; flex-wrap: wrap; gap: var(--space-2); }
.rx-cell__meta span {
  font-size: var(--text-xs); font-weight: var(--fw-semibold);
  padding: 4px 10px; border-radius: var(--radius-full);
  color: var(--rx-accent-2); background: color-mix(in srgb, var(--violet-500) 14%, transparent);
}
@media (max-width: 900px) {
  .rx-bento { grid-template-columns: repeat(2, 1fr); }
  .rx-cell--lg { grid-column: span 2; grid-row: span 1; }
}
@media (max-width: 560px) {
  .rx-bento { grid-template-columns: 1fr; }
  .rx-cell--lg, .rx-cell--wide { grid-column: span 1; }
}

/* ============================================================ TABBED SHOWCASE */
.rx-tabs__nav {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--space-2); margin-bottom: var(--space-7);
}
.rx-tab {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 10px var(--space-5);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--surface); color: var(--text-muted);
  font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--text-md);
  cursor: pointer; transition: color .2s, border-color .2s, background .2s, transform .2s;
}
.rx-tab:hover { color: var(--text); border-color: var(--border-strong); }
.rx-tab.is-active {
  color: #fff; border-color: transparent;
  background: linear-gradient(100deg, var(--magenta-500) 0%, var(--violet-500) 100%);
  box-shadow: 0 8px 24px rgba(230, 0, 126, .28);
}
.rx-tab svg { width: 16px; height: 16px; }
.rx-panel { display: none; grid-template-columns: 1fr 1.15fr; gap: var(--space-8); align-items: center; }
.rx-panel.is-active { display: grid; animation: rx-fade .5s var(--ease) both; }
@keyframes rx-fade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rx-panel__media { perspective: 1300px; }
.rx-panel__media .browser {
  transform-style: preserve-3d; transition: transform .12s ease-out; will-change: transform;
}
@media (max-width: 860px) {
  .rx-panel.is-active { grid-template-columns: 1fr; }
  .rx-panel__media { order: -1; }
}

/* ============================================================ TIMELINE */
.rx-timeline { position: relative; margin-top: var(--space-8); }
.rx-timeline__line {
  position: absolute; top: 27px; left: 8%; right: 8%; height: 2px;
  background: var(--border); border-radius: var(--radius-full); overflow: hidden;
}
.rx-timeline__fill {
  display: block; height: 100%; width: var(--p, 0%);
  background: linear-gradient(90deg, var(--magenta-500), var(--violet-400));
  transition: width .15s linear;
}
.rx-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }
.rx-step { text-align: center; }
.rx-step__num {
  width: 56px; height: 56px; margin: 0 auto var(--space-4);
  display: grid; place-items: center; border-radius: 50%;
  font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--text-2xl);
  color: var(--text-muted); background: var(--surface); border: 1px solid var(--border);
  position: relative; z-index: 1;
  transition: transform .3s var(--ease), background .3s, color .3s, box-shadow .3s, border-color .3s;
}
.rx-step.is-active .rx-step__num {
  color: #fff; border-color: transparent; transform: scale(1.08);
  background: linear-gradient(160deg, var(--magenta-500), var(--violet-500));
  box-shadow: 0 10px 26px rgba(230, 0, 126, .38);
}
.rx-step h3 { font-family: var(--font-display); font-size: var(--text-lg); margin-bottom: var(--space-2); color: var(--text); }
.rx-step p { color: var(--text-muted); font-size: var(--text-base); line-height: var(--leading-relaxed); text-wrap: pretty; }
@media (max-width: 720px) {
  .rx-timeline__line { display: none; }
  .rx-steps { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
}
@media (max-width: 420px) { .rx-steps { grid-template-columns: 1fr; } }

/* ============================================================ TESTIMONIALS */
.rx-tmony { padding: var(--space-10) 0; }
.rx-tmony__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.rx-quote {
  padding: var(--space-6);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform .28s var(--ease), border-color .28s;
}
.rx-quote:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.rx-quote__mark { font-family: var(--font-display); font-size: 2.6rem; line-height: .6; color: var(--rx-accent); opacity: .7; }
.rx-quote blockquote { margin-top: var(--space-3); color: var(--text); font-size: var(--text-lg); line-height: var(--leading-relaxed); text-wrap: pretty; }
.rx-quote figcaption { margin-top: var(--space-5); display: flex; align-items: center; gap: var(--space-3); }
.rx-quote__avatar {
  width: 42px; height: 42px; flex: none; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--text-md);
  background: linear-gradient(135deg, var(--magenta-500), var(--violet-500));
}
.rx-quote__who b { display: block; color: var(--text); font-size: var(--text-md); }
.rx-quote__who span { color: var(--text-muted); font-size: var(--text-sm); }
@media (max-width: 860px) { .rx-tmony__grid { grid-template-columns: 1fr; } }

/* ============================================================ FAQ */
.rx-faq { padding: var(--space-10) 0; }
.rx-faq__list { max-width: 820px; margin-inline: auto; display: flex; flex-direction: column; gap: var(--space-3); }
.rx-faq__item {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); overflow: hidden;
  transition: border-color .2s;
}
.rx-faq__item[open] { border-color: var(--border-strong); }
.rx-faq__item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--text-lg); color: var(--text);
}
.rx-faq__item summary::-webkit-details-marker { display: none; }
.rx-faq__ico { flex: none; width: 22px; height: 22px; color: var(--rx-accent); transition: transform .3s var(--ease); }
.rx-faq__item[open] .rx-faq__ico { transform: rotate(135deg); }
.rx-faq__body { padding: 0 var(--space-6) var(--space-5); color: var(--text-muted); line-height: var(--leading-relaxed); }
.rx-faq__item[open] .rx-faq__body { animation: rx-fade .3s var(--ease) both; }

/* ============================================================ MISC */
[data-magnetic] { will-change: transform; transition: transform .25s var(--ease); }

/* When GSAP drives reveals, let it fully own opacity/transform (no CSS
   transition fighting the tween). The vanilla .reveal path is unaffected. */
html.gsap-on .reveal { transition: none !important; }

/* Theme toggle button in the nav */
.nav__theme { color: var(--text-muted); }
.nav__theme:hover { color: var(--text); }
