/* KL Home Remodeling, Sonora look: the working prototype.
   The template drives its motion from a React build that cannot be made here, so the same
   behaviour is written by hand in proto.js, with the states it moves between in this file.
   Starting states sit under html.motion, a class the page only gets while the script is running
   and the visitor has not asked for reduced motion. Without it everything shows in its final state. */

/* ---------- Resting states the template sets from script ---------- */

.material-backplate { opacity: .5; transform: rotate(-9deg); }
.material-frontplate { transform: rotate(3deg); }

/* ---------- Word-by-word headlines, drawn rules, fade-ups ---------- */

.motion .word-clip > span { transform: translateY(110%); opacity: 0; }
.motion .motion-words.is-in .word-clip > span {
  transform: none;
  opacity: 1;
  transition: transform .6s cubic-bezier(.25, 1, .5, 1), opacity .6s cubic-bezier(.25, 1, .5, 1);
  transition-delay: calc(var(--d, 0s) + var(--i, 0) * .06s);
}

.motion .motion-rule { transform: scaleX(0); }
.motion .motion-rule.is-in { transform: none; transition: transform .8s cubic-bezier(.42, 0, .58, 1) var(--d, 0s); }

.motion [data-m="up"] { opacity: 0; transform: translateY(var(--y, 26px)); }
.motion [data-m="up"].is-in {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--t, .75s) var(--e, cubic-bezier(.22, 1, .36, 1)) var(--d, 0s),
    transform var(--t, .75s) var(--e, cubic-bezier(.22, 1, .36, 1)) var(--d, 0s);
}

.motion [data-m="pop"] { transform: scale(0); }
.motion [data-m="pop"].is-in { transform: none; transition: transform .5s cubic-bezier(.34, 1.56, .64, 1) var(--d, 0s), background .25s, color .25s; }

/* ---------- Hero ---------- */

@keyframes kl-breathe {
  0%, 100% { transform: translateX(0) scale(1.04); }
  50% { transform: translateX(-15px) scale(1.095); }
}
.motion .hero-image.is-breathing { animation: kl-breathe 20s cubic-bezier(.42, 0, .58, 1) infinite; }

@keyframes kl-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}
.motion .hero-bottom a > span { animation: kl-bob 1.8s cubic-bezier(.42, 0, .58, 1) infinite; }

/* Each letter of the name changes weight as the pointer crosses it. */
.wl { transition: font-weight .3s cubic-bezier(0, 0, .58, 1); }

/* Phone menu */
.motion .mobile-nav { opacity: 0; transform: translateY(-18px); transition: opacity .25s cubic-bezier(0, 0, .58, 1), transform .25s cubic-bezier(0, 0, .58, 1); }
.motion .mobile-nav.is-open { opacity: 1; transform: none; }

/* ---------- Experience: the collage ---------- */

.collage-track.is-live .collage-card {
  transition:
    flex-grow .8s cubic-bezier(.42, 0, .58, 1),
    height .8s cubic-bezier(.42, 0, .58, 1),
    opacity .8s cubic-bezier(.42, 0, .58, 1),
    margin-right .8s cubic-bezier(.42, 0, .58, 1),
    transform .8s cubic-bezier(.42, 0, .58, 1);
}
/* The first move waits a beat, then takes its time. */
.collage-track.is-intro .collage-card { transition-duration: 1.75s; transition-delay: .75s; }
.collage-track { transition: transform .35s cubic-bezier(.22, 1, .36, 1); -webkit-user-select: none; user-select: none; }
.collage-track.is-dragging { transition: none; cursor: grabbing; }
.collage-track.is-dragging .project-button { pointer-events: none; }

.gallery-cursor { opacity: 0; scale: 0; transition: opacity .25s cubic-bezier(0, 0, .58, 1), scale .25s cubic-bezier(0, 0, .58, 1); }
.gallery-cursor.is-on { opacity: 1; scale: 1; }

/* ---------- Place cards: how many photos a place has ---------- */

.project-count {
  position: absolute;
  z-index: 1;
  top: 14px;
  right: 14px;
  padding: 4px 7px 3px;
  background: #131C3FB8;
  color: #F4F6FC;
  font-size: 8px;
  line-height: 1.5;
  pointer-events: none;
}
.project-image-wrap > .project-count { top: 8px; right: 8px; padding: 3px 6px 2px; font-size: 7px; }

/* ---------- Place pop-ups: the photos of a place, one at a time ----------
   The whole photo always shows (upright and wide ones alike), on a stage that keeps its size,
   so the arrows and the small pictures never move while someone pages through. */

