/* ==========================================================
   Buttons: .btn + one of --full, --outline, --link
   Optional: --light (for dark backgrounds)
   Markup: a.btn > span.btn__label + span.btn__icon > 2x chevron icon
   ========================================================== */

.btn {
   --btn-ease: cubic-bezier(.19, 1, .22, 1);
   --btn-duration: 1s;
   --btn-stagger: 30ms;
   display: inline-flex;
   align-items: center;
   gap: 10px;
   height: 44px;
   padding: 6px 16px;
   border: 1px solid transparent;
   border-radius: 100px;
   box-sizing: border-box;
   font-size: 16px;
   font-weight: 300;
   line-height: 1;
   color: var(--grey-90);
   text-decoration: none;
   white-space: nowrap;
   cursor: pointer;
   transition: background-color .3s, border-color .3s, color .3s;
}

.btn:not(.btn--no-icon):not(.btn--link):has(.btn__icon) {
   padding-right: 6px;
}

.btn--no-icon .btn__icon {
   display: none;
}

/* ---- Full: lime fill ---- */
.btn--full {
   background-color: var(--lime-40);
}

.btn--full .btn__icon {
   background-color: #fff;
   color: var(--grey-90);
}

/* ---- Outline: thin border ---- */
.btn--outline {
   background-color: transparent;
   border-color: var(--grey-50);
}

.btn--outline .btn__icon {
   background-color: var(--grey-70);
   color: #fff;
   transition: background-color .4s, color .4s;
}

.btn--outline:not(.btn--light):hover,
.btn--outline:not(.btn--light):focus-visible {
   background-color: var(--lime-40);
   border-color: transparent;
}

.btn--outline:not(.btn--light):hover .btn__icon,
.btn--outline:not(.btn--light):focus-visible .btn__icon {
   background-color: #fff;
   color: var(--grey-90);
}

/* ---- Link: text only (header nav) ---- */
.btn--link {
   height: auto;
   padding: 0;
   border: 0;
   border-radius: 0;
   font-size: 18px;
   background: none;
}

/* ---- Light: for dark backgrounds ---- */
.btn--light {
   color: var(--grey-10);
}

.btn--outline.btn--light {
   border-color: var(--grey-20);
}

.btn--outline.btn--light:hover {
   border-color: var(--grey-5);
}

.btn--outline.btn--light .btn__icon {
   background-color: var(--grey-10);
   color: var(--grey-90);
}

/* ---- Label: letters roll up on hover, roll back down in reverse ---- */
.btn__label {
   position: relative;
   display: inline-flex;
   overflow: hidden;
   height: 1.2em;
   line-height: 1.2;
   top: .08em;
}

.btn__label-chars {
   display: inline-flex;
}

.btn__char {
   display: inline-block;
   white-space: pre;
   text-shadow: 0 1.2em currentColor;
   transition: transform var(--btn-duration) var(--btn-ease);
   /* leaving: last letter moves first, so the hover plays backwards */
   transition-delay: calc((var(--n) - 1 - var(--i)) * var(--btn-stagger));
}

.btn:hover .btn__char,
.btn:focus-visible .btn__char {
   transform: translateY(-1.2em);
   /* entering: first letter moves first */
   transition-delay: calc(var(--i) * var(--btn-stagger));
}

/* Screen readers read the whole word, not the letters */
.btn__sr {
   position: absolute;
   width: 1px;
   height: 1px;
   margin: -1px;
   overflow: hidden;
   clip: rect(0 0 0 0);
   white-space: nowrap;
}

/* ---- Icon: round badge with two arrows (same as Nextbricks)
   Put the chevron icon in .btn__icon TWICE.
   Hover: the first arrow slides out right, the second slides in from the left.
   Leaving plays it backwards. ---- */
.btn__icon {
   position: relative;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   flex: 0 0 32px;
   width: 32px;
   height: 32px;
   border-radius: 50%;
   overflow: hidden;
}

.btn__icon>* {
   position: absolute;
   width: 16px;
   height: 16px;
   min-width: 16px;
   min-height: 16px;
   font-size: 16px;
   fill: currentColor;
   transition: transform .5s cubic-bezier(.1, 0, .3, 1);
}

.btn__icon> :last-child {
   transform: translateX(-300%);
}

.btn:hover .btn__icon> :first-child,
.btn:focus-visible .btn__icon> :first-child {
   transform: translateX(300%);
}

.btn:hover .btn__icon> :last-child,
.btn:focus-visible .btn__icon> :last-child {
   transform: translateX(0);
}

.btn:focus-visible {
   outline: 2px solid var(--lime-40);
   outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {

   .btn__char,
   .btn__icon>* {
      transition: none;
   }
}