/* =============================================================
   HZL Microsite — Section 13: Product Operational Performance
   Mining Terrain — topographic deposits, clickable cards
     • Background photo + animated cyan wireframe terrain
     • 3 glowing green deposits (Zinc / Lead / Silver)
     • Click → cursor-wander 3D tilt card with shine + glare
   ============================================================= */

/* ── Stage ──────────────────────────────────────────────────── */
/* .mine is a tall scroll track; the scene is pinned inside it */
.mine {
  position: relative;
  width: 100%;
  height: 120vh;
  background: transparent;
  z-index: 700;
}

.mine__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: #060418;
  /* sticky creates a stacking context — lift it above the chat
     widget (z 600) so deposits stay clickable, but below the
     site header (z 1000) so the nav stays on top. */
  z-index: 700;
}

/* zoomable scene wrapper — JS scales this into the LEAD dot */
.mine__scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  will-change: transform, opacity;
}

/* green warp glow that engulfs the screen at the zoom climax */
.mine__zoomglow {
  position: absolute;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
  opacity: 0;
  will-change: opacity;
  background: radial-gradient(
    circle at var(--zx, 50%) var(--zy, 44%),
    #eaffd2 0%,
    #b6f072 6%,
    rgba(143, 227, 79, 0.85) 16%,
    rgba(143, 227, 79, 0) 46%
  );
}

/* background photo */
.mine__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  display: block;
}

/* scrim over photo — keeps markers legible but lets the image show */
.mine__bg-scrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 70% at 50% 6%, rgba(30, 16, 70, 0.40) 0%, transparent 55%),
    linear-gradient(180deg, rgba(12, 6, 32, 0.46) 0%, rgba(8, 5, 28, 0.30) 42%, rgba(6, 4, 22, 0.58) 100%);
}

/* terrain canvas */
.mine__terrain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* marker layer — z-index above the floating chat widget (z 600)
   so deposits stay clickable regardless of viewport / widget overlap */
.mine__markers {
  position: absolute;
  inset: 0;
  z-index: 700;
  pointer-events: none;
  will-change: opacity;
}
/* during the zoom transition deposits stop catching clicks */
.mine__markers.is-zooming .mine__marker { pointer-events: none; }

/* ── Header ─────────────────────────────────────────────────── */
.mine__head {
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 4;
  pointer-events: none;
}
.mine__eyebrow {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #7fb942;
  margin-bottom: 12px;
}
.mine__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #eef2f6;
  margin: 0;
}
.mine__hint {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(238, 242, 246, 0.90);
  animation: mineHintBlink 2.4s ease-in-out infinite;
}
@keyframes mineHintBlink { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }

/* ── Marker ─────────────────────────────────────────────────── */
.mine__marker {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: none;
  border: none;
  -webkit-tap-highlight-color: transparent;
}
.mine__orb {
  position: relative;
  width: 34px;
  height: 34px;
}
.mine__orb::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 90px;
  height: 90px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143, 227, 79, 0.42) 0%, rgba(143, 227, 79, 0.08) 40%, transparent 70%);
  animation: mineOrbHalo 2.6s ease-in-out infinite;
}
@keyframes mineOrbHalo {
  0%, 100% { transform: translate(-50%, -50%) scale(0.9);  opacity: .55; }
  50%      { transform: translate(-50%, -50%) scale(1.35); opacity: 1;   }
}
.mine__orb::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid rgba(143, 227, 79, 0.6);
  animation: mineOrbPing 2.6s ease-out infinite;
}
@keyframes mineOrbPing {
  0%   { transform: translate(-50%, -50%) scale(0.6); opacity: .9; }
  70%  { transform: translate(-50%, -50%) scale(2.6); opacity: 0;  }
  100% { opacity: 0; }
}
.mine__core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, #f6ffe9 0%, #c4f08a 35%, #8fe34f 65%, #4fae1f 100%);
  box-shadow: 0 0 16px 4px rgba(143, 227, 79, 0.7), 0 0 40px 10px rgba(143, 227, 79, 0.35);
}
.mine__marker:hover .mine__core {
  box-shadow: 0 0 22px 6px rgba(143, 227, 79, 0.9), 0 0 56px 16px rgba(143, 227, 79, 0.5);
}
.mine__marker:hover .mine__label { color: #fff; }
.mine__marker:hover .mine__orb::before { animation-duration: 1.4s; }

.mine__label {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(238, 242, 246, 0.86);
  transition: color .25s;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}
.mine__sub {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #8fe34f;
  margin-top: -8px;
}

/* ── Card modal ─────────────────────────────────────────────── */
.mine__overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 4, 20, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;        /* never intercept clicks while closed */
  transition: opacity .4s ease, visibility .4s;
  perspective: 1300px;
}
.mine__overlay.is-open { opacity: 1; visibility: visible; pointer-events: auto; }

