/* GeckoApartment — Section 02 Virtual Terrarium Interactive LIVE DEMO */

.terrarium-demo-shell{
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);
  gap:20px;
  max-width:1020px;
  margin:0 auto;
  align-items:stretch;
}

/* ── Left: Hardware Top Module + Glass Terrarium Viewport ─────────────── */
.terrarium-viewport-card{
  display:flex;
  flex-direction:column;
  border-radius:var(--radius);
  background:var(--bg);
  border:1px solid var(--rule-strong);
  box-shadow:var(--shadow-lg);
  overflow:hidden;
}

.hw-module-bezel{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:11px 16px;
  background:#161618;
  color:#f5f5f7;
  border-bottom:1px solid #2c2c2e;
}
.hw-bezel-left{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.hw-bezel-brand{
  font-family:var(--mono);
  font-size:11.5px;
  font-weight:700;
  letter-spacing:.04em;
  color:#ffffff;
  white-space:nowrap;
}
.hw-bezel-unit{
  padding:2px 8px;
  border-radius:980px;
  background:rgba(255,255,255,.1);
  font-family:var(--mono);
  font-size:10.5px;
  font-weight:600;
  color:#a1a1a6;
  white-space:nowrap;
}
.hw-bezel-leds{
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink:0;
}
.hw-led-pip{
  display:inline-flex;
  align-items:center;
  gap:4px;
  font-family:var(--mono);
  font-size:10px;
  font-weight:700;
  color:#8e8e93;
  letter-spacing:.03em;
}
.hw-led-dot{
  width:6px;
  height:6px;
  border-radius:50%;
  background:#3a3a3c;
  transition:background-color .22s ease,box-shadow .22s ease;
}
.hw-led-pip.is-on{
  color:#f5f5f7;
}
.hw-led-pip.is-on .hw-led-dot{
  background:#34d399;
  box-shadow:0 0 8px rgba(52,211,153,.8);
}
.hw-led-pip.is-mist.is-on .hw-led-dot{
  background:#38bdf8;
  box-shadow:0 0 8px rgba(56,189,248,.85);
}
.hw-led-pip.is-ir.is-on .hw-led-dot{
  background:#f87171;
  box-shadow:0 0 8px rgba(248,113,113,.85);
}

/* Terrarium Glass Stage */
.terrarium-glass{
  position:relative;
  width:100%;
  aspect-ratio:4/3;
  background:#111113;
  overflow:hidden;
  --led-brightness:0.78;
  --led-cone-opacity:0.25;
}
.terrarium-photo{
  width:100%;
  height:100%;
  object-fit:cover;
  filter:brightness(var(--led-brightness));
  transition:filter .45s var(--spring),transform .55s var(--spring);
}
.terrarium-glass.is-misting .terrarium-photo{
  transform:scale(1.015);
}
.terrarium-glass.is-ir-mode .terrarium-photo{
  filter:grayscale(100%) contrast(1.24) brightness(0.76) sepia(100%) hue-rotate(74deg) saturate(1.9);
}

/* Top COB LED Light Cone */
.terrarium-led-cone{
  position:absolute;
  inset:0;
  pointer-events:none;
  background:radial-gradient(ellipse 74% 58% at 50% 0%,rgba(255,250,235,var(--led-cone-opacity)) 0%,rgba(255,250,235,0) 74%);
  transition:opacity .35s ease;
}
.terrarium-glass.is-ir-mode .terrarium-led-cone{
  opacity:0;
}

/* Dual Micro Nozzle Hardware Ports */
.terrarium-nozzles{
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:14px;
  pointer-events:none;
  z-index:3;
}
.terrarium-nozzle{
  position:absolute;
  top:0;
  width:16px;
  height:8px;
  transform:translateX(-50%);
  border-radius:0 0 6px 6px;
  background:#1d1d1f;
  border:1px solid rgba(255,255,255,.22);
  border-top:0;
}
.terrarium-nozzle.is-left{left:24%}
.terrarium-nozzle.is-right{left:76%}

/* Mist & Airflow Canvas */
.terrarium-canvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
  z-index:4;
}

/* Moisture Condensation Haze */
.terrarium-mist-haze{
  position:absolute;
  inset:0;
  z-index:2;
  pointer-events:none;
  opacity:0;
  background:radial-gradient(circle at 50% 35%,rgba(255,255,255,.24) 0%,rgba(255,255,255,.08) 55%,rgba(224,242,254,.18) 100%);
  transition:opacity .65s ease;
}
.terrarium-glass.is-misting .terrarium-mist-haze{
  opacity:1;
}

