/* ==========================================================================
   Dashboard-category overview master template (master-design.php)
   Shares tokens/components with home.css (--black, --amber, .button,
   .section-chip, .marquee-window/.marquee-track, .faq-*, .cta-*).
   ========================================================================== */

.md-page { background: var(--black); }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.md-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 96px 19px 0px;
  background: var(--black);
}

/* Same asset + placement as .sa-hero-bg in shipmentanalysis.css (products.php). */
.md-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 548.8px;
  object-fit: fill;
  pointer-events: none;
}

/* ── Glass header (mirrors .sa-glass-header in shipmentanalysis.css) ────
   Lets the sticky nav go transparent/blurred over the hero glow instead of
   sitting on top as a flat opaque bar — same mechanism products.php uses. */
.md-glass-header { --md-header-h: 80px; }

@media (min-width: 1024px) {
  .md-glass-header { --md-header-h: 65px; }
}

@media (max-width: 640px) {
  .md-glass-header { --md-header-h: 76px; }
}

.md-glass-header .wb-header {
  background: rgba(7, 7, 7, .34);
  border-bottom: 1px solid var(--wb-hairline);
  -webkit-backdrop-filter: blur(26px) saturate(155%);
  backdrop-filter: blur(26px) saturate(155%);
  transition: background .35s ease, border-color .35s ease, box-shadow .35s ease;
}

.md-glass-header .wb-nav {
  background: transparent;
  border-bottom: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.md-glass-header .wb-header.wb-scrolled {
  background: rgba(7, 7, 7, .82);
  border-bottom-color: rgba(237, 233, 228, .22);
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .65);
}

.md-glass-header .wb-header.wb-scrolled .wb-nav { box-shadow: none; }

/* Pull the hero under the bar and hand the same amount back as padding, so
   no hero content moves. */
.md-glass-header .md-hero {
  margin-top: calc(-1 * var(--md-header-h));
  padding-top: calc(96px + var(--md-header-h));
}

/* The glow art is anchored to the hero's top edge — grow it by the same
   amount so its falloff lands exactly where it did before. */
.md-glass-header .md-hero-bg {
  height: calc(548.8px + var(--md-header-h));
}

@media (max-width: 480px) {
  .md-glass-header .md-hero { padding-top: calc(76px + var(--md-header-h)); }
}

.md-hero-content {
  position: relative;
  z-index: 1;
  width: min(820px, 100%);
  margin: 0 auto;
  text-align: center;
}

.md-hero-title {
  margin: 0;
  color: #fff;
  font-size: 35px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.18;
}

.md-hero-copy {
  max-width: 650px;
  margin: 18px auto 0;
  color: #fff;
  font-size: 14px;
  font-weight: 400;
  line-height: 21px;
}

.md-hero-cta {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.md-hero-media {
  width: min(760px, 100%);
  margin: 40px auto 0;
  /* border-radius: 20px; */
  overflow: hidden;
  height: 470px;
  /* box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .07); */
}

.md-hero-media img {
  display: block;
  width: 100%;
  height: auto;
}

@media (prefers-reduced-motion: no-preference) {
  .md-hero-media { animation: md-hero-media-in .7s cubic-bezier(0.16, 1, 0.3, 1) .15s both; }
}

@keyframes md-hero-media-in {
  from { opacity: 0; transform: translateY(28px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Trusted-by marquee ───────────────────────────────────────────────── */
.md-brands {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0;
  padding: 8px 0 56px;
  text-align: center;
  background: var(--black);
}

.md-brands p {
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
}

.md-brands .marquee-window { margin-top: 24px; }

@media (prefers-reduced-motion: no-preference) {
  .md-brands .marquee-track { animation: brand-drift 36s linear infinite; }
}

/* ── Shared section heading ──────────────────────────────────────────── */
.md-section-header {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  margin: 0 auto;
  text-align: center;
}

.md-section-header h2 {
  margin: 0;
  color: #fff;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
}

.md-section-header h2 em {
  color: var(--amber);
  font-style: normal;
}

.md-section-header p {
  margin: 18px auto 0;
  max-width: 640px;
  color: #b3b3b3;
  font-size: 14px;
  font-weight: 400;
  line-height: 21px;
}

/* ── Dashboard capability cards (sticky numbered scroll-cycle) ──────────
   Mechanism mirrors terminal-x.ai's "01–06" feature list: a sticky left
   panel (number + image) that crossfades as the matching right-column
   step scrolls through view, driven here via the same scroll+rAF
   getBoundingClientRect technique used by .solutions-pin / .funnel in
   app.js (IntersectionObserver misbehaves under the smart-zoom root
   `zoom`, so this codebase intentionally avoids it — see app.js comments).
   ───────────────────────────────────────────────────────────────────── */
.md-cards {
  position: relative;
  padding: 64px 19px 40px;
  background: var(--black);
}

.md-cards-layout {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 64px;
  width: min(1150px, 100%);
  margin: 48px auto 0;
  align-items: start;
}

.md-cards-sticky {
  position: sticky;
  top: 112px;
  display: flex;
  align-items: stretch; /* rail must match .md-cards-media's height so the
                            progress-line rail has real vertical room to
                            spread its stack across, not collapse to 0. */
  gap: 24px;
}

/* Number rail — mirrors the reference's crossfading nslot pair plus a
   stacked tick-mark rail that collapses toward the top as steps pass. */
.md-cards-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 34px;
  flex-shrink: 0;
  padding-top: 4px;
}

/* Figma places the number under the top tick line, not above it — the
   number is taken out of flex flow and overlaid just below where the
   active (r=0) line sits, rather than stacking before .md-cards-rail-lines. */
.md-cards-nslot-wrap {
  position: absolute;
  top: 16px;
  left: 0;
  width: 100%;
  height: 1.05em;
  text-align: center;
  white-space: nowrap;
}

.md-cards-nslot {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
}

.md-cards-rail-lines {
  position: relative;
  width: 100%;
  flex: 1;
}

.md-cards-line {
  position: absolute;
  top: 0;
  left: 0;
  height: 1px;
  width: 100%;
  background: rgba(255, 255, 255, .14);
  transform: translateY(0);
  will-change: transform;
  /* Positioned purely via transform (see master-design.js setLines) so a
     switch always interpolates two concrete values on the compositor —
     the previous top/bottom pair jumped instantly whenever either side
     held "auto", which isn't an animatable value. */
  transition: transform .55s cubic-bezier(0.16, 1, 0.3, 1), background-color .4s ease-out;
}

.md-cards-media {
  position: relative;
  width: 100%;
  aspect-ratio: 547 / 547;
  /* border-radius: 24px; */
  overflow: hidden;
  background: #101010;
  border: 1px solid rgba(255, 255, 255, .07);
}

.md-cards-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform, opacity;
}

/* Per-step media — desktop hides these (the sticky rail/media panel on the
   left carries the imagery instead); mobile shows each step's own image
   inline, with a one-shot amber "grown" progress bar under it. */
.md-card-step-media {
  position: relative;
  display: none;
  margin-bottom: 20px;
  border-radius: 16px;
  overflow: hidden;
  background: #101010;
}

.md-card-step-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 343 / 220;
  object-fit: cover;
}

.md-card-step-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 64px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1s cubic-bezier(.4, 0, .2, 1);
}

