/* ==========================================================================
   DahuaNet — pages/home.css
   هیرو با لنز زنده، نوار اعتماد و کاشی‌های «محل نصب».
   ========================================================================== */

/* ---------- هیرو ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(40px, 7vw, 88px) clamp(28px, 4vw, 44px);
  background: var(--grad-night);
  color: var(--on-dark);
}
.hero h1 { color: var(--on-dark); font-size: var(--fs-4xl); line-height: 1.3; }
.hero .hl { background: linear-gradient(120deg, #bfe2ff 0%, var(--cyan) 45%, #ffffff 100%); -webkit-background-clip: text; background-clip: text; }
.hero p { color: var(--on-dark-muted); font-size: var(--fs-lg); max-width: 52ch; }

/* شبکه‌ی ظریف پس‌زمینه، فقط اطراف لنز */
.hero__grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(142, 193, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(142, 193, 255, .08) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 28% 45%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 70% at 28% 45%, #000 20%, transparent 75%);
}
/* خط اسکن که آرام از بالا به پایین می‌رود */
.hero__beam {
  position: absolute;
  inset-inline: 0;
  top: -140px;
  z-index: -1;
  height: 140px;
  background: linear-gradient(180deg, transparent, rgba(46, 139, 255, .08) 75%, rgba(142, 193, 255, .16) 99%, transparent);
  animation: dn-hero-beam 9s linear infinite;
  pointer-events: none;
}
@keyframes dn-hero-beam { to { transform: translateY(calc(100vh + 400px)); } }

.hero__inner {
  display: grid;
  align-items: center;
  gap: clamp(32px, 5vw, 64px);
}
@media (min-width: 960px) {
  .hero__inner { grid-template-columns: 1.05fr .95fr; }
}
.hero__copy { display: grid; justify-items: start; gap: 22px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.hero__trust { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--on-dark-muted); font-size: var(--fs-sm); }
.hero__trust li { display: inline-flex; align-items: center; gap: 6px; }
.hero__trust .icon { color: #4ade80; width: 1.1em; height: 1.1em; }

/* ---------- جای لنز در هیرو ---------- */
.hero__visual {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 460px);
  aspect-ratio: 1 / 1;
  margin-inline: auto;
}
/* کادر نمایشگر دوربین */
.hud {
  --c: rgba(142, 193, 255, .7);
  --l: 26px;
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) 1.5px,
    linear-gradient(var(--c), var(--c)) top left / 1.5px var(--l),
    linear-gradient(var(--c), var(--c)) top right / var(--l) 1.5px,
    linear-gradient(var(--c), var(--c)) top right / 1.5px var(--l),
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) 1.5px,
    linear-gradient(var(--c), var(--c)) bottom left / 1.5px var(--l),
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) 1.5px,
    linear-gradient(var(--c), var(--c)) bottom right / 1.5px var(--l);
  background-repeat: no-repeat;
}
.hud__rec, .hud__time {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
  color: var(--on-dark-muted);
  font-family: var(--font-code);
  font-size: var(--fs-2xs);
  letter-spacing: .08em;
}
.hud__rec { top: 14px; left: 16px; color: #ff8a8a; }
.hud__rec::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d4f;
  box-shadow: 0 0 10px #ff4d4f;
  animation: dn-pulse 1.4s ease-in-out infinite;
}
.hud__time { bottom: 14px; left: 16px; }

/* برچسب‌های شناور قابلیت‌ها */
.hero__tag {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 12px;
  border-radius: var(--r-pill);
  background: rgba(12, 42, 128, .62);
  color: var(--on-dark);
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--glass-line), 0 18px 36px -18px rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: translate .5s var(--ease);
}
.hero__tag > span { display: inline-flex; align-items: center; gap: 8px; animation: dn-float 6s ease-in-out infinite; }
.hero__tag .icon { color: var(--sky); }
.hero__tag--1 { top: 12%; right: -2%; }
.hero__tag--2 { bottom: 16%; left: -4%; }
.hero__tag--2 > span { animation-delay: -2s; }
.hero__tag--3 { bottom: 3%; right: 10%; }
.hero__tag--3 > span { animation-delay: -4s; }
@media (max-width: 520px) {
  .hero__tag { font-size: var(--fs-2xs); padding: 6px 10px; }
  .hero__tag--1 { right: 0; }
  .hero__tag--2 { left: 0; }
}

/* نوار آمار شیشه‌ای */
.hero__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(32px, 5vw, 56px);
  border-radius: var(--r-lg);
  background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--glass-line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.hero__stats .stat { padding: 18px 20px; text-align: center; }
.hero__stats .stat + .stat { border-inline-start: 1px solid var(--dark-line); }
.hero__stats .stat:nth-child(3) { border-inline-start: 0; }
.hero__stats .stat:nth-child(n + 3) { border-top: 1px solid var(--dark-line); }
.hero__stats .stat__value { color: var(--on-dark); font-size: var(--fs-2xl); }
.hero__stats .stat__label { color: var(--on-dark-muted); }
@media (min-width: 760px) {
  .hero__stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero__stats .stat:nth-child(3) { border-inline-start: 1px solid var(--dark-line); }
  .hero__stats .stat:nth-child(n + 3) { border-top: 0; }
}

