/*
 MicroMetrics main-site enhancement patch
 - responsive 4-photo product gallery
 - fixed/static decorative candlesticks
 - interactive demo customization
 - feature highlights
*/

/* ---------- Product gallery ---------- */
.mm-gallery-v2 {
  width: min(100%, 1120px);
  margin: 34px auto 28px;
}

.mm-gallery-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 420px;
  height: clamp(420px, 52vw, 620px);
  padding: clamp(14px, 2.5vw, 28px);
  overflow: hidden;
  border: 1px solid rgba(156, 255, 59, 0.16);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.08), transparent 45%),
    #f4f5f2;
}

.mm-gallery-stage img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 940px;
  max-height: 570px;
  object-fit: contain !important;
  object-position: center !important;
  margin: auto;
  border-radius: 18px;
}

.mm-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.mm-gallery-thumb {
  appearance: none;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}

.mm-gallery-thumb:hover,
.mm-gallery-thumb:focus-visible {
  border-color: rgba(156,255,59,.55);
  background: rgba(156,255,59,.055);
  outline: none;
}

.mm-gallery-thumb[aria-current="true"] {
  border-color: #9cff3b;
  box-shadow: 0 0 0 1px rgba(156,255,59,.2);
}

.mm-gallery-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain !important;
  object-position: center !important;
  border-radius: 10px;
  background: #f4f5f2;
}

/* Hide legacy hardware-photo elements after the upgraded gallery is mounted. */
.mm-hardware-upgraded .mm-gallery-legacy-hidden {
  display: none !important;
}

/* ---------- Demo controls ---------- */
.mm-demo-customizer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.11);
}

.mm-demo-control {
  min-width: 0;
}

.mm-demo-control label {
  display: block;
  margin-bottom: 7px;
  color: rgba(239,243,232,.75);
  font-size: .78rem;
}

.mm-demo-control input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  background: #0f130d;
  cursor: pointer;
}

.mm-demo-control select {
  width: 100%;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  background: #0f130d;
  color: #eef1e9;
}

.mm-demo-reset {
  grid-column: 1 / -1;
  min-height: 42px;
  border: 1px solid rgba(156,255,59,.25);
  border-radius: 10px;
  background: rgba(156,255,59,.055);
  color: #dfffc0;
  cursor: pointer;
}

/* ---------- Stable demo screen ---------- */
.mm-demo-display {
  --mm-screen-bg: #050807;
  --mm-screen-text: #f5f7f2;
  --mm-candle-up: #36f028;
  --mm-candle-down: #ff5c25;

  position: relative;
  width: 100%;
  height: 100%;
  min-height: 250px;
  overflow: hidden;
  border-radius: inherit;
  background: var(--mm-screen-bg);
  color: var(--mm-screen-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.mm-demo-display-inner {
  position: absolute;
  inset: 6% 6% 5%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 7px;
}

.mm-demo-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  color: var(--mm-screen-text);
}

.mm-demo-symbol {
  font-weight: 800;
  font-size: clamp(16px, 3.4vw, 28px);
  letter-spacing: -.04em;
  white-space: nowrap;
}

.mm-demo-status {
  display: grid;
  justify-items: end;
  font-size: clamp(8px, 1.5vw, 12px);
  line-height: 1.05;
}

.mm-demo-change {
  color: var(--mm-candle-down);
  font-weight: 800;
}

.mm-demo-battery {
  color: #9cff3b;
  border: 1px solid var(--mm-screen-text);
  padding: 0 3px;
}

.mm-demo-chart {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 120px;
  overflow: visible;
}

.mm-demo-axis,
.mm-demo-gridline {
  stroke: color-mix(in srgb, var(--mm-screen-text) 24%, transparent);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.mm-demo-candle-wick {
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.mm-demo-candle-body {
  rx: 1.2;
  vector-effect: non-scaling-stroke;
}

.mm-demo-footer {
  display: grid;
  grid-template-columns: 1fr 1.35fr auto;
  gap: 6px;
  align-items: center;
  color: var(--mm-screen-text);
}

.mm-demo-device-button {
  display: grid;
  place-items: center;
  min-height: 28px;
  border: 1.6px solid #9cff3b;
  border-radius: 4px;
  font-size: clamp(8px, 1.4vw, 12px);
  font-weight: 700;
}

.mm-demo-wifi {
  color: #9cff3b;
  font-size: clamp(18px, 3vw, 26px);
  line-height: 1;
}

/* ---------- Feature spotlight ---------- */
.mm-feature-spotlight {
  width: min(100% - 32px, 1160px);
  margin: 70px auto;
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid rgba(156,255,59,.15);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(156,255,59,.04), rgba(255,255,255,.015)),
    #141912;
}

.mm-feature-eyebrow {
  margin: 0 0 12px;
  color: #a9c594;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .19em;
}

.mm-feature-spotlight h2 {
  max-width: 850px;
  margin: 0;
  color: #f1f3ed;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -.045em;
}

.mm-feature-intro {
  max-width: 760px;
  margin: 20px 0 34px;
  color: #b2bbaa;
  font-size: clamp(1rem, 1.7vw, 1.18rem);
}

.mm-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
}

.mm-feature-card {
  min-height: 185px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.105);
  border-radius: 16px;
  background: rgba(5,8,5,.18);
}

.mm-feature-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 20px;
  border: 1px solid rgba(156,255,59,.3);
  border-radius: 9px;
  color: #9cff3b;
  font-weight: 900;
}

.mm-feature-card h3 {
  margin: 0 0 9px;
  color: #f4f6f0;
  font-size: 1.05rem;
}

.mm-feature-card p {
  margin: 0;
  color: #aeb7a7;
  line-height: 1.55;
}

/* ---------- Stable decorative market background ---------- */
.candle-background,
.candles-background,
.market-candles,
.market-candle-background,
[class*="candle-background"],
[class*="candle-bg"] {
  display: none !important;
  animation: none !important;
}

.mm-static-market-bg {
  position: fixed;
  z-index: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(180px, 22vh);
  pointer-events: none;
  opacity: .13;
  overflow: hidden;
}

.mm-static-market-bg svg {
  display: block;
  width: 100%;
  height: 100%;
}

body > header,
body > main,
body > footer {
  position: relative;
  z-index: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .mm-gallery-stage {
    min-height: 320px;
    height: 70vw;
    max-height: 440px;
  }

  .mm-gallery-thumbs {
    grid-template-columns: repeat(4, minmax(70px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .mm-feature-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .mm-gallery-stage {
    min-height: 280px;
    height: 84vw;
    padding: 10px;
  }

  .mm-demo-customizer,
  .mm-feature-grid {
    grid-template-columns: 1fr;
  }

  .mm-feature-spotlight {
    width: min(100% - 22px, 1160px);
    margin: 44px auto;
  }
}