/* Night-Vision IR CreCam HUD */
.terrarium-ir-hud{
  position:absolute;
  inset:0;
  z-index:5;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding:14px;
  pointer-events:none;
  background:
    repeating-linear-gradient(0deg,rgba(16,185,129,.05) 0px,rgba(16,185,129,.05) 1px,transparent 1px,transparent 3px),
    radial-gradient(circle at center,transparent 48%,rgba(0,12,6,.56) 100%);
}
.ir-hud-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.ir-live-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:980px;
  background:rgba(0,0,0,.68);
  border:1px solid rgba(52,211,153,.45);
  font-family:var(--mono);
  font-size:11px;
  font-weight:700;
  color:#6ee7b7;
}
.ir-live-dot{
  width:7px;
  height:7px;
  border-radius:50%;
  background:#ef4444;
  animation:irPulse 1.4s ease-in-out infinite;
}
.ir-clock-pill{
  padding:4px 10px;
  border-radius:980px;
  background:rgba(0,0,0,.68);
  border:1px solid rgba(255,255,255,.16);
  font-family:var(--mono);
  font-size:11px;
  font-weight:700;
  font-variant-numeric:tabular-nums;
  color:#d1fae5;
}
.ir-hud-bottom{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  flex-wrap:wrap;
}
.ir-activity-pill{
  padding:5px 11px;
  border-radius:980px;
  background:rgba(0,0,0,.72);
  border:1px solid rgba(52,211,153,.35);
  font-size:11.5px;
  font-weight:600;
  color:#ecfdf5;
}
.ir-free-pill{
  padding:5px 10px;
  border-radius:980px;
  background:rgba(0,0,0,.72);
  border:1px solid rgba(255,255,255,.18);
  font-family:var(--mono);
  font-size:10.5px;
  font-weight:700;
  color:#a7f3d0;
}
@keyframes irPulse{0%,100%{opacity:1}50%{opacity:.28}}

/* Bottom Hardware Spec Strip */
.terrarium-foot-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  padding:12px 16px;
  background:var(--bg);
  border-top:1px solid var(--rule);
  font-size:12.5px;
  color:var(--muted);
}
.terrarium-foot-bar strong{
  color:var(--ink);
  font-weight:700;
}

/* ── Right: Mobile App Controller UI ──────────────────────────────────── */
.gecko-app-ui{
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:20px;
  border-radius:var(--radius);
  background:var(--bg);
  border:1px solid var(--rule-strong);
  box-shadow:var(--shadow-lg);
}

.app-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding-bottom:12px;
  border-bottom:1px solid var(--rule);
}
.app-device-meta{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.app-online-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#16a34a;
  flex-shrink:0;
}
.app-device-meta strong{
  font-size:14.5px;
  font-weight:800;
  letter-spacing:-.02em;
  color:var(--ink);
  white-space:nowrap;
}
.app-topbar-right{
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}
.app-sub-pill{
  padding:3px 9px;
  border-radius:980px;
  background:var(--mint-bg);
  border:1px solid var(--mint-border);
  color:var(--mint-ink);
  font-size:11px;
  font-weight:700;
  white-space:nowrap;
}
.app-reset-btn{
  padding:4px 10px;
  border-radius:980px;
  background:var(--surface);
  border:1px solid var(--rule-strong);
  font-size:11.5px;
  font-weight:600;
  color:var(--fg-2);
  transition:border-color .2s ease,color .2s ease;
}
.app-reset-btn:hover{
  border-color:var(--ink);
  color:var(--ink);
}

