/* ===========================================================================
   Hero stage.
   ---------------------------------------------------------------------------
   The brief the rest of the site failed: not another dark gradient with two
   blurred circles behind it. The background here is a ledger — ruled lines and
   a faint column grid, drifting — because the subject is arithmetic about
   money, and a ledger is what that has always looked like.

   The payslip sits in real perspective with layered depth. Everything is
   transforms and a couple of keyframes; there is no library and no canvas.
   =========================================================================== */

.stage {
  position: relative;
  isolation: isolate;
  background: #04231f;
  color: #fff;
  padding: 132px 0 0;
  overflow: hidden;
  --mx: 70%;
  --my: 30%;
}

/* ── Ruled ledger, drifting ─────────────────────────────────────────────── */
.stage__rule {
  position: absolute;
  inset: -60px 0;
  z-index: 0;
  background-image:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(to right, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 120px);
  animation: ledger 26s linear infinite;
  mask-image: radial-gradient(120% 90% at 60% 20%, #000 30%, transparent 78%);
}
@keyframes ledger {
  to {
    transform: translateY(46px);
  }
}

/* A single warm pool of light that follows the cursor. One light source reads
   as a lit room; three blurred circles read as a template. */
.stage__spot {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    620px circle at var(--mx) var(--my),
    rgba(99, 231, 127, 0.16),
    transparent 62%
  );
  transition: background 0.5s ease-out;
}

.stage__wash {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(165deg, transparent 40%, rgba(0, 71, 66, 0.75) 100%),
    linear-gradient(to bottom, rgba(4, 35, 31, 0.2), transparent 30%);
}

.stage__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  gap: 48px;
  align-items: center;
  padding-bottom: 92px;
}

/* ── Copy ────────────────────────────────────────────────────────────────── */

/* A plain category label rather than a badge. The deck animating beside it
   already says the product is live; a "LIVE" pill was saying it twice. */
.stage__eyebrow {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--spring);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.stage__eyebrow::after {
  content: '';
  flex: 1;
  max-width: 68px;
  height: 1px;
  background: linear-gradient(to right, rgba(99, 231, 127, 0.55), transparent);
}

.stage__kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 26px;
}
.stage__kicker b {
  background: var(--spring);
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}

/* Two lines, always. The headline is four words now, so it can afford to be
   large — but it must not wrap past two or the hero gets top-heavy again. */
.stage h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.8rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  max-width: 17ch;
}
.stage h1 em {
  font-style: italic;
  color: var(--spring);
  position: relative;
  white-space: nowrap;
}
/* Hand-drawn underline rather than a border: the wobble is the point. */
.stage h1 em::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.06em;
  height: 0.14em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8.5C36 3.5 78 2.5 118 5.5c26 2 54 3 80 1.5' stroke='%2363E77F' stroke-width='3.4' fill='none' stroke-linecap='round' opacity='.55'/%3E%3C/svg%3E")
    no-repeat center / 100% 100%;
  animation: draw 1.1s 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
@keyframes draw {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

.stage__lede {
  margin-top: 24px;
  max-width: 48ch;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.62);
}
.stage__lede strong {
  color: #fff;
  font-weight: 600;
}

.stage__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

/* This was fine print under the CTA and is now a closing line, so it carries a
   little more weight — still quieter than the lede, but no longer a footnote. */
.stage__sub {
  margin-top: 24px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.52);
}

/* ── The rig ─────────────────────────────────────────────────────────────── */
.stage__viz {
  position: relative;
  min-height: 480px;
  display: grid;
  place-items: center;
  /* Room on the right for the mascot to clear the deck. */
  padding-right: 46px;
}

/* The rig is wider than the payslip on purpose: the extra 150px on the left is
   a gutter for the satellite cards, so they sit beside the payslip instead of
   on top of its text. They overlap its edge by a few pixels — enough to read as
   layered, not enough to cover a number. */
