/* Hallmark · pre-emit critique: P4 H4 E5 S5 R5 V5 · macrostructure: sistema industrial existente preservado · genre: modern-minimal · tone: premium technical · anchor hue: electric blue · explicit override: direct custom gear cursor · contrast: pass (46–50) · honest: pass (56) · chrome: pass (57) · responsive: pass (59, 61–69) */

:root {
  --depth-accent: var(--color-blue, var(--blue));
  --depth-surface: var(--color-gunmetal, var(--gunmetal));
  --depth-perspective: 950px;
  --depth-radius: var(--radius-md, 4px);
  --depth-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --depth-ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --depth-duration: 240ms;
  --depth-duration-active: 90ms;
  --depth-line: color-mix(in srgb, var(--depth-accent) 26%, transparent);
  --depth-shadow: 0 22px 44px color-mix(in srgb, var(--depth-surface) 72%, transparent);
  --depth-shadow-rest: 0 8px 22px color-mix(in srgb, var(--depth-surface) 58%, transparent);
  --depth-z-cursor: 10010;
  --gear-size: 34px;
}

html,
body {
  overflow-x: clip !important;
}

body {
  cursor: auto !important;
}

#cursor,
#cursor-ring {
  display: none !important;
}

#gear-cursor {
  --gear-angle: 0deg;
  --gear-scale: 1;
  --gear-x: -48px;
  --gear-y: -48px;
  position: fixed;
  inset: 0 auto auto 0;
  z-index: var(--depth-z-cursor);
  width: var(--gear-size);
  height: var(--gear-size);
  color: var(--depth-accent);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(var(--gear-x), var(--gear-y), 0) translate(-50%, -50%);
  transition: opacity var(--depth-duration-active) var(--depth-ease-out);
}

#gear-cursor svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 2px 5px color-mix(in srgb, var(--depth-surface) 70%, transparent));
  transform: rotate(var(--gear-angle)) scale(var(--gear-scale));
  transform-origin: 50% 50%;
}

#gear-cursor.gear-visible { opacity: 1; }
#gear-cursor.gear-interactive { --gear-scale: 1.22; }
#gear-cursor.gear-pressed { --gear-scale: .86; }
#gear-cursor.gear-text-mode { opacity: 0; }

@media (hover: hover) and (pointer: fine) {
  html.has-gear-cursor,
  html.has-gear-cursor body,
  html.has-gear-cursor a,
  html.has-gear-cursor button,
  html.has-gear-cursor [role="button"],
  html.has-gear-cursor summary,
  html.has-gear-cursor label {
    cursor: none !important;
  }

  html.has-gear-cursor input,
  html.has-gear-cursor textarea,
  html.has-gear-cursor [contenteditable="true"] {
    cursor: text !important;
  }

  html.has-gear-cursor select,
  html.has-gear-cursor input[type="checkbox"],
  html.has-gear-cursor input[type="radio"] {
    cursor: default !important;
  }

  html.has-gear-cursor :disabled {
    cursor: not-allowed !important;
  }
}

@media (pointer: coarse) {
  #gear-cursor { display: none !important; }
}

body::before,
.blog-hero::before,
.lum360-link,
.hero-glow,
.scroll-line,
.dot-pulse {
  animation: none !important;
}

h1,
h2,
.hero-title,
.section-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.btn {
  white-space: nowrap;
  transition:
    background-color var(--depth-duration) var(--depth-ease-out),
    border-color var(--depth-duration) var(--depth-ease-out),
    color var(--depth-duration) var(--depth-ease-out),
    transform var(--depth-duration-active) var(--depth-ease-out) !important;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(.985);
  transition-duration: 100ms !important;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed !important;
  opacity: .55;
  transform: none !important;
}

.btn:focus-visible,
.depth-surface:focus-visible,
.depth-surface:focus-within {
  outline: 2px solid var(--depth-accent);
  outline-offset: 3px;
}

.reveal {
  transform: translateY(12px);
  transition:
    opacity 420ms var(--depth-ease-out),
    transform 420ms var(--depth-ease-out) !important;
}

.reveal.from-left {
  transform: translateX(-12px);
}

.reveal.from-scale {
  transform: scale(.985);
}

.reveal.visible {
  transform: none;
}

