/* The fund's hero with the clouds that move aside from the cursor: the first screen of Cumbre Credit, a private credit
   fund. The canvas behind draws the photographed mountains and the clouds; over it the grain, the bar, the stepped title, the
   line on the right and the frosted glass card with the elastic pill. The title steps to the right by --step per line. */
:root {
  --page: #ffffff;          /* the page */
  --mist: #f2f2f2;          /* the light grey of the sky */
  --rule: #d5d5d5;          /* the grey of the hairlines */
  --ink: #2b2b2b;           /* the words */
  --muted: #7c7c7c;         /* the small words */
  --accent: #e41613;        /* the only red: the mark and the button */
  --glass: rgba(255, 255, 255, 0.56); /* the body of the card */
  --step: 5vw;              /* how far each line of the title steps to the right */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.9, 0.45, 1);
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ the hero */
.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
  /* the sky: light grey at the top, almost white at the horizon, a soft light behind the summit */
  background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 55vmax),
    linear-gradient(180deg, #ebebeb, #f4f4f4 45%, #fbfbfb);
  isolation: isolate;
}

.hero__sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.hero__grain {
  position: absolute;
  inset: -40px;
  z-index: 5;
  pointer-events: none;
  opacity: var(--grain, 0.4);
  mix-blend-mode: overlay;
  background-size: 180px 180px;
}

/* ------------------------------------------------------------------ the bar */
.bar {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  height: clamp(48px, 9vh, 76px);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 clamp(16px, 3.4vw, 52px);
  border-bottom: 1px solid rgba(43, 43, 43, 0.1);
  opacity: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand__mark {
  width: 32px;
  height: 19px;
  overflow: visible;
}

.brand__peak {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.brand__snow {
  fill: var(--accent);
}

.brand__words {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand__words b {
  font-weight: 560;
  font-size: 17px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-stretch: 112%;
}

.brand__words small {
  margin-top: 3px;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--muted);
}

.bar__nav {
  display: flex;
  gap: clamp(18px, 2.4vw, 40px);
  margin: 0 auto;
}

.bar__nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 450;
  letter-spacing: -0.01em;
  transition: color 0.3s ease, font-stretch 0.5s var(--ease-spring);
}

.bar__portal {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 6px 16px -8px rgba(0, 0, 0, 0.5);
  transition: transform 0.5s var(--ease-spring);
}

@media (hover: hover) and (pointer: fine) {
  .bar__nav a:hover {
    color: var(--muted);
    font-stretch: 118%;
  }
  .bar__portal:hover {
    transform: translateY(-1px);
  }
}

/* ------------------------------------------------------------------ the stepped title */
.title {
  position: absolute;
  z-index: 2;
  left: clamp(16px, 6vw, 110px);
  top: 21vh;
  margin: 0;
  font-size: min(11.4vw, 18.5vh);
  font-weight: 520;
  font-stretch: 100%;
  line-height: 0.86;
  letter-spacing: -0.045em;
  color: var(--ink);
  pointer-events: none;
}

.title__line {
  display: block;
  white-space: nowrap;
  /* GSAP moves --k from 0 to the line's index: the line steps right by --k times --step */
  transform: translateX(calc(var(--k, 0) * var(--step)));
}

.title__mask {
  display: block;
  overflow: clip;
  padding: 0 0.06em 0.12em 0;
  margin-bottom: -0.12em;
}

.title__words {
  display: block;
}

/* ------------------------------------------------------------------ the right column */
.side {
  position: absolute;
  z-index: 3;
  right: clamp(16px, 5.5vw, 100px);
  bottom: clamp(14px, 5.5vh, 64px);
  width: min(330px, 30vw);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 3vh, 30px);
}

.side__line {
  margin: 0;
  font-size: clamp(16px, 1.55vw, 23px);
  font-weight: 430;
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-wrap: pretty;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.95), 0 0 28px rgba(255, 255, 255, 0.7);
}

.side__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 540;
  text-decoration: none;
}

.side__link svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.6s var(--ease-spring);
}

@media (hover: hover) and (pointer: fine) {
  .side__link:hover svg {
    transform: translateX(4px);
  }
}

/* ------------------------------------------------------------------ the frosted glass card */
.drop {
  position: relative;
}

.drop__shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -14px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(40, 40, 40, 0.26), rgba(40, 40, 40, 0));
  filter: blur(6px);
  opacity: 0;
}

.card {
  position: relative;
  overflow: hidden;
  padding: clamp(14px, 2.2vh, 22px);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.72), var(--glass) 46%, rgba(246, 246, 246, 0.5));
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 -1px 0 rgba(0, 0, 0, 0.04) inset,
    0 1px 2px rgba(30, 30, 30, 0.06),
    0 10px 24px -10px rgba(30, 30, 30, 0.2),
    0 34px 70px -28px rgba(30, 30, 30, 0.28);
  opacity: 0;
}

/* a soft light that follows the pointer on the glass */
.card__sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(260px 160px at var(--gx, 30%) var(--gy, 0%), rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0) 70%);
  mix-blend-mode: soft-light;
  opacity: 0.9;
}

