/* Heart Latch: brand tokens and shared pieces (buttons, play and pause, the photo reel, the app tour in its phone frame).
   Loaded by the home page and the footer pages. */

:root {
  --hl-cream: #F7F5EF;
  --hl-ink: #111827;
  --hl-deep: #0B1220;
  --hl-coral: #14213D;
  --hl-coral-dark: #0B1630;
  --hl-berry: #9A6B12;
  --hl-plum: #14213D;
  --hl-blush: #F3E9D2;
  --hl-line: #E3DED2;
  --hl-muted: #5B6472;
  --hl-wrap: 1180px;
  --hl-ease: cubic-bezier(.2, .8, .2, 1);
}

/* Buttons */

.hl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: var(--hl-coral);
  color: #FFFFFF;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s;
}

.hl-btn:hover {
  background: var(--hl-coral-dark);
  color: #FFFFFF;
  text-decoration: none;
}

.hl-btn--small {
  height: 42px;
  padding: 0 18px;
  font-size: 15px;
}

.hl-btn--ghost {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(247, 245, 239, .7);
  color: var(--hl-cream);
}

.hl-btn--ghost:hover {
  background: rgba(247, 245, 239, .12);
  color: var(--hl-cream);
}

.hl-btn--ghost svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Play and pause, for every film */

.hl-playtoggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(247, 245, 239, .16);
  color: var(--hl-cream);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background-color .15s;
}

.hl-playtoggle:hover {
  background: rgba(247, 245, 239, .28);
}

.hl-playtoggle__icon {
  position: relative;
  width: 12px;
  height: 12px;
}

.hl-playtoggle__icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0;
  border-left: 11px solid currentColor;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.hl-playtoggle.is-playing .hl-playtoggle__icon::before {
  left: 1px;
  width: 3px;
  height: 12px;
  border: 0;
  background: currentColor;
  box-shadow: 6px 0 0 currentColor;
}

.hl-playtoggle--film {
  width: auto;
  height: 44px;
  padding: 0 20px 0 18px;
  background: var(--hl-ink);
  color: var(--hl-cream);
}

.hl-playtoggle--film:hover {
  background: var(--hl-plum);
}

/* The app tour: a live page (media/tour/index.html) inside a phone frame, scaled to fit by js/hl-experience.js */

.hl-tour {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.hl-phone {
  position: relative;
  width: min(78vw, 330px);
  padding: 10px;
  border-radius: 56px;
  background: #1C0717;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .1),
    0 70px 90px -50px rgba(17, 24, 39, .6),
    0 30px 40px -30px rgba(17, 24, 39, .45);
}

.hl-phone__screen {
  position: relative;
  overflow: hidden;
  aspect-ratio: 390 / 844;
  border-radius: 46px;
  background: var(--hl-cream);
  isolation: isolate;
}

.hl-phone__app {
  position: absolute;
  left: 0;
  top: 0;
  width: 390px;
  height: 844px;
  border: 0;
  pointer-events: none;
  transform: scale(var(--hl-k, .795));
  transform-origin: 0 0;
}

.hl-phone__island {
  position: absolute;
  left: 50%;
  top: 20px;
  width: 30%;
  height: 26px;
  border-radius: 999px;
  background: #1C0717;
  transform: translateX(-50%);
}

/* The photo reel: four photos cross-fade with a slow camera move and film grain (16-second loop) */

.hl-reel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--hl-deep);
}

.hl-reel__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 50%);
  opacity: 0;
  filter: saturate(1.08) contrast(1.05);
  transform: translateX(var(--x0)) scale(var(--s0));
}

.hl-reel__slide:first-child {
  opacity: 1;
}

.hl-reel__slide--rooftop   { --i: 0; --pos: 45% 40%; --pos-m: 44% 50%; --s0: 1.05; --s1: 1.13; --x0: 0%;    --x1: -2%;   }
.hl-reel__slide--table     { --i: 1; --pos: 50% 50%; --pos-m: 80% 50%; --s0: 1.13; --s1: 1.05; --x0: 2%;    --x1: -2%;   }
.hl-reel__slide--hug       { --i: 2; --pos: 35% 45%; --pos-m: 37% 40%; --s0: 1.04; --s1: 1.13; --x0: 0%;    --x1: 1.5%;  }
.hl-reel__slide--piggyback { --i: 3; --pos: 55% 45%; --pos-m: 55% 40%; --s0: 1.12; --s1: 1.04; --x0: -1.5%; --x1: 0%;    }

.hl-reel__grain {
  position: absolute;
  inset: -50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E") repeat;
  opacity: .1;
  mix-blend-mode: overlay;
  pointer-events: none;
}

@media (max-aspect-ratio: 4/5) {

  .hl-reel__slide {
    object-position: var(--pos-m, var(--pos));
  }
}

@media (prefers-reduced-motion: no-preference) {

  .hl-reel__slide {
    animation: hl-reel-fade 16s linear infinite, hl-reel-move 16s linear infinite;
    animation-delay: calc(var(--i) * 4s - 1s);
  }

  .hl-reel__grain {
    animation: hl-grain .8s steps(5) infinite;
  }

  .hl-reel.is-paused *,
  .hl-reel.is-offscreen * {
    animation-play-state: paused;
  }
}

@keyframes hl-reel-fade {
  0%     { opacity: 0; }
  6.25%  { opacity: 1; }
  25%    { opacity: 1; }
  31.25% { opacity: 0; }
  100%   { opacity: 0; }
}

@keyframes hl-reel-move {
  0%     { transform: translateX(var(--x0)) scale(var(--s0)); }
  31.25% { transform: translateX(var(--x1)) scale(var(--s1)); }
  100%   { transform: translateX(var(--x1)) scale(var(--s1)); }
}

@keyframes hl-grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-2%, -2%); }
  80%  { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

/* Sections rise into place as they scroll into view (js/hl-experience.js adds .is-in) */

@media (prefers-reduced-motion: no-preference) {

  .hl-js .hl-reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .8s var(--hl-ease), transform .8s var(--hl-ease);
  }

  .hl-js .hl-reveal.is-in {
    opacity: 1;
    transform: none;
  }

  .hl-js .hl-reveal--2 { transition-delay: .08s; }
  .hl-js .hl-reveal--3 { transition-delay: .16s; }
}
