/* Smart home demo — visual-first SVG stage */

@font-face {
  font-family: 'VelaSans';
  src: url('https://maybesmart.ru/assets/fonts/VelaSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'VelaSans';
  src: url('https://maybesmart.ru/assets/fonts/VelaSans-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'VelaSans';
  src: url('https://maybesmart.ru/assets/fonts/VelaSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --sd-bg: #0b0d12;
  --sd-bg-2: #080a0f;
  --sd-panel: #12151d;
  --sd-border: rgba(255, 255, 255, 0.09);
  --sd-text: #eef0f6;
  --sd-muted: rgba(238, 240, 246, 0.58);
  --sd-accent: #8b7cff;
  --sd-accent-2: #5c4fd4;
  --sd-warn: #ffb020;
  --sd-danger: #ff5c5c;
  --sd-info: #4db8ff;
  --sd-heat: #ff8a4c;
  --sd-ok: #3dd68c;
  --sd-radius: 18px;
  --sd-sidebar: 420px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body.smart-demo-body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  background: var(--sd-bg);
  color: var(--sd-text);
  font-family: VelaSans, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.smart-demo-body {
  overflow: hidden;
}

.sd-app {
  display: grid;
  grid-template-columns: var(--sd-sidebar) 1fr;
  height: 100vh;
  height: 100dvh;
  background:
    radial-gradient(ellipse 55% 45% at 78% 12%, rgba(139, 124, 255, 0.14), transparent 58%),
    radial-gradient(ellipse 40% 35% at 8% 88%, rgba(45, 120, 90, 0.08), transparent 50%),
    radial-gradient(ellipse 30% 30% at 50% 50%, rgba(20, 24, 40, 0.5), transparent 70%),
    var(--sd-bg);
}

.sd-back {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(18, 21, 29, 0.9);
  border: 1px solid var(--sd-border);
  color: var(--sd-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.sd-back:hover {
  border-color: rgba(139, 124, 255, 0.55);
  background: rgba(139, 124, 255, 0.14);
  transform: translateY(-1px);
}

.sd-sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 64px 16px 18px;
  border-right: 1px solid var(--sd-border);
  background: linear-gradient(180deg, rgba(14, 16, 24, 0.92), rgba(10, 12, 18, 0.88));
  overflow: hidden;
}

.sd-sidebar::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(139, 124, 255, 0.55), transparent);
  opacity: 0.7;
  pointer-events: none;
}

.sd-sidebar__head {
  padding: 0 8px;
  flex: 0 0 auto;
}

.sd-brand {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c4b8ff;
}

.sd-title {
  margin: 0 0 8px;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.15;
  font-weight: 700;
}

.sd-lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--sd-muted);
}

.sd-cats {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 124, 255, 0.35) transparent;
}

.sd-cat {
  border: none;
  background: transparent;
  padding: 0 2px 12px;
}

.sd-cat__title {
  margin: 0 0 8px;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(196, 184, 255, 0.85);
}

.sd-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.sd-action {
  appearance: none;
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 6px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--sd-text);
  font: 500 11px/1.3 VelaSans, system-ui, sans-serif;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
}

.sd-action__label {
  display: block;
  width: 100%;
}

.sd-action:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(139, 124, 255, 0.35);
  transform: translateY(-1px);
}

.sd-action.is-active {
  background: linear-gradient(160deg, rgba(139, 124, 255, 0.38), rgba(92, 79, 212, 0.18));
  border-color: rgba(139, 124, 255, 0.7);
  color: #fff;
  box-shadow: 0 0 18px rgba(139, 124, 255, 0.2);
}

.sd-action.is-on:not(.is-active) {
  border-color: rgba(139, 124, 255, 0.4);
  background: rgba(139, 124, 255, 0.12);
}

.sd-action.is-on {
  box-shadow: inset 0 0 0 1px rgba(139, 124, 255, 0.25);
}

.sd-action--moment {
  border-style: dashed;
}

.sd-switch {
  display: none !important;
}

.sd-main {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 48px 12px 14px 4px;
  overflow: hidden;
}

.sd-info {
  display: none !important;
}

.sd-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  border-radius: 22px;
  border: 1px solid var(--sd-border);
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(30, 36, 58, 0.45), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 45%),
    var(--sd-bg-2);
  overflow: hidden;
  padding: 8px 8px 12px 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 20px 60px rgba(0, 0, 0, 0.35);
}

.sd-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.35) 100%);
  z-index: 2;
}

.sd-plan {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: block;
}

