/* The landing's "Momentum you can measure." section: the words and the
   campuses that trust KATCHUP on the left; on the right a stage of glass
   cards tilted in space, the total paid to campuses with its curve and the
   three partner counts, a red glow and a stack of coins behind them for the
   glass to catch. student_landing.js counts the figures up, leans the stage
   toward the pointer (--momentum-x / --momentum-y, each -1 to 1, set on the
   scene) and marks the section while it is in view (.is-in-view). */

.landing-momentum {
  --momentum-accent: #e8232b;
  --momentum-deep: #9e181d;      /* the accent, a third of the way to black */
  --momentum-darkest: #610f12;
  --momentum-light: #f49195;     /* the accent, half way to white */
  --momentum-ink: #141414;
  --momentum-blur: blur(22px) saturate(150%);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  min-height: 840px;
  padding: 112px clamp(20px, 5vw, 80px);
  display: flex;
  align-items: center;
  background: #f6f3f4;
  color: var(--momentum-ink);
}

.landing-momentum__grid {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 56px;
  align-items: center;
}

/* The words. */
.landing-momentum__copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
}

.landing-momentum__title {
  margin: 0;
  color: var(--momentum-ink);
  font-size: clamp(38px, 4.6vw, 68px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.94;
}

.landing-momentum__title > span {
  display: block;
  white-space: nowrap;
}

.landing-momentum__lede {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 30em;
}

.landing-momentum__lede > p {
  margin: 0;
  color: #4a4a52;
  font-size: 18px;
  line-height: 1.6;
}

.landing-momentum__trust {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 8px;
}

.landing-momentum__trust > p {
  margin: 0;
  color: #5e5e67;
  font-size: 13px;
  font-weight: 600;
}

.landing-momentum__logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 72px;
}

.landing-momentum__logo {
  display: block;
}

.landing-momentum__logo img {
  display: block;
  width: auto;
  max-width: 180px;
  height: 46px;
  object-fit: contain;
}

/* The stage. */
.landing-momentum__scene {
  --momentum-x: 0;
  --momentum-y: 0;
  position: relative;
  min-width: 0;
  padding: 24px 8px;
}

.landing-momentum__glow {
  position: absolute;
  inset: -10% -12% -8% 2%;
  background: radial-gradient(closest-side, rgb(232 35 43 / 30%), rgb(232 35 43 / 0%));
  filter: blur(28px);
  pointer-events: none;
}

.landing-momentum__stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 20px;
  transform: perspective(1600px)
    rotateX(calc(6deg - var(--momentum-y) * 5deg))
    rotateY(calc(-12deg + var(--momentum-x) * 7deg));
  transform-origin: 50% 50%;
  transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.landing-momentum__lead {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.landing-momentum__coins {
  position: absolute;
  left: -130px;
  bottom: -78px;
  width: 200px;
  max-width: none;
  height: 200px;
  transform: translate(calc(var(--momentum-x) * -14px), calc(var(--momentum-y) * -10px));
  transition: transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
  filter: drop-shadow(0 30px 26px rgb(158 24 29 / 26%));
  pointer-events: none;
}

/* Glass: a pale wash over what lies behind, blurred, with a lit upper edge. */
.landing-momentum__card {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid rgb(255 255 255 / 85%);
  background: linear-gradient(145deg, rgb(255 255 255 / 70%) 0%, rgb(255 255 255 / 38%) 55%, rgb(255 255 255 / 26%) 100%);
  -webkit-backdrop-filter: var(--momentum-blur);
  backdrop-filter: var(--momentum-blur);
}

.landing-momentum__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(calc(118deg + var(--momentum-x) * 14deg),
    rgb(255 255 255 / 62%) 0%, rgb(255 255 255 / 0%) 36%, rgb(255 255 255 / 0%) 72%, rgb(255 255 255 / 20%) 100%);
  pointer-events: none;
}

.landing-momentum__bubble {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, var(--momentum-light) 0%, var(--momentum-accent) 52%, var(--momentum-deep) 100%);
  box-shadow:
    inset 0 2px 3px rgb(255 255 255 / 55%),
    inset 0 -5px 10px rgb(97 15 18 / 35%),
    0 12px 20px -8px rgb(232 35 43 / 60%);
}

.landing-momentum__bubble svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The total paid, with its curve. */
.landing-momentum__hero {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 520px;
  padding: 32px;
  border-color: rgb(255 255 255 / 80%);
  border-radius: 32px;
  background: linear-gradient(145deg, rgb(255 255 255 / 68%) 0%, rgb(255 255 255 / 36%) 55%, rgb(255 255 255 / 24%) 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 95%),
    inset 0 -1px 0 rgb(255 255 255 / 35%),
    0 0 0 1px rgb(20 20 30 / 4%),
    0 40px 80px -36px rgb(158 24 29 / 42%),
    0 16px 32px -18px rgb(20 20 30 / 18%);
}

