.tpl-mobile-nav,
.tpl-mobile-nav * {
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
}

img,
video {
  max-width: 100%;
  height: auto;
}

.demo-label {
  display: inline-block;
  margin: 12px 0 20px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.7;
}

.tpl-mobile-nav {
  position: sticky;
  top: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(9, 9, 18, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(164, 155, 255, 0.18);
}

.tpl-mobile-nav__toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(164, 155, 255, 0.24);
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.tpl-mobile-nav__toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #f4f4ff;
  border-radius: 999px;
  position: relative;
}

.tpl-mobile-nav__toggle span::before,
.tpl-mobile-nav__toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: #f4f4ff;
  border-radius: 999px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.tpl-mobile-nav__toggle span::before {
  top: -6px;
}

.tpl-mobile-nav__toggle span::after {
  top: 6px;
}

.tpl-mobile-nav.is-open .tpl-mobile-nav__toggle span {
  background: transparent;
}

.tpl-mobile-nav.is-open .tpl-mobile-nav__toggle span::before {
  transform: translateY(6px) rotate(45deg);
}

.tpl-mobile-nav.is-open .tpl-mobile-nav__toggle span::after {
  transform: translateY(-6px) rotate(-45deg);
}

.tpl-mobile-nav__toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(164, 155, 255, 0.35);
}

.tpl-mobile-nav__toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(164, 155, 255, 0.35);
}

.tpl-mobile-nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  position: relative;
  z-index: 1002;
  pointer-events: auto;
  color: inherit;
  text-decoration: none;
}

.tpl-mobile-nav__badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(164, 155, 255, 0.14);
  border: 1px solid rgba(164, 155, 255, 0.35);
  color: #f4f4ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 0 20px rgba(164, 155, 255, 0.35);
  flex-shrink: 0;
}

.tpl-mobile-nav__titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tpl-mobile-nav__label {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: #c0c0d0;
  text-transform: uppercase;
  white-space: nowrap;
}

.tpl-mobile-nav__template {
  font-size: 0.95rem;
  color: #f4f4ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tpl-mobile-nav__menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: rgba(9, 9, 18, 0.96);
  border-bottom: 1px solid rgba(164, 155, 255, 0.14);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
  display: none;
  flex-direction: column;
  z-index: 1000;
  pointer-events: none;
}

.tpl-mobile-nav__menu[hidden] {
  display: none !important;
}

.tpl-mobile-nav.is-open .tpl-mobile-nav__menu {
  display: flex;
  pointer-events: auto;
}

.tpl-mobile-nav__link {
  padding: 14px 16px;
  color: #f4f4ff;
  text-decoration: none;
  font-size: 0.98rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.12s ease, color 0.12s ease;
}

.tpl-mobile-nav__link:last-child {
  border-bottom: none;
}

.tpl-mobile-nav__link:hover {
  background: rgba(255, 255, 255, 0.05);
}

.tpl-mobile-nav__link:focus-visible {
  outline: none;
  background: rgba(164, 155, 255, 0.12);
}

body.tpl-mobile-menu-open {
  overflow: hidden;
}

@media (min-width: 769px) {
  .tpl-mobile-nav {
    display: none;
  }
}

@media (max-width: 768px) {
  .tpl-mobile-nav__link {
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  button,
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-template-primary,
  .btn-template-secondary,
  .nav-cta,
  .nav-cta-btn,
  .nav-cta-link {
    min-height: 44px;
  }

  .tpl-desktop-nav {
    display: none !important;
  }
}

/* Narrow desktop / split-screen adjustments (700px–1100px) */
@media (max-width: 1100px) and (min-width: 701px) {
  .hero,
  .banner-hero {
    padding: 20px 18px 24px;
  }

  .hero h1,
  .hero .hero-title,
  .banner-hero h1 {
    font-size: clamp(2rem, 3vw, 2.4rem);
    line-height: 1.1;
  }

  .hero .hero-subtitle,
  .hero .hero-lead,
  .banner-hero .section-subtitle {
    margin-bottom: 12px;
    line-height: 1.45;
  }

  .hero .hero-actions,
  .banner-hero .hero-actions {
    gap: 10px;
    flex-wrap: wrap;
  }

  .hero .btn,
  .banner-hero .btn {
    padding: 11px 14px;
  }

  /* Slightly stronger scrim for readability */
  .hero::before,
  .banner-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(150deg, rgba(6, 7, 16, 0.5), rgba(10, 12, 20, 0.28), rgba(12, 14, 22, 0.14));
    pointer-events: none;
    z-index: 1;
  }

  .hero *,
  .banner-hero * {
    position: relative;
    z-index: 2;
  }
}

/* Mobile hero polish for template demos (keeps desktop/tablet unchanged) */
@media (max-width: 600px) {
  .hero,
  .banner-hero {
    position: relative;
    padding: 18px 14px 22px;
  }

  .hero::before,
  .banner-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(170deg, rgba(6, 7, 16, 0.55), rgba(10, 12, 20, 0.32), rgba(12, 14, 22, 0.18));
    pointer-events: none;
    z-index: 1;
  }

  .hero *,
  .banner-hero * {
    position: relative;
    z-index: 2;
  }

  .hero h1,
  .hero .hero-title,
  .banner-hero h1 {
    font-size: clamp(1.8rem, 6vw, 2.3rem);
    line-height: 1.15;
  }

  .hero .hero-lead,
  .hero .hero-subtitle,
  .banner-hero .section-subtitle {
    line-height: 1.4;
    margin-bottom: 10px;
  }

  .hero .hero-actions,
  .banner-hero .hero-actions {
    gap: 10px;
    flex-wrap: wrap;
  }

  .hero .btn,
  .banner-hero .btn {
    padding: 10px 14px;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .tpl-mobile-nav {
    gap: 10px;
    padding: 9px 10px;
  }

  .tpl-mobile-nav__brand {
    gap: 8px;
    min-width: 0;
  }

  .tpl-mobile-nav__label {
    font-size: 0.58rem;
    letter-spacing: 0.1em;
  }

  .tpl-mobile-nav__template {
    font-size: 0.86rem;
    max-width: 58vw;
  }

  .hero .hero-actions,
  .banner-hero .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero .hero-actions .btn,
  .banner-hero .hero-actions .btn,
  .hero .hero-actions a,
  .banner-hero .hero-actions a {
    width: 100%;
    justify-content: center;
  }
}
