/* ZAURIX motion layer — CSS-first, preserve mode.
   Loaded after trust.css. Decorative depth uses the supplied mark-red alpha asset;
   no logo is redrawn in CSS. */

:root {
  --motion-red-shadow: rgba(58, 10, 10, 0.48);
  --motion-white-soft: rgba(255, 255, 255, 0.2);
  --motion-ease: cubic-bezier(0.2, 0, 0, 1);
}

/* -------------------------------------------------------------------------- */
/* Accessibility and controls                                                  */
/* -------------------------------------------------------------------------- */

h1,
h2,
h3 {
  /* Thai headings must not inherit the negative tracking from the base layer. */
  letter-spacing: 0;
}

.btn,
button {
  min-height: 44px;
}

.motion-toggle[hidden] {
  display: none !important;
}

.motion-ready .motion-toggle:not([hidden]) {
  display: inline-flex;
}

.motion-toggle {
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(58, 10, 10, 0.3);
  color: var(--white);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
}

.motion-toggle:hover:not(:disabled) {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.12);
}

.motion-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.76;
}

.motion-toggle:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

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

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  align-items: center;
  gap: clamp(28px, 5vw, 82px);
  min-height: calc(100svh - var(--header-h));
  position: relative;
  z-index: 2;
}

/* Override the inherited single-column hero-content geometry deliberately. */
.hero-shell .hero-content {
  width: auto;
  max-width: none;
  margin-right: 0;
  margin-left: 0;
  padding: clamp(68px, 8vw, 104px) 0 clamp(104px, 12vw, 136px);
  min-width: 0;
}

.hero .hero-logo {
  height: clamp(40px, 4vw, 54px);
  width: auto;
}

.hero h1 {
  max-width: 18ch;
  font-size: clamp(2.45rem, 5vw, 4.6rem);
  line-height: 1.16;
}

.hero-lead {
  max-width: 38em;
}

.hero-actions {
  align-items: center;
}

/* -------------------------------------------------------------------------- */
/* Quiet 3D brand stage                                                        */
/* -------------------------------------------------------------------------- */

.brand-stage {
  align-self: center;
  display: grid;
  min-width: 0;
  min-height: 360px;
  height: clamp(360px, 42vw, 450px);
  place-items: center;
  position: relative;
  perspective: 1100px;
  perspective-origin: 50% 48%;
  isolation: isolate;
  pointer-events: auto;
}

/* Beveled planes are a quiet platform, never a CSS-drawn substitute for the
   mark image. They use only the existing white/red/deep-red visual language. */
.brand-stage::before,
.brand-stage::after {
  content: "";
  position: absolute;
  pointer-events: none;
  transform-style: preserve-3d;
}

.brand-stage::before {
  right: 4%;
  bottom: 11%;
  left: 4%;
  height: 29%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(58, 10, 10, 0.46));
  box-shadow: 10px 12px 0 rgba(18, 18, 18, 0.18);
  clip-path: polygon(8% 19%, 88% 0, 100% 64%, 22% 100%, 0 70%);
  transform: rotateX(58deg) rotateZ(-2deg);
}

.brand-stage::after {
  right: 15%;
  bottom: 21%;
  left: 17%;
  height: 17%;
  border: 1px solid rgba(237, 28, 36, 0.58);
  background: linear-gradient(135deg, rgba(237, 28, 36, 0.4), rgba(58, 10, 10, 0.7));
  clip-path: polygon(7% 22%, 92% 0, 100% 62%, 18% 100%, 0 69%);
  transform: rotateX(59deg) rotateZ(-2deg) translateZ(2px);
}

.brand-tilt {
  width: min(100%, 500px);
  height: 100%;
  position: relative;
  transform: rotateX(8deg) rotateY(-20deg);
  transform-origin: 50% 56%;
  transform-style: preserve-3d;
}

.brand-float {
  width: min(78%, 370px);
  aspect-ratio: 471 / 423;
  position: absolute;
  top: 10%;
  left: 50%;
  z-index: 3;
  transform: translate3d(-50%, 0, 24px);
  transform-style: preserve-3d;
}