.landing-momentum__heading {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
}

.landing-momentum__heading .landing-momentum__bubble {
  width: 52px;
  height: 52px;
}

.landing-momentum__heading .landing-momentum__bubble svg {
  width: 24px;
  height: 24px;
}

.landing-momentum__heading > p {
  margin: 0;
  color: #2e2e34;
  font-size: 15px;
  font-weight: 600;
}

.landing-momentum__total {
  position: relative;
  margin: 0;
  color: var(--momentum-ink);
  font-size: clamp(56px, 6.2vw, 96px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.landing-momentum__spring {
  flex-grow: 1;
}

.landing-momentum__chart {
  position: relative;
  display: block;
  width: calc(100% + 64px);
  height: auto;
  margin: 0 -32px -32px;
  overflow: visible;
}

.landing-momentum__chart .is-rule { stroke: rgb(20 20 30 / 12%); stroke-width: 1; stroke-dasharray: 2 5; }
.landing-momentum__chart .is-base { stroke: rgb(20 20 30 / 18%); stroke-width: 1; }
.landing-momentum__chart .is-area { fill: url(#landing-momentum-area); stroke: none; }
.landing-momentum__chart .is-drop { stroke: var(--momentum-accent); stroke-opacity: 0.4; stroke-width: 1.5; stroke-dasharray: 3 4; }
.landing-momentum__chart .is-halo { fill: none; stroke: var(--momentum-accent); stroke-width: 10; stroke-opacity: 0.12; stroke-linecap: round; stroke-linejoin: round; }
.landing-momentum__chart .is-line { fill: none; stroke: var(--momentum-accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.landing-momentum__chart .is-start { fill: var(--momentum-accent); }
.landing-momentum__chart .is-mark { fill: #fff; stroke: var(--momentum-accent); stroke-width: 2.5; }
.landing-momentum__chart .is-end { fill: #fff; stroke: var(--momentum-accent); stroke-width: 3; }
.landing-momentum__chart .is-pulse { fill: var(--momentum-accent); fill-opacity: 0.35; opacity: 0; transform-box: fill-box; transform-origin: center; }
.landing-momentum__chart text { fill: #5e5e67; font-size: 12px; font-weight: 500; }
.landing-momentum__chart text.is-strong { fill: #2e2e34; font-weight: 700; }

/* Today's point beats, while the section is on screen (off it, a beat would
   only keep the browser repainting something nobody sees). */
@keyframes landing-momentum-pulse {
  0% { transform: scale(0.7); opacity: 0.6; }
  100% { transform: scale(2.4); opacity: 0; }
}

.landing-momentum.is-in-view .landing-momentum__chart .is-pulse {
  animation: landing-momentum-pulse 2.8s cubic-bezier(0.2, 0.7, 0.3, 1) infinite;
}

/* The three partner counts. */
.landing-momentum__tiles {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.landing-momentum__tile {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 150px;
  padding: 22px;
  border-radius: 26px;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 95%),
    inset 0 -1px 0 rgb(255 255 255 / 35%),
    0 0 0 1px rgb(20 20 30 / 4%),
    0 30px 60px -26px rgb(158 24 29 / 46%),
    0 12px 24px -12px rgb(20 20 30 / 20%);
}

.landing-momentum__tile.is-shifted {
  transform: translateX(-24px);
}

.landing-momentum__figure {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.landing-momentum__figure > p {
  margin: 0;
}

.landing-momentum__figure > p:first-child {
  color: var(--momentum-ink);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.landing-momentum__figure > p:last-child {
  color: #34343a;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

@media (min-width: 1025px) and (max-width: 1240px) {
  .landing-momentum__coins { left: -80px; }
}

@media (max-width: 1024px) {
  .landing-momentum__grid { grid-template-columns: minmax(0, 1fr); gap: 72px; }
  .landing-momentum__title { font-size: clamp(38px, 9.5vw, 68px); }
}

@media (max-width: 640px) {
  .landing-momentum { min-height: 0; padding: 72px 20px 96px; }
  .landing-momentum__stage { grid-template-columns: minmax(0, 1fr); transform: none; }
  .landing-momentum__hero { min-height: 340px; }
  .landing-momentum__tile { min-height: 112px; }
  .landing-momentum__tile.is-shifted { transform: none; }
  .landing-momentum__coins { left: -20px; bottom: -30px; width: 120px; height: 120px; }
  .landing-momentum__logos { gap: 24px 40px; }
}

/* The narrowest phones: the four campuses still share one row. */
@media (max-width: 360px) {
  .landing-momentum__logos { gap: 20px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-momentum__stage,
  .landing-momentum__coins { transition: none; }
  .landing-momentum.is-in-view .landing-momentum__chart .is-pulse { animation: none; opacity: 0; }
}
