:root {
  --kai-ease-out: cubic-bezier(.2, .72, .25, 1);
  --kai-ease-press: cubic-bezier(.3, .7, .4, 1);
  --kai-focus: #b77a63;
}

html {
  -webkit-tap-highlight-color: rgba(183, 122, 99, .18);
}

button,
.kai-action,
input,
select,
textarea {
  transition-duration: .22s !important;
  transition-timing-function: var(--kai-ease-out) !important;
}

button,
.kai-action {
  transition-property: transform, background-color, border-color, color, box-shadow, opacity !important;
  transform-origin: center;
}

button:active,
.kai-action:active {
  transform: translateY(1px) scale(.985) !important;
  transition-duration: .08s !important;
  transition-timing-function: var(--kai-ease-press) !important;
}

input,
select,
textarea {
  transition-property: border-color, background-color, box-shadow, color !important;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #a7bdb5 !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #7c9c91 !important;
  background-color: #fff !important;
  box-shadow: 0 0 0 4px rgba(124, 156, 145, .14) !important;
}

input:user-invalid,
select:user-invalid,
textarea:user-invalid {
  border-color: #b77a63 !important;
  box-shadow: 0 0 0 4px rgba(183, 122, 99, .12) !important;
}

input:user-valid:not([type="checkbox"]),
select:user-valid,
textarea:user-valid {
  border-color: #7c9c91 !important;
}

input[type="checkbox"]:checked {
  animation: kai-check-pop .28s var(--kai-ease-out) both;
}

.kai-checkmark {
  position: relative !important;
  display: inline-grid !important;
  place-items: center !important;
  /* Hide the text glyph without touching `color`, so the drawn check below
     inherits the span's own color (white in filled boxes, sage in lists). */
  font-size: 0 !important;
}

.kai-checkmark::after {
  content: "";
  width: 7px;
  height: 13px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) scale(0);
  transform-origin: 55% 72%;
  animation: kai-check-draw .32s var(--kai-ease-out) forwards;
}

.kai-card {
  transition: transform .26s var(--kai-ease-out), box-shadow .26s var(--kai-ease-out), border-color .26s ease !important;
  will-change: transform;
}

.kai-phone {
  text-decoration-color: rgba(183, 122, 99, .65);
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

[data-kai-header] {
  position: sticky !important;
  top: 0;
  z-index: 100 !important;
  transition: background-color .32s ease, box-shadow .32s ease, border-color .32s ease !important;
}

[data-kai-header].kai-hero-header:not(.is-scrolled) {
  background-color: rgba(7, 20, 28, 0) !important;
}

[data-kai-header].is-scrolled {
  background-color: rgba(7, 20, 28, .82) !important;
  border-bottom: 1px solid rgba(233, 221, 200, .14);
  box-shadow: 0 12px 34px rgba(5, 15, 21, .16);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  backdrop-filter: blur(14px) saturate(115%);
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s ease, transform .75s var(--kai-ease-out) !important;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.kai-note-wrap {
  isolation: isolate;
}

.kai-note-shadow {
  transform: rotate(1.1deg);
  border: 1px solid rgba(183, 122, 99, .1);
}

.kai-note-card {
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 254, 250, .93), rgba(255, 254, 250, .93)),
    url('texture-tidal-ivory.webp') center / 620px auto !important;
  border: 1px solid rgba(189, 172, 146, .48);
  box-shadow: 0 34px 90px rgba(30, 40, 43, .16), 0 3px 0 rgba(255, 255, 255, .8) inset !important;
  transition: opacity .62s ease, transform .7s var(--kai-ease-out), box-shadow .26s ease !important;
}

.kai-note-card::before {
  content: "";
  position: absolute;
  z-index: 0;
  width: min(56%, 360px);
  aspect-ratio: 3.5 / 1;
  right: -4%;
  top: 22%;
  background: url('logos/kai-logo-horizontal-blue.png') center / contain no-repeat;
  filter: grayscale(1) contrast(.65);
  opacity: .035;
  transform: rotate(-8deg);
  pointer-events: none;
}

.kai-note-card::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(112deg, rgba(255,255,255,.22), transparent 42%, rgba(183,122,99,.035));
  pointer-events: none;
}

.kai-note-card > * {
  position: relative;
  z-index: 1;
}

.kai-note-rule {
  background: repeating-linear-gradient(transparent 0 43px, rgba(209, 194, 170, .48) 43px 44px) !important;
}

.kai-note-word {
  display: inline-block;
  margin-right: .14em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  will-change: clip-path, opacity;
  transition: clip-path .18s linear, opacity .16s linear !important;
}

.kai-note-word--highlight {
  margin-right: 0;
  padding-right: .14em;
  background: linear-gradient(
    177deg,
    transparent 0 61%,
    rgba(183, 122, 99, .20) 61% 86%,
    transparent 86% 100%
  );
}

.kai-note-word--highlight:nth-child(3n) {
  background-image: linear-gradient(
    179deg,
    transparent 0 59%,
    rgba(183, 122, 99, .17) 59% 85%,
    transparent 85% 100%
  );
}

.kai-highlight-swatch {
  flex: none;
  width: 38px;
  height: 11px;
  background: linear-gradient(
    178deg,
    transparent 0 25%,
    rgba(183, 122, 99, .24) 25% 78%,
    transparent 78% 100%
  );
  transform: translateY(1px) rotate(-1.5deg);
}

.kai-note-signature {
  transform-origin: left center;
  transition: opacity .55s ease, clip-path .8s var(--kai-ease-out), transform .55s var(--kai-ease-out) !important;
}

@keyframes kai-check-draw {
  0% { opacity: 0; transform: rotate(45deg) scale(0); }
  55% { opacity: 1; }
  100% { opacity: 1; transform: rotate(45deg) scale(1); }
}

@keyframes kai-check-pop {
  0% { transform: scale(.75); }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):hover,
  .kai-action:hover {
    transform: translateY(-2px);
  }

  .kai-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 54px rgba(30, 40, 43, .13) !important;
  }

  .kai-phone:hover {
    text-decoration: underline;
    text-decoration-color: #b77a63;
  }
}

@media (max-width: 1000px) {
  .kai-phone {
    text-decoration: underline;
    text-decoration-color: #b77a63;
  }

  .kai-note-card {
    box-shadow: 0 24px 58px rgba(30, 40, 43, .14) !important;
  }
}

@media (max-width: 640px) {
  .kai-note-card::before {
    width: 72%;
    top: 27%;
  }

  .kai-note-rule {
    font-size: 25px !important;
    line-height: 38px !important;
    background: repeating-linear-gradient(transparent 0 37px, rgba(209, 194, 170, .48) 37px 38px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}