.viewer { margin: 0 0 26px; }
.viewer-stage { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #0C1330; touch-action: pan-y; }
.viewer-photo { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.viewer-nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #F4F6FC40;
  background: #131C3FCC;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  transition: background .2s;
}
.viewer-prev { left: 12px; }
.viewer-next { right: 12px; }
@media (hover: hover) {
  .viewer-nav:hover { background: var(--accent); }
}
.viewer-nav:active { background: var(--accent); }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; margin-top: 12px; }
.viewer-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.viewer-thumb { width: 56px; height: 56px; padding: 0; overflow: hidden; opacity: .5; transition: opacity .2s; }
.viewer-thumb img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
@media (hover: hover) {
  .viewer-thumb:hover { opacity: .8; }
}
.viewer-thumb[aria-current="true"] { opacity: 1; outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.viewer-caption { display: flex; flex-direction: column; gap: 4px; margin: 0; color: var(--muted); font-size: 9px; text-align: right; }
.viewer-count { color: var(--text); }

@media (max-width: 640px) {
  .viewer { margin-bottom: 22px; }
  .viewer-stage { aspect-ratio: 1; }
  .viewer-prev { left: 8px; }
  .viewer-next { right: 8px; }
  .viewer-bar { flex-direction: column; align-items: flex-start; }
  .viewer-thumb { width: 48px; height: 48px; }
  .viewer-caption { flex-direction: row; gap: 10px; font-size: 8px; text-align: left; }
}

/* ---------- Our work: a photo eases closer under the pointer ---------- */

.work-photo img { transition: transform .9s cubic-bezier(.22, 1, .36, 1); }
@media (hover: hover) {
  .work-tile:hover .work-photo img { transform: scale(1.045); }
}

/* ---------- Across Florida: the photo wall ---------- */

.motion .mosaic-grid { opacity: 0; transform: scale(1.4); }
.motion .mosaic-grid.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 1.5s cubic-bezier(0, 0, .58, 1), transform 1.5s cubic-bezier(0, 0, .58, 1);
}
.mosaic-depth { will-change: transform; }
.mosaic-cell img { transition: opacity .8s cubic-bezier(.42, 0, .58, 1); }
.mosaic-cell img.is-out, .mosaic-cell img.is-new { opacity: 0; }
/* While the number counts up the figures keep one width; the plus sign arrives with the last one. */
.mosaic-count > span:first-child.is-counting { font-variant-numeric: tabular-nums; }
.mosaic-count .plus { transition: opacity .3s; }
.mosaic-count .is-counting .plus { opacity: 0; }

/* ---------- Meet the owner ---------- */

.motion .material-backplate { opacity: 0; transform: translateY(150px) rotate(-9deg); }
.motion .material-backplate.is-in {
  opacity: .5;
  transform: rotate(-9deg);
  transition: opacity .8s cubic-bezier(0, 0, .58, 1), transform .8s cubic-bezier(0, 0, .58, 1);
}
.motion .material-frontplate { opacity: 0; transform: translateY(150px) rotate(8deg); }
.motion .material-frontplate.is-in {
  opacity: 1;
  transform: rotate(3deg);
  transition: opacity .8s cubic-bezier(0, 0, .58, 1) .2s, transform .8s cubic-bezier(0, 0, .58, 1) .2s;
}

/* ---------- Estimate request, once the form has put it together ---------- */

.request-ready { display: flex; flex-direction: column; gap: 22px; margin-top: 30px; }
.request-ready[hidden], #estimate-form[hidden] { display: none; }
.request-text {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.request-text:focus { outline: none; }
.request-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 30px; }
.request-actions .button { gap: 22px; }
.request-ready .text-link { font-size: 12px; gap: 14px; padding: 0; }
.request-edit { align-self: flex-start; color: var(--muted); }
.request-edit:hover { color: var(--text); }

/* A copy button that has just copied. */
.text-link.is-copied .copy-label { color: var(--accent-ink); }

/* Sections that take focus after a link has moved the page to them. */
[tabindex="-1"]:focus { outline: none; }

@media (max-width: 640px) {
  .request-ready { gap: 19px; }
  .request-text { font-size: 14px; }
}

/* ---------- Reduced motion: every starting state is switched off, whatever the script did ---------- */

@media (prefers-reduced-motion: reduce) {
  .motion .word-clip > span,
  .motion .motion-rule,
  .motion [data-m],
  .motion .mosaic-grid,
  .motion .mobile-nav { opacity: 1 !important; transform: none !important; transition: none !important; }
  .motion .material-backplate { opacity: .5 !important; transform: rotate(-9deg) !important; transition: none !important; }
  .motion .material-frontplate { opacity: 1 !important; transform: rotate(3deg) !important; transition: none !important; }
  .motion .hero-image, .motion .hero-bottom a > span { animation: none !important; }
  .collage-track, .collage-track .collage-card, .wl, .mosaic-cell img, .gallery-cursor, .work-photo img, .viewer-nav, .viewer-thumb { transition: none !important; }
  .work-tile:hover .work-photo img { transform: none !important; }
}

/* The line that says nothing has been sent is worth reading: a size up from the form's footnote. */
.request-ready .brief-status { font-size: 12px; line-height: 1.7; color: #BBC3DD; }