/* ---------- نوار اعتماد زیر هیرو ---------- */
.trust-bar {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  padding-block: 26px;
}

/* ---------- کاشی‌های «محل نصب» ---------- */
.places {
  display: grid;
  gap: 12px;
  grid-auto-flow: column;
  grid-auto-columns: 128px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  padding-block: 4px 8px;
}
.places::-webkit-scrollbar { display: none; }
.places > * { scroll-snap-align: start; }
@media (min-width: 760px) {
  .places {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    overflow: visible;
  }
}
.place {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
  text-align: center;
  font-weight: 700;
  transition: transform var(--dur-3) var(--ease), border-color var(--dur-3), color var(--dur-3);
}
.place::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--grad-brand);
  clip-path: circle(0% at 50% 30%);
  transition: clip-path .6s var(--ease);
}
.place .icon { width: 34px; height: 34px; stroke-width: 1.4; color: var(--primary); transition: color var(--dur-3), transform var(--dur-3) var(--ease-spring); }
.place small { color: var(--fg-subtle); font-size: var(--fs-2xs); font-weight: 600; transition: color var(--dur-3); }
.place:hover { transform: translateY(-4px); border-color: transparent; color: #fff; }
.place:hover::after { clip-path: circle(150% at 50% 30%); }
.place:hover .icon { color: #fff; transform: scale(1.12); }
.place:hover small { color: rgba(255, 255, 255, .75); }

/* ---------- نوار متحرک دسته‌ها ---------- */
.trust__marquee { padding-block: 4px 26px; }
.trust__marquee .marquee__item { transition: color var(--dur-2); }
.trust__marquee .marquee__item:hover { color: var(--primary); }

/* ---------- بنرها ---------- */
.banners { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 700px) {
  .banners { grid-template-columns: repeat(2, 1fr); }
  .banners--1 { grid-template-columns: 1fr; }
  .banners--3 > :first-child { grid-row: span 2; }
  .banners--4 { grid-template-columns: 1.4fr 1fr 1fr; }
  .banners--4 > :first-child { grid-row: span 2; }
  .banners--4 > :last-child { grid-column: span 2; }
}
.banner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  min-height: 200px;
  padding: 22px;
  border-radius: var(--r-xl);
  background: var(--grad-night);
  color: #fff;
}
.banners--3 > :first-child, .banners--4 > :first-child { min-height: 340px; }
.banner__img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}
.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, rgba(7, 26, 82, .88) 0%, rgba(7, 26, 82, .25) 55%, transparent 80%);
}
.banner:hover .banner__img { transform: scale(1.06); }
/* بنر بدون عکس: حلقه‌های لنز به‌جای تصویر */
.banner::before {
  content: "";
  position: absolute;
  z-index: -2;
  width: 360px;
  height: 360px;
  inset-inline-end: -110px;
  top: -130px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 30px, rgba(142, 193, 255, .16) 30px 31px);
  transition: transform 1.2s var(--ease);
}
.banner:has(.banner__img)::before { display: none; }
.banner:hover::before { transform: rotate(25deg) scale(1.08); }
.banner__copy { display: grid; justify-items: start; gap: 6px; max-width: 46ch; }
.banner__title { font-size: var(--fs-xl); font-weight: 900; line-height: 1.4; }
.banner__text { color: var(--on-dark-muted); font-size: var(--fs-sm); }
.banner__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .14);
  font-size: var(--fs-xs);
  font-weight: 700;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background var(--dur-2), gap var(--dur-2);
}
.banner:hover .banner__cta { background: var(--accent); color: var(--on-accent); gap: 10px; }

/* ---------- نوار تخفیف (تیره) ---------- */
.sale {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: var(--section-y);
  background: var(--grad-night);
  color: var(--on-dark);
}
.sale::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 640px;
  height: 640px;
  inset-inline-start: -200px;
  bottom: -320px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 40px, rgba(142, 193, 255, .1) 40px 41px);
}
.sale h2 { color: #fff; }
.sale__head p { color: var(--on-dark-muted); }
.sale .p-card { border-color: transparent; }
.sale__more { margin-top: 24px; }

/* ---------- پکیج‌ها، مطالب ---------- */
.packages, .posts {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

/* ---------- برندها ---------- */
.brand-chip {
  display: grid;
  place-items: center;
  min-width: 140px;
  height: 72px;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
  color: var(--fg-muted);
  font-weight: 800;
  filter: grayscale(1);
  opacity: .75;
  transition: filter var(--dur-3), opacity var(--dur-3), border-color var(--dur-3);
}
.brand-chip img { max-height: 40px; width: auto; }
.brand-chip:hover { filter: none; opacity: 1; border-color: var(--sky-200); }
