/* Motion study: thedrake.ca. Keep the Figma geometry and original arrow assets. */
:root {
  --button-ease: cubic-bezier(.16, 1, .3, 1);
  --button-duration: .4s;
  --button-duration-long: .8s;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --button-ease: linear(0, .012 .9%, .049 2%, .409 9.3%, .513 11.9%, .606 14.7%, .691 17.9%, .762 21.3%, .82 25%, .868 29.1%, .907 33.6%, .937 38.7%, .976 51.3%, .994 68.8%, 1);
  }
}

/* Rectangular navigation: dark fill opens from the top, then retracts. */
:is(.nav a, .header-phone, .brand, .text-button) {
  position: relative;
  isolation: isolate;
  z-index: 0;
  overflow: hidden;
  transition: color var(--button-duration) ease;
}
:is(.nav a, .header-phone, .brand, .text-button)::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #1b1b1c;
  transform: scale(.9, 0);
  transform-origin: 50% 10%;
  transition: transform var(--button-duration) var(--button-ease);
}
:is(.nav a, .header-phone, .brand, .text-button):focus-visible {
  background-color: white;
  color: white;
}
:is(.nav a, .header-phone, .brand, .text-button):focus-visible::before {
  transform: scale(1.1);
  transform-origin: 50% 90%;
}
@media (hover: hover) {
  :is(.nav a, .header-phone, .brand, .text-button):hover {
    background-color: white;
    color: white;
  }
  :is(.nav a, .header-phone, .brand, .text-button):hover::before {
    transform: scale(1.1);
    transform-origin: 50% 90%;
  }
}

/* Two-part CTA: the outlined label expands under the stationary arrow. */
.cta {
  --cta-height: max(35px, calc(50 * var(--u)));
  --cta-foreground: var(--ink);
  --cta-surface: white;
  --cta-text-shift: 1.4em;
  position: relative;
  isolation: isolate;
  z-index: 0;
  height: var(--cta-height);
  overflow: hidden;
}
.cta > span.cta-label {
  position: relative;
  height: var(--cta-height);
  border: 0;
  background: transparent;
  color: var(--cta-foreground);
}
.cta-label::before {
  box-sizing: border-box;
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  border: 1px solid var(--cta-foreground);
  background: var(--cta-surface);
  transition: width var(--button-duration-long) var(--button-ease);
}
.cta-text {
  display: block;
  transition: transform var(--button-duration-long) var(--button-ease);
}
.cta > .arrow {
  width: var(--cta-height);
  height: var(--cta-height);
}
.cta > .arrow::before {
  box-sizing: border-box;
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  border: 1px solid var(--cta-foreground);
  border-radius: 50%;
  background: var(--cta-surface);
  transition: transform var(--button-duration-long) var(--button-ease);
}
.cta > .arrow > img {
  /* Use the unchanged Figma arrow; its circle is drawn separately to animate. */
  clip-path: inset(30%);
}
.cta-dark {
  --cta-foreground: white;
  --cta-surface: #222;
}
.cta:focus-visible .cta-label::before {
  width: calc(100% + var(--cta-height));
}
.cta:focus-visible .cta-text {
  transform: translate3d(var(--cta-text-shift), 0, 0);
}
.cta:focus-visible > .arrow::before {
  transform: translate3d(-30%, 0, 0);
}
@media (hover: hover) {
  .cta:hover .cta-label::before {
    width: calc(100% + var(--cta-height));
  }
  .cta:hover .cta-text {
    transform: translate3d(var(--cta-text-shift), 0, 0);
  }
  .cta:hover > .arrow::before {
    transform: translate3d(-30%, 0, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  :root {
    --button-duration: 0s;
    --button-duration-long: 0s;
  }
}