/* Telemetry Gauges */
.telemetry-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.telemetry-card{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:13px 14px;
  border-radius:var(--radius-sm);
  background:var(--surface);
  border:1px solid var(--rule);
}
.telemetry-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  font-size:12px;
  font-weight:700;
  color:var(--muted);
}
.telemetry-value{
  font-size:28px;
  font-weight:800;
  line-height:1.1;
  letter-spacing:-.035em;
  font-variant-numeric:tabular-nums;
  color:var(--ink);
}
.telemetry-target{
  font-size:11.5px;
  font-weight:600;
  color:var(--muted);
  font-variant-numeric:tabular-nums;
}
.telemetry-bar{
  position:relative;
  height:6px;
  border-radius:980px;
  background:var(--surface-3);
  overflow:hidden;
  margin-top:2px;
}
.telemetry-bar-fill{
  height:100%;
  width:50%;
  border-radius:980px;
  background:var(--ink);
  transition:width .35s var(--spring),background-color .35s ease;
}
.telemetry-bar-fill.is-optimal{background:#16a34a}
.telemetry-bar-fill.is-dry{background:#d97706}
.telemetry-bar-fill.is-humid{background:#0284c7}

.telemetry-pill{
  display:inline-flex;
  align-items:center;
  align-self:flex-start;
  padding:3px 9px;
  border-radius:980px;
  font-size:11px;
  font-weight:700;
  margin-top:2px;
  white-space:nowrap;
}
.telemetry-pill.is-optimal{background:var(--mint-bg);border:1px solid var(--mint-border);color:var(--mint-ink)}
.telemetry-pill.is-dry{background:var(--amber-bg);border:1px solid var(--amber-border);color:var(--amber-ink)}
.telemetry-pill.is-humid{background:#eff6ff;border:1px solid #bfdbfe;color:#1d4ed8}
.telemetry-pill.is-neutral{background:var(--bg);border:1px solid var(--rule-strong);color:var(--fg-2)}

/* Interactive Control Buttons */
.controller-actions{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}
.ctrl-btn{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  min-height:82px;
  padding:12px;
  border-radius:16px;
  background:var(--surface);
  border:1.5px solid var(--rule-strong);
  text-align:left;
  overflow:hidden;
  transition:transform .25s var(--spring),border-color .25s ease,background-color .25s ease,color .25s ease;
}
.ctrl-btn:hover{
  border-color:var(--ink);
  transform:translateY(-1px);
}
.ctrl-btn.is-active{
  background:var(--ink);
  border-color:var(--ink);
  color:#ffffff;
}
.ctrl-btn-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
  gap:6px;
}
.ctrl-btn-icon{
  width:18px;
  height:18px;
  flex-shrink:0;
}
.ctrl-btn-badge{
  padding:2px 7px;
  border-radius:980px;
  background:rgba(29,29,31,.08);
  font-size:10px;
  font-weight:700;
  white-space:nowrap;
}
.ctrl-btn.is-active .ctrl-btn-badge{
  background:rgba(255,255,255,.18);
  color:#ffffff;
}
.ctrl-btn-label{
  font-size:13px;
  font-weight:800;
  letter-spacing:-.018em;
  line-height:1.25;
}
.mist-progress-track{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:3px;
  background:rgba(255,255,255,.22);
}
.mist-progress-fill{
  height:100%;
  width:0%;
  background:#38bdf8;
  transition:width .1s linear;
}

/* LED Dimming Slider Block */
.led-control-box{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:13px 14px;
  border-radius:var(--radius-sm);
  background:var(--surface);
  border:1px solid var(--rule);
}
.led-control-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.led-control-head label{
  font-size:12.5px;
  font-weight:700;
  color:var(--ink);
}
.led-readout{
  font-family:var(--mono);
  font-size:12px;
  font-weight:700;
  color:var(--muted);
  font-variant-numeric:tabular-nums;
}
.led-slider{
  width:100%;
  height:6px;
  appearance:none;
  -webkit-appearance:none;
  border-radius:980px;
  background:var(--rule-strong);
  outline:none;
  cursor:pointer;
}
.led-slider::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width:20px;
  height:20px;
  border-radius:50%;
  background:var(--ink);
  border:2px solid #ffffff;
  box-shadow:0 2px 8px rgba(0,0,0,.22);
}
.led-slider::-moz-range-thumb{
  width:20px;
  height:20px;
  border-radius:50%;
  background:var(--ink);
  border:2px solid #ffffff;
  box-shadow:0 2px 8px rgba(0,0,0,.22);
}
.led-preset-row{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:6px;
}
.led-preset-btn{
  padding:5px 6px;
  border-radius:980px;
  background:var(--bg);
  border:1px solid var(--rule-strong);
  font-family:var(--mono);
  font-size:11.5px;
  font-weight:700;
  color:var(--fg-2);
  transition:background-color .2s ease,border-color .2s ease,color .2s ease;
}
.led-preset-btn:hover{
  border-color:var(--ink);
  color:var(--ink);
}
.led-preset-btn.is-active{
  background:var(--ink);
  border-color:var(--ink);
  color:#ffffff;
}

/* Auto-Rule & Live Event Log */
.app-event-bar{
  margin-top:auto;
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:11px 13px;
  border-radius:14px;
  background:var(--surface);
  border:1px solid var(--rule);
}
.app-rule-text{
  font-size:11.5px;
  font-weight:600;
  color:var(--muted);
}
.app-event-log{
  font-size:12.5px;
  font-weight:700;
  color:var(--ink);
  line-height:1.4;
}

@media(max-width:960px){
  .terrarium-demo-shell{
    grid-template-columns:1fr;
  }
}
@media(max-width:600px){
  .gecko-app-ui{
    padding:16px;
  }
  .hw-module-bezel{
    padding:10px 12px;
  }
  .hw-bezel-unit{
    display:none;
  }
  .hw-bezel-leds{
    gap:7px;
  }
  .controller-actions{
    grid-template-columns:1fr;
  }
  .ctrl-btn{
    flex-direction:row;
    align-items:center;
    min-height:54px;
    padding:11px 14px;
  }
  .ctrl-btn-top{
    width:auto;
    gap:8px;
  }
  .ctrl-btn-label{
    margin-left:auto;
  }
}
@media(prefers-reduced-motion:reduce){
  .ir-live-dot{
    animation:none;
  }
  .terrarium-photo,.terrarium-mist-haze,.terrarium-led-cone,.telemetry-bar-fill{
    transition:none!important;
  }
}