.rig {
  position: relative;
  width: min(430px, 100%);
  transform: perspective(1400px) rotateY(-14deg) rotateX(6deg);
  transform-style: preserve-3d;
  will-change: transform;
  animation: rig-in 1s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
@keyframes rig-in {
  from {
    opacity: 0;
    transform: perspective(1400px) rotateY(-26deg) rotateX(12deg) translateY(30px);
  }
}

/* Layers sit at different depths so the parallax actually separates them. */
.slab {
  border-radius: 20px;
  background: linear-gradient(168deg, #0d3d38, #072c28);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow:
    0 40px 90px -30px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.slab--ghost {
  position: absolute;
  inset: 26px -32px -26px 32px;
  transform: translateZ(-70px);
  opacity: 0.5;
  background: linear-gradient(168deg, #0a332f, #061f1c);
}

/* No backdrop-filter here. It creates a stacking context, which flattens the
   parent's preserve-3d in every browser — so translateZ stopped ordering the
   satellite cards and the payslip painted over them. */
.slab--main {
  position: relative;
  padding: 20px;
  transform: translateZ(0);
}

.rig__top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.rig__code {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(99, 231, 127, 0.14);
  color: var(--spring);
  border: 1px solid rgba(99, 231, 127, 0.28);
}
.rig__name {
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}
.rig__period {
  margin-left: auto;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.32);
}

.rig__gross {
  padding: 20px 0 16px;
}
.rig__gross span {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: 4px;
}
.rig__gross b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 2.05rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #fff;
}

.rig__rows {
  display: grid;
  gap: 2px;
  min-height: 132px;
}
.rig__row {
  display: grid;
  grid-template-columns: 1fr 44px auto;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  font-size: 0.82rem;
  opacity: 1;
  transform: none;
  transition:
    opacity 0.34s ease,
    transform 0.34s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.rig__row.is-in {
  opacity: 0;
  transform: translateX(18px);
}
.rig__row.is-out {
  opacity: 0;
  transform: translateX(-14px);
}
.rig__label {
  color: rgba(255, 255, 255, 0.62);
}
.rig__bar {
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.rig__bar i {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255, 180, 168, 0.5), #ffb4a8);
  animation: bar 0.7s 0.15s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
@keyframes bar {
  from {
    width: 0;
  }
}
.rig__amt {
  color: #ffb4a8;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* Net pay floats in front of the card. This is the number the whole page is
   about, so it gets the depth and the light. */
.rig__net {
  position: relative;
  margin-top: 16px;
  padding: 15px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99, 231, 127, 0.2), rgba(99, 231, 127, 0.07));
  border: 1px solid rgba(99, 231, 127, 0.36);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  transform: translateZ(46px);
  box-shadow: 0 22px 40px -18px rgba(99, 231, 127, 0.42);
}
.rig__net span {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--spring);
}
.rig__net b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--spring);
}

.rig__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.38);
}
.rig__foot b {
  font-family: var(--mono);
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
}

/* Cost tag pinned to the ghost slab behind, to show it is a separate thing. */
.rig__tag {
  position: absolute;
  right: -26px;
  bottom: -18px;
  transform: translateZ(-40px);
  background: #0a332f;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.8);
}
.rig__tag span {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.36);
}
.rig__tag b {
  font-family: var(--mono);
  font-size: 0.98rem;
  color: #fff;
  font-weight: 500;
}

/* ── Mascot ──────────────────────────────────────────────────────────────
   Sits behind the deck, one shoulder and the head clearing its edge, so it
   reads as looking over the product rather than standing beside it.

   Background image, not <img>: a missing file then renders as nothing instead
   of a broken-image icon, and the hero survives a bad deploy. */
.mascot {
  position: absolute;
  right: -10px;
  bottom: 10px;
  width: 108px;
  height: 170px;
  /* In front of the rig, not behind it. .slab--ghost is a half-opacity card
     offset 32px further right than the main slab, so a mascot underneath it
     got a dark green wash over whichever part it covered - the toy came out
     bisected down the ghost's edge. Sitting in front reads as a plush leaning
     on the corner of the card, which is the look anyway. */
  z-index: 1;
  background: url('../img/meet-trabbly-01.png') no-repeat center bottom / contain;
  /* Shadow tight and low so it falls onto the card it is resting against. */
  filter: drop-shadow(-8px 14px 20px rgba(0, 0, 0, 0.55));
  animation: bob 5.5s ease-in-out infinite;
  pointer-events: none;
}
/* Front view, sitting above the closing pitch. Static position rather than
   absolute — it should push the heading down, not float over it. */
.mascot--cta {
  position: static;
  width: 84px;
  height: 132px;
  margin-bottom: 6px;
  right: auto;
  bottom: auto;
  background-image: url('../img/meet-trabbly-01.png');
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.4));
}

/* Back view on the 404 — it is looking the other way too. */
.mascot--404 {
  position: static;
  width: 98px;
  height: 154px;
  margin: 0 auto 18px;
  right: auto;
  bottom: auto;
  background-image: url('../img/meet-trabbly.png');
  scale: -1 1;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.45));
}

/* Barely there — a couple of pixels. Enough to feel alive, not enough to
   pull the eye off the numbers. */
@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-9px) rotate(-1.2deg);
  }
}

/* ── The deck ────────────────────────────────────────────────────────────
   Three slides sharing one surface. Absolute so they occupy the same space
   without the container resizing between them, which would make the whole
   hero jump every seven seconds. */
.deck {
  position: relative;
  min-height: 428px;
}
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  pointer-events: none;
  transition:
    opacity 0.5s ease,
    transform 0.5s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.slide.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.slide .slab--main {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ── Org chart ───────────────────────────────────────────────────────────── */
.org {
  position: relative;
  flex: 1;
  padding: 18px 0 6px;
}
.org__wires {
  position: absolute;
  left: 0;
  right: 0;
  top: 52px;
  height: 96px;
  width: 100%;
  pointer-events: none;
}
.org__wires path {
  fill: none;
  stroke: rgba(99, 231, 127, 0.34);
  stroke-width: 1.4;
  stroke-dasharray: 620;
  stroke-dashoffset: 620;
}
.slide.is-play .org__wires path {
  animation: org-draw 0.9s 0.25s ease-out forwards;
}
@keyframes org-draw {
  to {
    stroke-dashoffset: 0;
  }
}

.org__lead {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  justify-content: center;
  padding: 11px 14px;
  border-radius: 13px;
  background: rgba(99, 231, 127, 0.11);
  border: 1px solid rgba(99, 231, 127, 0.3);
  width: fit-content;
  margin: 0 auto;
}
.org__who {
  display: grid;
  gap: 1px;
}
.org__who b {
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
}
.org__who i {
  font-style: normal;
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.48);
}

