/* Site-specific additions layered on top of the compiled Tailwind bundle.
   Covers the behaviour that framer-motion and Radix provided in the original
   React build: scroll reveals, the mobile menu panel, the select control and
   the toast used by the contact form. */

/* ---- Scroll reveal (was framer-motion whileInView) ---------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.js .reveal.is-visible {
  opacity: 1;
  /* Drop the transform entirely once revealed: leaving one in place keeps the
     element on its own compositing layer, which downgrades text from subpixel
     to grayscale anti-aliasing and makes copy render softer than the original. */
  transform: none;
}
/* Without JS, or when the visitor prefers reduced motion, content is simply
   visible rather than stuck at opacity 0. */
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---- Mobile navigation panel (was a Radix sheet) ----------------------- */
[data-mobile-nav] { display: none; }
[data-mobile-nav].is-open { display: block; }
[data-mobile-nav] > nav {
  animation: sheet-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-mobile-nav] > div {
  animation: fade-in 0.3s ease;
}
@keyframes sheet-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }
body.menu-open { overflow: hidden; }

/* ---- Service select (was a Radix select) ------------------------------- */
select.site-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.25rem;
  /* A native select centres its text 1px lower than the Radix button it
     replaces; shift the text block up to keep the baseline identical. */
  padding-top: 7px;
  padding-bottom: 9px;
}
select.site-select:invalid { color: hsl(var(--muted-foreground)); }

/* ---- Field errors ------------------------------------------------------ */
.field-error {
  color: hsl(var(--destructive));
  font-size: 0.875rem;
  line-height: 1.25rem;
  margin-top: 0.375rem;
}
.has-error { border-color: hsl(var(--destructive)) !important; }

/* ---- Toast (was sonner) ------------------------------------------------ */
.site-toaster {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.site-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  min-width: 18rem;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.12);
  font-size: 0.875rem;
  line-height: 1.35;
  pointer-events: auto;
  animation: toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-toast.is-leaving { animation: toast-out 0.2s ease forwards; }
.site-toast.is-error { border-color: hsl(var(--destructive)); }
.site-toast svg { flex: none; width: 1.05rem; height: 1.05rem; margin-top: 0.05rem; }
.site-toast.is-success svg { color: #16a34a; }
.site-toast.is-error svg { color: hsl(var(--destructive)); }
@keyframes toast-in  { from { opacity: 0; transform: translateY(0.75rem); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(0.5rem); } }

/* ---- Honeypot ---------------------------------------------------------
   Removed from the layout and from the accessibility tree, but still a real
   focusable input that automated form-fillers will populate. Not display:none
   — some bots skip those. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
