/* LinguaEmpire 3D — CSS 3D depth utilities.
 *
 * Brand colours: navy #070D1F / #101828, blue #2E6BFF, cyan #22D3EE,
 * gold #F5C542, ink #1A2332, muted #5B6572, light background #F7F5EF.
 *
 * Classes:
 *   .le-3d-scene   — perspective wrapper for 3D children.
 *   .le-globe      — the WebGL globe container (navy, rounded, 420px tall).
 *   .le-globe--hero — globe sized to the homepage hero panel width.
 *   .le-card-3d    — layered card with translateZ lift + shadow depth on hover.
 *   .le-glass      — glassmorphism panel (light + dark variants).
 *   .le-parallax   — element that linguaempire-3d.js moves subtly with the
 *                    mouse when it carries [data-le-parallax].
 *
 * Graceful degradation: without 3D transform support, or with
 * prefers-reduced-motion, cards render as plain cards with a simple lift;
 * .le-glass falls back to a solid background where backdrop-filter is
 * unsupported. No external resource is referenced anywhere in this file.
 */

/* ---------- Globe container ---------- */

.le-3d-scene {
  perspective: 1200px;
}

.le-globe {
  position: relative;
  width: 100%;
  height: 420px;
  background: radial-gradient(circle at 50% 40%, #1e3a5f, #070d1f 75%);
  border-radius: 12px;
  overflow: hidden;
}

.le-globe canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.le-globe canvas:active {
  cursor: grabbing;
}

/* Hero placement: same width rhythm as the homepage hero panel. */
.le-globe--hero {
  max-width: 880px;
  margin: 0 auto 28px;
}

/* Static fallback image (shown when WebGL / Three.js is unavailable,
   and while the globe loads). Centred over the navy container. */
.le-globe-fallback-img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 320px;
  width: 80%;
  height: auto;
  filter: drop-shadow(0 8px 20px rgba(125, 211, 252, 0.45));
}

.le-globe-fallback {
  min-height: 420px;
}

/* ---------- 3D cards ---------- */

.le-card-3d {
  transform-style: preserve-3d;
  transform: translateZ(0);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.08);
  will-change: transform;
}

/* Inner layer that floats above the card surface. */
.le-card-3d .le-layer {
  transform: translateZ(20px);
}

.le-card-3d--gold {
  border-top: 4px solid #f5c542;
}

@media (hover: hover) {
  .le-card-3d:hover {
    transform: translateY(-6px) translateZ(24px);
    box-shadow:
      0 24px 48px rgba(16, 24, 40, 0.18),
      0 4px 12px rgba(201, 162, 39, 0.12);
  }
}

/* ---------- Glassmorphism panels ---------- */

.le-glass {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.12);
}

.le-glass--dark {
  background: rgba(15, 23, 42, 0.66);
  color: #e2e8f0;
  border-color: rgba(125, 211, 252, 0.25);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .le-glass {
    background: #ffffff;
  }
  .le-glass--dark {
    background: #070d1f;
  }
}

/* ---------- Parallax ---------- */

.le-parallax {
  will-change: transform;
  transition: transform 0.2s ease-out;
}

/* ---------- Reduced motion / no-3D fallbacks ---------- */

@media (prefers-reduced-motion: reduce) {
  .le-3d-scene {
    perspective: none;
  }
  .le-card-3d,
  .le-card-3d:hover {
    transform: none;
    transition: none;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.08);
  }
  .le-card-3d .le-layer {
    transform: none;
  }
  .le-parallax {
    transition: none;
  }
}

@supports not (transform: translateZ(0)) {
  .le-card-3d:hover {
    transform: translateY(-4px);
  }
}

/* ---------- Interactive services desk scene ---------- */

/* Container sits in the same <figure> slot as the flat services
   illustration (same width, rounded corners, 16:9 like the 1600x900
   illustration). Navy gradient desk; canvas fills it; the fallback
   image covers it while 3D loads and replaces it if WebGL fails. */
.le-services-3d {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 560px;
  background: radial-gradient(circle at 50% 38%, #1e3a5f, #070d1f 78%);
  border-radius: 12px;
  overflow: hidden;
}

.le-services-3d canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.le-services-3d canvas:active {
  cursor: grabbing;
}

.le-services-3d:focus-visible {
  outline: 2px solid #33cfff;
  outline-offset: 2px;
}

/* Fallback illustration: covers the container while 3D loads; in
   fallback mode it becomes the static figure, exactly as before. */
.le-services-fallback-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.le-services-fallback {
  height: auto;
  aspect-ratio: auto;
  max-height: none;
  background: none;
  overflow: visible;
}

.le-services-fallback .le-services-fallback-img {
  position: static;
  height: auto;
  object-fit: contain;
}

.le-services-fallback canvas,
.le-services-fallback .le-services-3d-label,
.le-services-fallback .le-services-3d-hint {
  display: none;
}

/* Label bar: names what the highlighted element stands for. */
.le-services-3d-label {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 42px;
  text-align: center;
  color: #f5c542;
  background: rgba(7, 13, 31, 0.72);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  pointer-events: none;
}

/* Hint line under the label. */
.le-services-3d-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  text-align: center;
  color: #c9d1dd;
  font-size: 13px;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .le-services-3d-label,
  .le-services-3d-hint {
    transition: none;
  }
}

/* ---------- Two-column hero placement (Worker P, 2026-11-09) ---------- */

/* User direction: every page's 3D scene sits in the EMPTY RIGHT SIDE of the
   hero, beside the text — not as a separate full-width block below it.
   The primary two-column hero pattern is the sibling layout agent's
   (linguaempire-vivid.css: header.le-hero--2col with .le-hero-text /
   .le-hero-scene); header scenes use that pattern and the sibling's
   sizing (.le-hero-scene .le-services-3d{max-height:460px}).
   .le-hero-split below is the self-contained fallback (new classes only;
   no existing hero class, id or text is altered): text left, scene right.
   It is used where the header pattern does not reach — the cat-tool
   in-<main> split (mockup left, scene right) — and anywhere a page is
   not yet converted. Existing .le-services-3d full-width rules above are
   untouched: they are the fallback for any page not yet converted. */
.le-hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 24px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  text-align: left;
}

.le-hero-split > * {
  min-width: 0;
}

.le-hero-split-text {
  text-align: left;
}

/* CTAs sit in the left text column: left-align them there (the centred
   default belongs to the old full-width hero). */
.le-hero-split-text .hero-ctas {
  justify-content: flex-start;
}

.le-hero-split-scene {
  min-width: 0;
}

/* Figures inside the split carry no browser default margins. */
.le-hero-split figure {
  margin: 0;
}

/* Right-column scene sizing: fills its column, 4/3 so it fits the hero's
   height instead of pushing the hero taller (at ~450px column width the
   scene is ~340px tall, inside the text column's height). */
.le-services-3d--hero {
  aspect-ratio: 4 / 3;
  max-height: 420px;
}

/* Label + hint are absolutely positioned; shrink them slightly so both
   still fit inside the narrower hero container. */
.le-services-3d--hero .le-services-3d-label {
  font-size: 14px;
  bottom: 38px;
  padding: 6px 10px;
}

.le-services-3d--hero .le-services-3d-hint {
  font-size: 12px;
  bottom: 8px;
}

/* Mobile: hero stacks — text on top, scene below at full width. */
@media (max-width: 760px) {
  .le-hero-split {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .le-services-3d--hero {
    aspect-ratio: 16 / 9;
  }
}