.card__head {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 520;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.card__term {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(43, 43, 43, 0.1);
  background: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 11px;
}

.card__title {
  position: relative;
  margin: clamp(8px, 1.6vh, 14px) 0 clamp(10px, 1.8vh, 16px);
  font-size: clamp(19px, 1.7vw, 25px);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1;
}

.ticket {
  position: relative;
}

.ticket__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
}

.ticket__label {
  color: var(--muted);
}

.ticket__range {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.ticket__ruler {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 18px;
  margin-top: 9px;
}

.tick {
  width: 1px;
  height: 7px;
  background: rgba(43, 43, 43, 0.18);
  transform-origin: 50% 100%;
}

.tick--major {
  height: 11px;
}

.tick.is-in {
  background: var(--ink);
}

.ticket__ends {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 10px;
  color: #a2a2a2;
}

.facts {
  margin: clamp(8px, 1.6vh, 14px) 0 clamp(12px, 2vh, 18px);
  border-top: 1px solid rgba(43, 43, 43, 0.09);
}

.facts__row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid rgba(43, 43, 43, 0.09);
  font-size: 13px;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  font-weight: 540;
}

/* ------------------------------------------------------------------ the elastic pill */
.pill {
  position: relative;
  width: 100%;
  height: clamp(40px, 6.4vh, 50px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.pill__body {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 999px;
  background: linear-gradient(180deg, #ee2b28, var(--accent) 60%, #cf1411);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.32) inset,
    0 -1px 0 rgba(0, 0, 0, 0.12) inset,
    0 8px 18px -8px rgba(228, 22, 19, 0.65),
    0 2px 4px rgba(120, 10, 8, 0.18);
  transition: inset 0.6s var(--ease-spring), transform 0.18s var(--ease-out);
}

.pill__words {
  position: relative;
  display: grid;
  overflow: clip;
  height: 1.3em;
  font-stretch: 100%;
  transition: font-stretch 0.6s var(--ease-spring);
}

.pill__say {
  grid-area: 1 / 1;
  line-height: 1.3em;
  white-space: nowrap;
  text-align: center;
}

.pill__say--b {
  visibility: hidden;
}

.pill__icon {
  display: grid;
  place-items: center;
  transition: transform 0.6s var(--ease-spring);
}

.pill__icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.pill__check {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.pill.is-hot .pill__body {
  inset: -2px -7px;
}

.pill.is-hot .pill__words {
  font-stretch: 122%;
}

.pill.is-hot .pill__icon {
  transform: translateX(3px);
}

.pill.is-down .pill__body {
  transform: scale(1.02, 0.88);
}

@media (hover: hover) and (pointer: fine) {
  .pill:hover .pill__body {
    inset: -2px -7px;
  }
  .pill:hover .pill__words {
    font-stretch: 122%;
  }
  .pill:hover .pill__icon {
    transform: translateX(3px);
  }
}

.pill:active .pill__body {
  transform: scale(1.02, 0.88);
}

.pill:focus-visible {
  outline: none;
}

.pill:focus-visible .pill__body {
  box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px var(--accent);
}

/* ------------------------------------------------------------------ the drawn cursor */
.ghost {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}

.ghost svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: #1d1d1d;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  transform-origin: 20% 10%;
  transition: transform 0.2s var(--ease-out);
}

.ghost.is-down svg {
  transform: scale(0.84);
}

/* ------------------------------------------------------------------ narrower screens: the card goes under the title */
@media (max-width: 900px) {
  .bar__nav {
    display: none;
  }
  .bar {
    justify-content: space-between;
  }
}

@media (max-width: 760px) {
  :root {
    --step: 9vw;
  }
  .title {
    top: calc(clamp(48px, 9vh, 76px) + 5vh);
    font-size: min(13vw, 12.5vh);
  }
  .side {
    width: min(300px, 64vw);
    right: clamp(12px, 4vw, 40px);
    bottom: clamp(10px, 3.4vh, 40px);
  }
  .side__words {
    display: none;
  }
  .bar__portal {
    height: 32px;
    padding: 0 14px;
    font-size: 12.5px;
  }
}

/* low boxes, like the preview on a phone: a smaller card */
@media (max-height: 560px) {
  .card {
    padding: 12px 14px 13px;
    border-radius: 16px;
  }
  .card__head {
    font-size: 10px;
  }
  .card__term {
    display: none;
  }
  .card__title {
    margin: 6px 0 8px;
    font-size: 17px;
  }
  .ticket__row,
  .facts__row {
    font-size: 12px;
  }
  .ticket__range {
    font-size: 13px;
  }
  .ticket__ruler {
    height: 14px;
    margin-top: 6px;
  }
  .ticket__ends {
    display: none;
  }
  .facts {
    margin: 8px 0 10px;
  }
  .facts__row {
    padding: 5px 0;
  }
  .facts__row--more {
    display: none;
  }
  .pill {
    height: 38px;
    font-size: 13.5px;
  }
  .brand__words b {
    font-size: 14px;
  }
  .brand__mark {
    width: 26px;
  }
}

/* a tall phone has room for the line too, over the card */
@media (max-width: 760px) and (min-height: 700px) {
  .side__words {
    display: block;
  }
  .side__line {
    font-size: 16px;
  }
}

@media (max-width: 420px) {
  .bar__portal {
    display: none;
  }
}