.brand-float::after {
  content: "";
  position: absolute;
  right: 9%;
  bottom: -8%;
  left: 13%;
  height: 14%;
  border-radius: 50%;
  background: rgba(18, 18, 18, 0.3);
  box-shadow: 0 12px 18px rgba(58, 10, 10, 0.3);
  transform: rotateX(64deg) translateZ(-2px);
  transform-origin: center;
  pointer-events: none;
}

.emblem-solid {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.emblem-layer,
.emblem-front {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center;
  transform-style: preserve-3d;
  pointer-events: none;
}

/* The inline --layer values are the exact supplied mark-red alpha copies. */
.emblem-layer {
  transform: translateZ(calc(var(--layer, 0) * 2px));
  filter: brightness(calc(0.35 + var(--layer, 0) * 0.02));
}

.emblem-front {
  z-index: 4;
  transform: translateZ(18px);
  filter: none;
}

.brand-plinth {
  width: min(76%, 360px);
  height: 58px;
  position: absolute;
  right: 12%;
  bottom: 15%;
  left: 12%;
  z-index: 2;
  transform: skewX(-18deg) rotateX(58deg) translateZ(1px);
  transform-style: preserve-3d;
}

.brand-plinth span {
  display: block;
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  clip-path: polygon(4% 10%, 94% 0, 100% 74%, 12% 100%, 0 74%);
}

.brand-plinth span:nth-child(1) {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(237, 28, 36, 0.32));
  transform: translateZ(12px);
}

.brand-plinth span:nth-child(2) {
  background: rgba(237, 28, 36, 0.45);
  transform: translateZ(5px) translateY(6px);
}

.brand-plinth span:nth-child(3) {
  border-color: rgba(58, 10, 10, 0.65);
  background: rgba(58, 10, 10, 0.78);
  transform: translateZ(-2px) translateY(13px);
}

.brand-orbit {
  width: 84%;
  height: 35%;
  position: absolute;
  right: 8%;
  bottom: 11%;
  left: 8%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  opacity: 0.72;
  transform: rotateX(66deg) rotateZ(-4deg) translateZ(14px);
  transform-style: preserve-3d;
  pointer-events: none;
}

/* All new CSS animation is gated by the page-ready class and IO visibility. */
.motion-ready .brand-float.motion-inview {
  animation: zaurix-brand-float 7s ease-in-out infinite;
}

.motion-ready .trust-art.motion-inview {
  animation: zaurix-art-float 8s ease-in-out infinite;
}

@keyframes zaurix-brand-float {
  0%,
  100% { transform: translate3d(-50%, 0, 24px); }
  50% { transform: translate3d(-50%, -8px, 24px); }
}

@keyframes zaurix-art-float {
  0%,
  100% { transform: translate3d(0, 0, 0); opacity: 1; }
  50% { transform: translate3d(0, -5px, 0); opacity: 0.96; }
}

/* -------------------------------------------------------------------------- */
/* Trust art and remaining icon tiles                                          */
/* -------------------------------------------------------------------------- */

.trust-art {
  width: clamp(130px, 13vw, 160px);
  height: clamp(130px, 13vw, 160px);
  min-width: 130px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  position: relative;
  perspective: 700px;
  transform-style: preserve-3d;
}

.trust-art::before {
  content: "";
  position: absolute;
  inset: 9%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(58, 10, 10, 0.42));
  box-shadow: 6px 6px 0 rgba(18, 18, 18, 0.22);
  clip-path: polygon(0 12%, 84% 0, 100% 82%, 16% 100%);
  transform: translateZ(-2px) rotateX(8deg) rotateY(-12deg);
}

.trust-art-image {
  width: 100%;
  height: 100%;
  max-width: 160px;
  max-height: 160px;
  object-fit: contain;
  object-position: center;
  position: relative;
  z-index: 1;
  filter: none;
  transform: translateZ(10px);
}

/* SVG Lucide glyphs remain the source of the icon; this is only their shared
   beveled tile treatment. Small nav/footer icons are intentionally excluded. */
.icon-card {
  width: 44px;
  height: 44px;
  padding: 10px;
  margin-bottom: 18px;
  border: 1px solid currentColor;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 54%),
    linear-gradient(315deg, rgba(58, 10, 10, 0.46), transparent 56%);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.22), 5px 5px 0 var(--motion-red-shadow);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