.depth-surface {
  --depth-rx: 0deg;
  --depth-ry: 0deg;
  --depth-lift: 0px;
  --depth-px: 0px;
  --depth-py: 0px;
  --depth-glint-x: -20px;
  --depth-glint-y: 0px;
  position: relative;
  transform:
    perspective(var(--depth-perspective))
    rotateX(var(--depth-rx))
    rotateY(var(--depth-ry))
    translate3d(0, var(--depth-lift), 0);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform var(--depth-duration) var(--depth-ease-out) !important;
}

.depth-surface.depth-active {
  border-color: var(--depth-line);
  box-shadow: var(--depth-shadow);
  transition-duration: var(--depth-duration-active) !important;
}

.depth-glint {
  position: absolute;
  z-index: 3;
  top: -42%;
  left: -34%;
  width: 34%;
  height: 184%;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--depth-accent) 18%, white 12%),
    transparent
  );
  opacity: 0;
  pointer-events: none;
  transform: translate3d(var(--depth-glint-x), var(--depth-glint-y), 34px) rotate(18deg);
  transition: opacity var(--depth-duration) var(--depth-ease-out);
}

.depth-active > .depth-glint {
  opacity: .38;
}

/* El CTA de emergencia conserva profundidad sin derramar el reflejo fuera del marco. */
.emergency-banner.depth-surface {
  overflow: hidden;
  isolation: isolate;
}

.emergency-banner > .depth-glint {
  top: -20%;
  left: -24%;
  width: 24%;
  height: 140%;
}

.emergency-banner.depth-active > .depth-glint {
  opacity: .14;
}

.depth-media {
  box-shadow: var(--depth-shadow-rest);
  isolation: isolate;
}

.depth-media > img,
.depth-media > video,
.depth-media > picture {
  transform: translate3d(var(--depth-px), var(--depth-py), 18px) scale(1.018);
  transition: transform var(--depth-duration) var(--depth-ease-out) !important;
}

.depth-media.depth-active > img,
.depth-media.depth-active > video,
.depth-media.depth-active > picture {
  transform: translate3d(var(--depth-px), var(--depth-py), 28px) scale(1.065);
}

img.depth-media.depth-active {
  box-shadow: var(--depth-shadow);
}

.depth-card > :not(.depth-glint),
.depth-card .card-img,
.depth-card .machine-img,
.depth-card .service-card-img {
  transform: translateZ(6px);
  transition: transform var(--depth-duration) var(--depth-ease-out);
}

.depth-card.depth-active > :not(.depth-glint) {
  transform: translateZ(16px);
}

.depth-card .card-body,
.depth-card .machine-info,
.depth-card .service-card-body {
  transform: translateZ(12px);
  transition: transform var(--depth-duration) var(--depth-ease-out);
}

.depth-table {
  transform-origin: 50% 20%;
  box-shadow: var(--depth-shadow-rest);
}

.depth-table tbody tr {
  transition:
    background-color var(--depth-duration) var(--depth-ease-out),
    transform var(--depth-duration-active) var(--depth-ease-out);
}

.depth-table tbody tr:hover {
  background: color-mix(in srgb, var(--depth-accent) 8%, transparent);
  transform: translateX(2px);
}

@media (hover: hover) and (pointer: fine) {
  .depth-surface.depth-active {
    will-change: transform;
  }
}

@media (max-width: 40rem) {
  .reveal,
  .reveal.from-left,
  .reveal.from-scale {
    opacity: 1;
    transform: none;
    transition: none !important;
  }

  .depth-surface,
  .depth-surface.depth-active,
  .depth-media > img,
  .depth-media > video,
  .depth-media > picture,
  .depth-media.depth-active > img,
  .depth-media.depth-active > video,
  .depth-media.depth-active > picture,
  img.depth-media.depth-active {
    transform: none !important;
    box-shadow: none;
  }

  .depth-glint {
    display: none;
  }
}

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

  .reveal,
  .reveal.from-left,
  .reveal.from-scale,
  .depth-surface,
  .depth-surface.depth-active,
  .depth-media > img,
  .depth-media > video,
  .depth-media > picture,
  .depth-media.depth-active > img,
  .depth-media.depth-active > video,
  .depth-media.depth-active > picture,
  img.depth-media.depth-active {
    opacity: 1;
    transform: none !important;
    transition-duration: 150ms !important;
  }

  #gear-cursor svg {
    transform: rotate(0deg) scale(var(--gear-scale));
  }
}