.mine__tilt {
  transform-style: preserve-3d;
  transition: transform .16s ease-out;
  will-change: transform;
}

.mine__card {
  position: relative;
  width: min(880px, 94vw);
  max-height: 86vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 24px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(14, 20, 40, 0.10);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.35);
  transform: translateY(26px) scale(0.96);
  opacity: 0;
  transition: transform .5s cubic-bezier(.16, 1, .3, 1), opacity .5s;
  transform-style: preserve-3d;
}
.mine__overlay.is-open .mine__card { transform: translateY(0) scale(1); opacity: 1; }

/* Glare — radial highlight that follows the cursor */
.mine__glare {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  border-radius: 24px;
  opacity: 0;
  transition: opacity .3s ease;
  background: radial-gradient(
    340px circle at var(--gx, 50%) var(--gy, 50%),
    rgba(255, 255, 255, 0.16) 0%,
    rgba(255, 255, 255, 0.05) 28%,
    transparent 60%
  );
  mix-blend-mode: soft-light;
}
.mine__card.is-wander .mine__glare { opacity: 1; }

/* Shine — diagonal light streak sweeping across the card */
.mine__shine {
  position: absolute;
  top: -60%;
  left: -75%;
  width: 55%;
  height: 220%;
  z-index: 7;
  pointer-events: none;
  transform: rotate(18deg);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 38%,
    rgba(255, 255, 255, 0.28) 50%,
    rgba(255, 255, 255, 0.05) 62%,
    transparent 100%
  );
  mix-blend-mode: soft-light;
  opacity: 0;
}
.mine__overlay.is-open .mine__shine {
  animation: mineCardShine 4.6s cubic-bezier(.5, 0, .5, 1) 0.55s infinite;
}
@keyframes mineCardShine {
  0%   { left: -75%; opacity: 0; }
  8%   { opacity: 1; }
  26%  { left: 135%; opacity: 1; }
  30%  { opacity: 0; }
  100% { left: 135%; opacity: 0; }
}

.mine__card-media {
  position: relative;
  min-height: 340px;
  transform: translateZ(24px);
}
.mine__card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.mine__card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 60%, rgba(255, 255, 255, 0.96) 100%),
    linear-gradient(180deg, transparent 50%, rgba(255, 255, 255, 0.4) 100%);
}
.mine__card-rail {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--cc, #0060a3);
  z-index: 2;
}

.mine__card-body {
  padding: 40px 40px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transform: translateZ(40px);
}
.mine__card-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cc, #0060a3);
  margin-bottom: 18px;
}
.mine__card-eyebrow::before {
  content: '';
  width: 28px;
  height: 1.5px;
  background: var(--cc, #0060a3);
}
.mine__card-stat {
  font-family: var(--font-display);
  font-size: clamp(56px, 7vw, 84px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: #0e1428;
  margin-bottom: 22px;
}
.mine__card-stat span {
  font-size: 0.30em;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--cc, #0060a3);
  vertical-align: 0.4em;
  margin-left: 0.1em;
}
.mine__card-desc {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: rgba(14, 20, 40, 0.75);
  margin-bottom: 14px;
}
.mine__card-tag {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: rgba(14, 20, 40, 0.50);
  margin: 0 0 20px;
}

.mine__card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display, sans-serif);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cc, #0060a3);
  text-decoration: none;
  transition: gap 0.22s, opacity 0.22s;
}
.mine__card-cta:hover {
  opacity: 0.75;
  gap: 10px;
}


/* close button */
.mine__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(14, 20, 40, 0.18);
  background: rgba(255, 255, 255, 0.85);
  color: rgba(14, 20, 40, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 8;
  transition: background .2s, color .2s, border-color .2s;
}
.mine__close:hover { background: rgba(127, 185, 66, 0.18); color: #7fb942; border-color: #7fb942; }
.mine__close svg { width: 18px; height: 18px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 680px) {
  /* Taller scroll track on phones: at 120vh the sticky left only ~20vh of
     scroll, so the deposits + zoom-dive fade flew past and the section
     "vanished" almost instantly. 200vh → ~100vh of scroll for a readable,
     tappable dwell and a gradual fade-out. */
  .mine { height: 200vh; }
  .mine__card { grid-template-columns: 1fr; max-height: 90vh; overflow-y: auto; }
  .mine__card-media { min-height: 200px; }
  .mine__card-media::after { background: linear-gradient(180deg, transparent 40%, rgba(255, 255, 255, 0.96) 100%); }
  .mine__card-body { padding: 28px 24px 30px; }
  .mine__label { font-size: 15px; }
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .mine__orb::before,
  .mine__orb::after,
  .mine__hint,
  .mine__shine { animation: none; }
  .mine__tilt { transition: none; }
}