/* The lift is an independent CSS translate, so it never overwrites an
   existing .reveal transform. Non-reveal cards may transition the new
   property; reveal cards keep their original opacity/transform transition. */
:where(.trust-card, .why-card, .service-card, .step-card, .values-grid li) {
  translate: 0 0;
}

:where(.trust-card, .why-card, .service-card, .step-card, .values-grid li):not(.reveal) {
  transition: translate 180ms var(--motion-ease);
}

:where(.trust-card, .why-card, .service-card, .step-card, .values-grid li):hover,
:where(.trust-card, .why-card, .service-card, .step-card, .values-grid li):focus-within {
  translate: 0 -4px;
}

/* -------------------------------------------------------------------------- */
/* Pause and offscreen enforcement                                             */
/* -------------------------------------------------------------------------- */

/* Without JavaScript, decorative fields and the scroll hint stay static. */
body:not(.motion-ready) .bg-anim,
body:not(.motion-ready) .bg-anim::before,
body:not(.motion-ready) .bg-anim::after,
body:not(.motion-ready) .bg-anim *,
body:not(.motion-ready) .scroll-hint .icon,
body.motion-paused .scroll-hint .icon,
body.motion-paused .bg-anim *,
body.motion-reduced .scroll-hint .icon,
body.motion-reduced .bg-anim * {
  animation-play-state: paused !important;
}

body.motion-paused .bg-anim,
body.motion-paused .bg-anim::before,
body.motion-paused .bg-anim::after,
body.motion-paused .bg-peaks,
body.motion-paused [data-motion-object],
body.motion-paused [data-motion-object] *,
body.motion-paused .hero-video,
body.motion-reduced .bg-anim,
body.motion-reduced .bg-anim::before,
body.motion-reduced .bg-anim::after,
body.motion-reduced .bg-peaks,
body.motion-reduced [data-motion-object],
body.motion-reduced [data-motion-object] * {
  animation-play-state: paused !important;
}

body.motion-reduced .hero-video {
  animation-play-state: paused !important;
}

.motion-offscreen,
.motion-offscreen::before,
.motion-offscreen::after,
.motion-offscreen .bg-peaks,
.motion-offscreen .scroll-hint .icon,
.motion-offscreen [data-motion-object] {
  animation-play-state: paused !important;
}

.hero.motion-offscreen .hero-video {
  animation-play-state: paused !important;
}

/* -------------------------------------------------------------------------- */
/* Responsive hero stage                                                      */
/* -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .hero-shell {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 0;
  }

  .hero-shell .hero-content {
    padding: clamp(56px, 8vw, 84px) 0 28px;
  }

  .brand-stage {
    width: min(100%, 580px);
    min-height: 210px;
    height: clamp(210px, 28vw, 240px);
    margin: 0 auto clamp(30px, 5vw, 52px);
  }

  .brand-float {
    width: min(52vw, 260px);
    top: 0;
  }

  .brand-plinth {
    bottom: 10%;
  }

  .brand-orbit {
    bottom: 8%;
  }
}

@media (max-width: 800px) {
  .hero-shell .hero-content {
    padding-top: 54px;
  }

  .hero h1 {
    max-width: 20ch;
  }

  .brand-stage {
    width: 100%;
    margin-bottom: 26px;
  }

  .brand-float {
    width: min(58vw, 240px);
  }
}

@media (max-width: 480px) {
  .hero-shell .hero-content {
    padding-bottom: 20px;
  }

  .brand-stage {
    height: 220px;
  }

  .brand-float {
    width: min(64vw, 220px);
  }

  .motion-toggle {
    width: auto;
  }
}

/* Reduced motion is a live accessibility mode: no float, tilt, lift, or
   transition. The JS mirrors this state on body for video/IO enforcement. */
@media (prefers-reduced-motion: reduce) {
  .brand-tilt {
    transform: none !important;
  }

  .motion-ready .brand-float.motion-inview,
  .motion-ready .trust-art.motion-inview {
    animation: none !important;
  }

  :where(.trust-card, .why-card, .service-card, .step-card, .values-grid li),
  :where(.trust-card, .why-card, .service-card, .step-card, .values-grid li):hover,
  :where(.trust-card, .why-card, .service-card, .step-card, .values-grid li):focus-within {
    translate: none;
    transition: none !important;
  }
}
