/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #1e293b;
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== LAYOUT ===== */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ===== NAV ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid #e2e8f0;
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.nav__logo { font-weight: 700; font-size: 22px; letter-spacing: -.03em; color: #0f172a; }
.nav__links { display: flex; gap: 32px; }
.nav__links a {
  font-size: 15px; font-weight: 500; color: #64748b;
  transition: color .2s;
}
.nav__links a:hover { color: #0f172a; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; font-size: 15px; font-weight: 600;
  padding: 14px 32px; border-radius: 12px; cursor: pointer;
  transition: all .2s; border: none; line-height: 1;
}
.btn--primary {
  background: #4f46e5;
  color: #fff;
  box-shadow: 0 1px 3px rgba(79,70,229,.3), 0 4px 16px rgba(79,70,229,.15);
}
.btn--primary:hover {
  background: #4338ca;
  box-shadow: 0 2px 6px rgba(79,70,229,.35), 0 8px 24px rgba(79,70,229,.2);
  transform: translateY(-1px);
}
.btn--outline {
  background: #fff;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.btn--outline:hover { color: #0f172a; border-color: #94a3b8; background: #f8fafc; }
.btn--large { padding: 18px 40px; font-size: 17px; border-radius: 14px; }

/* ===== TAGS ===== */
.tag {
  display: inline-block; font-size: 14px; font-weight: 600;
  padding: 8px 20px; border-radius: 24px;
}
.tag--blue   { background: #eff6ff; color: #2563eb; }
.tag--purple { background: #f5f3ff; color: #7c3aed; }
.tag--orange { background: #fff7ed; color: #ea580c; }
.tag--green  { background: #f0fdf4; color: #16a34a; }
.tag--red    { background: #fef2f2; color: #dc2626; }
.tag--pink   { background: #fdf2f8; color: #db2777; }

/* ===== HERO ===== */
.hero {
  padding: 160px 0 120px;
  background: linear-gradient(180deg, #f8faff 0%, #fff 100%);
}
.hero__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.hero__text h1 {
  font-size: clamp(40px, 5vw, 60px); font-weight: 800;
  line-height: 1.08; letter-spacing: -.035em; color: #0f172a;
}
.hero__sub {
  margin-top: 24px; font-size: 19px; color: #64748b;
  max-width: 520px; line-height: 1.7;
}
.hero__actions { margin-top: 40px; display: flex; gap: 16px; flex-wrap: wrap; }

.hero__card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 24px; padding: 56px 48px;
  display: flex; flex-direction: column; align-items: center; gap: 32px;
  box-shadow: 0 4px 32px rgba(15,23,42,.06);
}
.hero__protocols-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 32px;
  width: 100%;
}
.proto { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.proto__icon {
  width: 80px; height: 80px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s;
}
.proto__icon:hover { transform: scale(1.08); }
.proto__icon--zigbee  { background: #fef2f2; color: #EB0443; }
.proto__icon--matter  { background: #f5f3ff; color: #7c3aed; }
.proto__icon--homekit { background: #fff7ed; color: #ea580c; }
.proto__icon--mqtt    { background: #f5f0ff; color: #660066; }
.proto__icon--rf      { background: #eff6ff; color: #2563eb; }
.proto__icon--ir      { background: #fdf2f8; color: #db2777; }
.proto__label { font-size: 13px; font-weight: 600; color: #64748b; }

/* ===== SECTION TITLES ===== */
.section__title {
  font-size: clamp(32px, 4vw, 44px); font-weight: 800;
  letter-spacing: -.03em; color: #0f172a; text-align: center;
}
.section__sub {
  text-align: center; color: #64748b; font-size: 18px;
  margin-top: 16px; max-width: 580px; margin-left: auto; margin-right: auto;
  line-height: 1.7;
}

/* ===== FEATURES ===== */
.features { padding: 120px 0; }
.features__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
  margin-top: 64px;
}
.feature-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px; padding: 40px 36px;
  transition: box-shadow .3s, transform .3s;
}
.feature-card:hover {
  box-shadow: 0 8px 40px rgba(15,23,42,.08);
  transform: translateY(-2px);
}
.feature-card__icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
}
.feature-card__icon--blue   { background: #eff6ff; color: #2563eb; }
.feature-card__icon--purple { background: #f5f3ff; color: #7c3aed; }
.feature-card__icon--orange { background: #fff7ed; color: #ea580c; }
.feature-card__icon--green  { background: #f0fdf4; color: #16a34a; }
.feature-card__icon--red    { background: #fef2f2; color: #dc2626; }
.feature-card__icon--pink   { background: #fdf2f8; color: #db2777; }
.feature-card__icon--mqtt   { background: #f5f0ff; color: #660066; }
.feature-card h3 { font-size: 20px; font-weight: 700; color: #0f172a; margin-bottom: 10px; }
.feature-card p { font-size: 15px; color: #64748b; line-height: 1.7; }

/* ===== USE CASES ===== */
.usecases { padding: 120px 0; }
.usecases__grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px;
  margin-top: 64px;
}
.usecase-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px; padding: 40px 36px;
  transition: box-shadow .3s, transform .3s;
}
.usecase-card:hover {
  box-shadow: 0 8px 40px rgba(15,23,42,.08);
  transform: translateY(-2px);
}
.usecase-card__emoji {
  font-size: 40px; margin-bottom: 20px; line-height: 1;
}
.usecase-card h3 { font-size: 20px; font-weight: 700; color: #0f172a; margin-bottom: 10px; }
.usecase-card p { font-size: 15px; color: #64748b; line-height: 1.7; }

/* ===== BENEFITS ===== */
.benefits { padding: 120px 0; background: #f8fafc; }
.benefits__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
  margin-top: 64px;
}
.benefit-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px; padding: 40px 36px;
  transition: box-shadow .3s, transform .3s;
}
.benefit-card:hover {
  box-shadow: 0 8px 40px rgba(15,23,42,.08);
  transform: translateY(-2px);
}
.benefit-card__icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
  background: #f0fdf4; color: #16a34a;
}
.benefit-card h3 { font-size: 20px; font-weight: 700; color: #0f172a; margin-bottom: 10px; }
.benefit-card p { font-size: 15px; color: #64748b; line-height: 1.7; }

/* ===== FLASH ===== */
.flash-section {
  padding: 120px 0;
  background: #f8fafc;
}
.flash-card {
  margin-top: 56px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 24px; padding: 56px;
  max-width: 680px; margin-left: auto; margin-right: auto;
  box-shadow: 0 4px 32px rgba(15,23,42,.05);
}
.flash-card__steps { display: flex; flex-direction: column; gap: 24px; margin-bottom: 44px; }
.step {
  display: flex; align-items: center; gap: 20px;
  font-size: 16px; color: #334155;
}
.step__num {
  flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 50%;
  background: #4f46e5;
  color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.flash-card__action { text-align: center; }
.flash-card__note { margin-top: 20px; font-size: 13px; color: #94a3b8; }
.flash-unsupported {
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 12px; padding: 20px; font-size: 14px; color: #b91c1c;
}

/* ===== CUSTOM FLASHER ===== */
.flash-state { text-align: center; }
.flash-info { font-size: 17px; color: #334155; margin-bottom: 8px; }
.flash-info strong { color: #0f172a; }
.flash-warn { font-size: 15px; color: #dc2626; margin-bottom: 28px; }
.flash-sub { font-size: 15px; color: #64748b; margin-top: 12px; line-height: 1.7; }
.flash-sub a { color: #4f46e5; text-decoration: underline; }
.flash-btns { display: flex; gap: 12px; justify-content: center; }
.flash-done-icon { margin-bottom: 20px; }
.flash-status { font-size: 16px; color: #334155; margin-bottom: 20px; }
.flash-progress-bar {
  width: 100%; height: 10px; border-radius: 5px;
  background: #e2e8f0; overflow: hidden;
}
.flash-progress-fill {
  height: 100%; border-radius: 5px; width: 0%;
  background: linear-gradient(90deg, #4f46e5, #6366f1);
  transition: width .3s ease;
}
.flash-percent { font-size: 14px; color: #94a3b8; margin-top: 10px; }

/* ===== DEVICE STATUS ===== */
.device-status { padding: 0 0 0; margin-top: -60px; position: relative; z-index: 2; }
.device-status__card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px; padding: 32px 40px;
  box-shadow: 0 2px 16px rgba(15,23,42,.04);
  max-width: 680px; margin: 0 auto;
}
.device-status__state {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.device-status__text { flex: 1; min-width: 200px; }
.device-status__title { font-size: 18px; font-weight: 700; color: #0f172a; }
.device-status__sub { font-size: 14px; color: #64748b; margin-top: 4px; }
.ds-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ds-icon--online { background: #f0fdf4; color: #16a34a; }
.ds-icon--offline { background: #fef2f2; color: #dc2626; }
.ds-spinner {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  border: 4px solid #e2e8f0; border-top-color: #4f46e5;
  animation: ds-spin 0.8s linear infinite;
}
@keyframes ds-spin { to { transform: rotate(360deg); } }

/* ===== QUICK START ===== */
.quickstart { padding: 120px 0; }
.quickstart__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
  margin-top: 64px;
}
.quickstart__card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px; padding: 40px 36px;
  box-shadow: 0 2px 16px rgba(15,23,42,.04);
}
.quickstart__num {
  width: 48px; height: 48px; border-radius: 14px;
  background: #4f46e5;
  color: #fff; font-size: 20px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
}
.quickstart__card h3 {
  font-size: 20px; font-weight: 700; color: #0f172a; margin-bottom: 12px;
}
.quickstart__card p {
  font-size: 15px; color: #64748b; line-height: 1.7;
}
.quickstart__card strong { color: #0f172a; }
.quickstart__card a { color: #4f46e5; text-decoration: underline; }

/* ===== COMMUNITY ===== */
.community {
  padding: 120px 0;
  background: #f8fafc;
}
.community__inner {
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.community__btn { margin-top: 40px; }

/* ===== FOOTER ===== */
.footer {
  padding: 40px 0;
  border-top: 1px solid #e2e8f0;
}
.footer__inner { display: flex; align-items: center; justify-content: space-between; }
.footer__logo { font-weight: 700; font-size: 16px; color: #94a3b8; }
.footer__copy { font-size: 13px; color: #cbd5e1; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  /* Nav */
  .nav__links { gap: 12px; }
  .nav__links a { font-size: 12px; }
  .nav__inner { height: 56px; }
  .nav__logo { font-size: 18px; }

  /* Hero */
  .hero { padding: 100px 0 72px; }
  .hero__inner { grid-template-columns: 1fr; text-align: center; gap: 40px; }
  .hero__text h1 { font-size: 32px; }
  .hero__sub { margin-left: auto; margin-right: auto; font-size: 16px; }
  .hero__actions { justify-content: center; }
  .hero__actions .btn--large { padding: 14px 28px; font-size: 15px; }
  .hero__visual { display: none; }

  /* Section titles */
  .section__title { font-size: 26px; }
  .section__sub { font-size: 15px; margin-top: 12px; }

  /* Sections spacing */
  .features, .usecases, .benefits, .quickstart, .community { padding: 72px 0; }
  .flash-section { padding: 72px 0; }

  /* Grids */
  .features__grid { grid-template-columns: 1fr; gap: 16px; margin-top: 40px; }
  .usecases__grid { grid-template-columns: 1fr; gap: 16px; margin-top: 40px; }
  .benefits__grid { grid-template-columns: 1fr; gap: 16px; margin-top: 40px; }
  .quickstart__grid { grid-template-columns: 1fr; gap: 16px; margin-top: 40px; }

  /* Cards compact */
  .feature-card { padding: 24px 20px; border-radius: 16px; }
  .feature-card__icon { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 16px; }
  .feature-card h3 { font-size: 17px; margin-bottom: 6px; }
  .feature-card p { font-size: 14px; }

  .usecase-card { padding: 24px 20px; border-radius: 16px; }
  .usecase-card__emoji { font-size: 32px; margin-bottom: 12px; }
  .usecase-card h3 { font-size: 17px; margin-bottom: 6px; }
  .usecase-card p { font-size: 14px; }

  .benefit-card { padding: 24px 20px; border-radius: 16px; }
  .benefit-card__icon { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 16px; }
  .benefit-card h3 { font-size: 17px; margin-bottom: 6px; }
  .benefit-card p { font-size: 14px; }

  .quickstart__card { padding: 24px 20px; border-radius: 16px; }
  .quickstart__num { width: 40px; height: 40px; font-size: 17px; border-radius: 12px; margin-bottom: 16px; }
  .quickstart__card h3 { font-size: 17px; margin-bottom: 8px; }
  .quickstart__card p { font-size: 14px; }

  /* Device status */
  .device-status { margin-top: -36px; }
  .device-status__card { padding: 24px 20px; border-radius: 16px; }
  .device-status__state { gap: 14px; }
  .device-status__title { font-size: 16px; }
  .device-status__sub { font-size: 13px; }
  .ds-icon { width: 40px; height: 40px; }
  .ds-spinner { width: 32px; height: 32px; }
  .device-status__state .btn { width: 100%; margin-top: 8px; }

  /* Flash */
  .flash-card { padding: 28px 20px; border-radius: 16px; margin-top: 40px; }
  .flash-card__steps { gap: 16px; margin-bottom: 32px; }
  .step { font-size: 14px; gap: 14px; }
  .step__num { width: 30px; height: 30px; font-size: 13px; }
  .btn--large { padding: 14px 28px; font-size: 15px; border-radius: 12px; }

  /* Community */
  .community__btn .btn { padding: 14px 28px; font-size: 15px; }

  /* Footer */
  .footer__inner { flex-direction: column; gap: 8px; text-align: center; }
}