.org__row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 74px;
}
.org__node {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 12px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.11);
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
}
.slide.is-play .org__node {
  animation: node-in 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
  animation-delay: calc(0.55s + var(--i) * 0.11s);
}
@keyframes node-in {
  to {
    opacity: 1;
    transform: none;
  }
}
.org__node b {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.org__node i {
  font-style: normal;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.42);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--ink);
  background: linear-gradient(140deg, var(--spring), #3fae94);
  flex-shrink: 0;
}
.avatar--lg {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 0.78rem;
}

/* ── Clock and week ──────────────────────────────────────────────────────── */
.clock {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 18px;
}
.clock__now span {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: 3px;
}
.clock__now b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 2.05rem;
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.02em;
}
.clock__stamps {
  display: flex;
  gap: 8px;
}
.stamp {
  display: grid;
  gap: 2px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.stamp i {
  font-style: normal;
  font-size: 0.6rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}
.stamp b {
  font-size: 0.86rem;
  color: #fff;
  font-weight: 500;
}
.stamp--in {
  background: rgba(99, 231, 127, 0.12);
  border-color: rgba(99, 231, 127, 0.3);
}
.stamp--in b {
  color: var(--spring);
}

.week {
  flex: 1;
  padding: 4px 0 10px;
}
.week__ttl {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.32);
  margin-bottom: 10px;
}
.week__bars {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
  height: 78px;
  align-items: end;
}
.week__bars span {
  display: grid;
  gap: 6px;
  justify-items: center;
  align-content: end;
  height: 100%;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.4);
}
.week__bars i {
  display: block;
  width: 100%;
  height: 0;
  border-radius: 5px 5px 3px 3px;
  background: linear-gradient(to top, rgba(99, 231, 127, 0.28), rgba(99, 231, 127, 0.72));
}
.slide.is-play .week__bars i {
  animation: grow 0.65s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
  animation-delay: 0.3s;
}
@keyframes grow {
  to {
    height: var(--h);
  }
}
.week__bars .is-leave i {
  background: linear-gradient(to top, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.22));
}
.week__bars .is-now i {
  background: linear-gradient(to top, rgba(99, 231, 127, 0.4), var(--spring));
}
.week__bars .is-now {
  color: var(--spring);
  font-weight: 700;
}

.rig__net--leave b {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.rig__net--leave b i {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(99, 231, 127, 0.66);
}

.rig__dots {
  display: flex;
  gap: 7px;
  justify-content: center;
  margin-top: 26px;
}
.rig__dot {
  width: 26px;
  height: 4px;
  border-radius: 3px;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition:
    background 0.3s,
    width 0.3s;
}
.rig__dot.is-on {
  background: var(--spring);
  width: 40px;
}

/* ── Ticker ──────────────────────────────────────────────────────────────── */
.ticker {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(0, 0, 0, 0.24);
  overflow: hidden;
  padding: 13px 0;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.ticker__strip {
  display: flex;
  gap: 0;
  width: max-content;
  animation: ticker var(--ticker-duration, 60s) linear infinite;
}
.ticker:hover .ticker__strip {
  animation-play-state: paused;
}
@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}
.ticker__item {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.42);
  padding: 0 26px;
  white-space: nowrap;
  position: relative;
}
.ticker__item::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(99, 231, 127, 0.5);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .stage__inner {
    grid-template-columns: 1fr;
    gap: 56px;
    padding-bottom: 64px;
  }
  .stage h1 {
    max-width: 16ch;
  }
  .stage__viz {
    min-height: auto;
  }
  .rig {
    transform: perspective(1400px) rotateY(-8deg) rotateX(4deg);
  }
}

@media (max-width: 620px) {
  .stage {
    padding-top: 112px;
  }
  /* No room to hide behind anything on a phone; it would just sit on the
     numbers. The CTA and 404 ones are in normal flow, so they stay. */
  .mascot {
    display: none;
  }
  .mascot--cta,
  .mascot--404 {
    display: block;
    width: 78px;
    height: 122px;
  }
  .stage__viz {
    padding-right: 0;
  }
  .rig,
  .rig__net {
    transform: none;
  }
  .slab--ghost {
    display: none;
  }
  .deck {
    min-height: 452px;
  }
  .clock {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage__rule,
  .ticker__strip,
  .rig,
  .rig__bar i,
  .stage h1 em::after,
  .org__wires path,
  .org__node,
  .week__bars i {
    animation: none !important;
  }
  .org__node {
    opacity: 1;
    transform: none;
  }
  .week__bars i {
    height: var(--h);
  }
  .stage__spot {
    transition: none;
  }
}