/* SVG base */
.sd-label {
  fill: rgba(28, 32, 42, 0.78);
  font-size: 12px;
  font-family: VelaSans, system-ui, sans-serif;
  font-weight: 700;
  pointer-events: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sd-label--on-furniture {
  fill: rgba(20, 24, 32, 0.92);
  paint-order: stroke fill;
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 2.5px;
}

.sd-wall {
  pointer-events: none;
}

.sd-device-label {
  fill: rgba(238, 240, 246, 0.28);
  font-family: VelaSans, system-ui, sans-serif;
  font-size: 9px;
  letter-spacing: 0.02em;
}

.sd-furniture,
.sd-window {
  pointer-events: none;
}

.sd-furniture .sd-px,
image.sd-px {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}

/* Default inactive visuals — GSAP drives active states */
.sd-glow {
  opacity: 0;
  pointer-events: none;
}

.sd-bulb {
  fill: url(#sd-bulb-off);
  opacity: 1;
}

.sd-bulb-icon {
  pointer-events: none;
}

.sd-sensor {
  cursor: pointer;
}

.sd-tip {
  position: fixed;
  z-index: 80;
  max-width: 260px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(14, 16, 24, 0.94);
  border: 1px solid rgba(139, 124, 255, 0.45);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.sd-tip.has-gif {
  max-width: 430px;
}

.sd-tip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.sd-tip__body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.sd-tip__copy {
  min-width: 0;
  flex: 1 1 auto;
}

.sd-tip__title {
  display: block;
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: #c4b8ff;
}

.sd-tip__text {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(238, 240, 246, 0.72);
}

.sd-tip__gif {
  display: none;
  width: 148px;
  height: 100px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
  background: #1a1e28;
}

.sd-tip.has-gif .sd-tip__gif {
  display: block;
}

.sd-spray-arcs {
  pointer-events: none;
}

.sd-wet-patch {
  pointer-events: none;
}

.sd-light-beam {
  opacity: 0;
  pointer-events: none;
}

.sd-curtain {
  fill: url(#sd-curtain-grad);
  stroke: rgba(180, 165, 255, 0.25);
  stroke-width: 1;
}

.sd-blind-slat {
  fill: rgba(170, 155, 255, 0.42);
}

.sd-floor-heat {
  opacity: 0;
  pointer-events: none;
}

.sd-air-flow {
  opacity: 0;
  pointer-events: none;
}

.sd-ac-led {
  fill: #ff5c5c;
  animation: sd-ac-blink 0.85s ease-in-out infinite;
}

.sd-ac.is-on .sd-ac-led,
.sd-vent.is-on .sd-ac-led {
  fill: #3dd68c;
  animation: none;
  opacity: 1;
}

@keyframes sd-ac-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.22;
  }
}

.sd-map-icon {
  cursor: pointer;
}

.sd-map-icon use {
  color: #c4b8ff;
}

.sd-map-icon__bg {
  transition: fill 0.2s ease, stroke 0.2s ease;
}

.sd-map-icon.is-active .sd-map-icon__bg {
  fill: #2a2448;
  stroke: #c4b8ff;
}

.sd-fx {
  opacity: 0;
  pointer-events: none;
}

.sd-cam-fov {
  opacity: 0;
  pointer-events: none;
}

.sd-cam-led {
  fill: rgba(255, 255, 255, 0.18);
}

.sd-lock {
  fill: #ff5c5c;
}

.sd-guest {
  opacity: 0;
}

.sd-away-ring {
  opacity: 0;
  pointer-events: none;
}

.sd-cam-preview {
  opacity: 0;
  pointer-events: none;
}

.sd-dim {
  opacity: 0;
  pointer-events: none;
}

.sd-zone-ring {
  fill: none;
  stroke: rgba(139, 124, 255, 0);
  stroke-width: 2;
  pointer-events: none;
}

.sd-spray {
  fill: none;
  stroke: rgba(77, 184, 255, 0);
  stroke-width: 1.4;
}

.sd-drop {
  fill: #6ec8ff;
  opacity: 0;
}

.sd-sprinkler {
  fill: #4db8ff;
  opacity: 0.55;
}

.sd-sprinkler-head {
  pointer-events: none;
}

@media (max-width: 900px) {
  body.smart-demo-body {
    overflow: auto;
  }

  .sd-app {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(320px, 50vh);
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .sd-back {
    top: 10px;
    left: 10px;
    font-size: 12px;
    padding: 8px 12px;
  }

  .sd-sidebar {
    order: 2;
    border-right: 0;
    border-top: 1px solid var(--sd-border);
    padding: 18px 14px 28px;
  }

  .sd-sidebar::before {
    display: none;
  }

  .sd-cats {
    overflow: visible;
  }

  .sd-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sd-main {
    order: 1;
    padding: 56px 12px 12px;
    min-height: 48vh;
  }

  .sd-info {
    margin-bottom: 10px;
    padding: 12px 14px;
  }

  .sd-stage {
    padding: 6px;
    border-radius: 14px;
  }

  .sd-stage::after {
    display: none;
  }
}

@media (max-width: 560px) {
  .sd-title {
    font-size: 20px;
  }

  .sd-cat summary {
    font-size: 13px;
    padding: 12px 14px;
  }

  .sd-action {
    font-size: 12px;
  }
}
