/* Infirise preview: shared helpers (scrolling, accessibility, reveal, highlights, preview bar, toast). */

html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 96px; }
*, *::before, *::after { box-sizing: border-box; }
img, svg { max-width: 100%; }

.skip-link {
  position: absolute; left: 16px; top: -64px; z-index: 100;
  padding: 10px 16px; border-radius: 8px; background: #1E2352; color: #ffffff;
  font: 600 15px/1.2 Inter, system-ui, sans-serif; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Scroll reveal (motion.js adds .reveal-pending only to blocks below the fold) */
.reveal-pending {
  opacity: 0; transform: translateY(32px);
  transition: opacity 0.8s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal-pending.is-revealed { opacity: 1; transform: none; }
.reveal-pending [data-stagger] > * {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal-pending.is-revealed [data-stagger] > * { opacity: 1; transform: none; }

/* Details for Infirise to confirm */
mark.tbc {
  padding: 0 0.3em; border: 1px dashed #D97706; border-radius: 6px;
  background: #FEF3C7; color: #78350F; font: inherit;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.tbc-svg { fill: #FDE68A; }
.tbc-off mark.tbc { padding: 0; border-color: transparent; background: none; color: inherit; }
.tbc-off .tbc-svg { fill: inherit; }

/* Preview bar */
.pv-bar {
  position: fixed; left: 50%; bottom: 16px; z-index: 60; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 24px);
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px;
  border-radius: 999px; background: rgba(15, 23, 42, 0.92); color: #E2E8F0;
  font: 500 13px/1.3 Inter, system-ui, sans-serif;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28); backdrop-filter: blur(8px);
}
.pv-text { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pv-text b { color: #ffffff; font-weight: 600; white-space: nowrap; }
.pv-key { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-swatch {
  padding: 1px 6px; border: 1px dashed #D97706; border-radius: 5px; background: #FEF3C7; color: #78350F;
}
.pv-btn {
  flex: none; min-height: 34px; padding: 0 12px; border: 1px solid rgba(226, 232, 240, 0.3); border-radius: 999px;
  background: transparent; color: #ffffff; font: 600 13px/1 Inter, system-ui, sans-serif;
  display: inline-flex; align-items: center; text-decoration: none; cursor: pointer;
}
.pv-btn:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; }
.pv-close {
  flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: transparent; color: #CBD5E1; font: 400 22px/1 Inter, system-ui, sans-serif; cursor: pointer;
}
.pv-close:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; }
.pv-bar :focus-visible { outline: 2px solid #FDE68A; outline-offset: 2px; }

@media (max-width: 720px) {
  .pv-key { display: none; }
  .pv-bar { bottom: 12px; padding-left: 14px; }
}
@media (max-width: 359px) {
  .pv-text { display: none; }
  .pv-bar { padding-left: 8px; }
}

/* Toast for pages that come with the full build */
.pv-toast {
  position: fixed; left: 50%; bottom: 76px; z-index: 70;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px;
  background: #0F172A; color: #ffffff; font: 500 14px/1.4 Inter, system-ui, sans-serif;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.3);
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.pv-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* API forms (forms.js): honeypot kept off-screen, field errors, status message */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
form[data-api-form] > [hidden] { display: none !important; }
.fld-error { font: 500 13px/1.45 Inter, system-ui, sans-serif; color: #B42318; }
.form-consent + .fld-error, .consent + .fld-error { margin-top: -6px; }
.fld input[aria-invalid="true"], .fld select[aria-invalid="true"], .fld textarea[aria-invalid="true"] { border-color: #B42318; }
.form-status { font: 500 14px/1.5 Inter, system-ui, sans-serif; }
.form-status:empty { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }
.form-status:focus { outline: none; }
.form-status.is-error { color: #B42318; }
.form-status.is-success { padding: 14px 16px; border-radius: 12px; background: #ECFDF3; color: #05603A; font-weight: 600; }

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