.md-card-step-bar.is-grown { transform: scaleX(1); }

.md-cards-steps {
  display: flex;
  flex-direction: column;
}

.md-card-step {
  padding: 48px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
  opacity: .45;
  transition: opacity .35s ease;
}

.md-card-step:first-child { border-top: none; padding-top: 0; }
.md-card-step.is-active { opacity: 1; }

.md-card-step h3 {
  margin: 0;
  color: var(--amber);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
}

.md-card-step p {
  margin: 10px 0 0;
  max-width: 560px;
  color: #fff;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
}

.md-card-checks {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.md-card-checks li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
}

.md-card-checks img { display: block; width: 14px; height: 14px; flex-shrink: 0; margin-top: 3px; }

.md-card-step-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  color: var(--amber);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: gap .2s ease, color .2s ease;
}

.md-card-step-link svg { width: 10px; height: 8px; }
.md-card-step-link svg path { stroke: var(--amber); }
.md-card-step-link:hover { gap: 12px; color: #ffc126; }
.md-card-step-link:hover svg path { stroke: #ffc126; }

/* ── Benefits grid ────────────────────────────────────────────────────── */
.md-benefits {
  padding: 56px 19px 72px;
  background: var(--black);
}

.md-benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(1150px, 100%);
  margin: 40px auto 0;
  padding: 0;
  list-style: none;
  border: 1px solid #242323;
  border-radius: 16px;
  overflow: hidden;
}

.md-benefit-card {
  padding: 28px;
  border-right: 1px solid #242323;
  border-bottom: 1px solid #242323;
  background: rgba(7, 7, 7, .2);
  backdrop-filter: blur(12px);
  transition: background-color .25s ease;
}

.md-benefit-card:nth-child(3n) { border-right: 0; }
/* Card counts vary per page and aren't always a multiple of 3 — a lone card
   stranded in the last row (e.g. item 7 of 7) has nothing beside it, so its
   right border needs stripping too or it dangles into the empty cells. This
   also covers the 2-column breakpoint below, where it outranks that grid's
   own nth-child(2n) rule on specificity regardless of source order. */
.md-benefit-card:last-child { border-right: 0; }

.md-benefit-card:hover { background: rgba(248, 178, 4, .06); }

.md-benefit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
  border-radius: 12px 0 12px 12px;
  background: var(--amber);
  transition: transform .22s ease, box-shadow .22s ease;
}

.md-benefit-card:hover .md-benefit-icon {
  transform: scale(1.06);
  box-shadow: 0 6px 14px rgba(248, 178, 4, .28);
}

.md-benefit-icon img { display: block; width: 22px; height: 22px; }

.md-benefit-card h3 {
  margin: 0;
  color: var(--amber);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.35;
}

.md-benefit-card p {
  margin: 10px 0 0;
  color: #fff;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.55;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .md-benefits-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md-benefit-card { border-right: 1px solid #242323; }
  .md-benefit-card:nth-child(2n) { border-right: 0; }
}

@media (max-width: 900px) {
  .md-hero-title { font-size: 32px; }
  .md-hero-copy { font-size: 13.5px; }
  .md-hero-bg { display: none; }

  .md-cards-layout { grid-template-columns: 1fr; gap: 28px; }

  /* Below 900px the shared sticky rail/media panel is replaced by each
     step carrying its own inline image + growth bar (md-card-step-media). */
  .md-cards-sticky { display: none; }

  .md-card-step-media { display: block; }

  .md-card-step { opacity: 1; padding: 32px 0; }
  .md-card-step h3 { font-size: 20px; }

  .md-hero-media { margin-top: 32px; border-radius: 16px; }

  .md-benefits-grid { grid-template-columns: 1fr; }
  .md-benefit-card { border-right: 0; }
}

@media (max-width: 480px) {
  .md-hero { padding: 76px 16px 48px; }
  .md-hero-title { font-size: 27px; }
  .md-section-header h2 { font-size: 26px; }
  .md-hero-media { margin-top: 24px; border-radius: 12px; }
  .md-benefit-card { padding: 22px; }
}
