:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --text: #1f2530;
  --muted: #6b7280;
  --border: #e6e8ec;
  --accent: #1d4ed8;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(20, 28, 46, 0.10);
  --maxw: 1100px;
  --sheet-blue: #1d4ed8;
  --sheet-lightblue: #e8f1fe;
  --sheet-gray: #eceef1;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: "Vazirmatn", "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ------------------------------ Header ------------------------------ */
.topbar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #22d3ee, var(--accent));
  display: grid; place-items: center; color: #fff; font-weight: 800;
}
.lang-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 7px 16px; border-radius: 999px; font: inherit; font-weight: 700;
  cursor: pointer; transition: border-color .15s, background .15s, color .15s;
}
.lang-btn:hover { border-color: var(--accent); color: var(--accent); }

.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--muted); }
.back-link::before { content: "‹"; font-size: 1.3em; line-height: 1; }

/* ------------------------------ Layout ------------------------------ */
main {
  flex: 1; width: 100%; max-width: var(--maxw);
  margin: 0 auto; padding: 30px 20px 60px;
}
/* Hero band */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  margin: 6px 0 36px;
  padding: 52px 28px;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(120% 140% at 85% -10%, rgba(255,255,255,.18), transparent 55%),
    linear-gradient(125deg, #0ea5b7 0%, #1d4ed8 55%, #4f46e5 100%);
  box-shadow: 0 16px 40px rgba(29, 78, 216, 0.28);
}
/* subtle molecular dot motif */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.16) 2px, transparent 2.5px);
  background-size: 26px 26px;
  opacity: .5;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent);
          mask-image: linear-gradient(180deg, #000, transparent);
}
.hero-content { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(1.8rem, 4.5vw, 2.7rem); margin: 0 0 10px; color: #fff; }
.hero p { margin: 0; font-size: 1.08rem; color: rgba(255,255,255,.9); }

/* ------------------------------ Home grid --------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 24px;
}
.card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex; flex-direction: column;
}
.card::before {
  content: ""; position: absolute; top: 0; inset-inline: 0; height: 4px;
  background: var(--accent); z-index: 1;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 14px 34px rgba(20, 28, 46, 0.16); }
.card-media {
  aspect-ratio: 4 / 3; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #ffffff, #eef2f8);
  border-bottom: 1px solid var(--border);
}
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.card-title { margin: 0; font-size: 1.2rem; }
.card-tagline { margin: 0; color: var(--muted); font-size: .95rem; flex: 1; }
.card-cta {
  margin-top: 12px; color: var(--accent); font-weight: 800;
  display: inline-flex; align-items: center; gap: 8px;
}
.card-badge {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent); border-radius: 999px; padding: 1px 9px;
  font-size: .78rem; font-weight: 700;
}
.card-cta .arrow { transition: transform .18s; }
[dir="rtl"] .card-cta .arrow { transform: scaleX(-1); }
.card:hover .card-cta .arrow { transform: translateX(4px); }
[dir="rtl"] .card:hover .card-cta .arrow { transform: scaleX(-1) translateX(4px); }

.placeholder {
  width: 100%; height: 100%; display: grid; place-items: center;
  color: #fff; font-size: 3rem; font-weight: 800; min-height: 180px;
}

/* ------------------------- Datasheet reader ------------------------- */
.reader { display: flex; flex-direction: column; gap: 30px; max-width: 780px; margin: 0 auto; }

.sheet {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Header */
.sheet-head { padding: 22px 26px 0; }
.sheet-logo { height: 40px; width: auto; }
.sheet-band {
  margin: 16px -26px 0;
  padding: 18px 26px;
  background: linear-gradient(90deg, var(--sheet-gray), #f6f7f9);
}
.sheet-title {
  margin: 0; font-size: clamp(1.5rem, 4.5vw, 2.1rem); font-weight: 800;
  line-height: 1.25; color: #1a2230;
}
.sheet-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 1.02rem; }

/* Body: features + photo */
.sheet-body {
  display: flex; gap: 18px; align-items: stretch;
  padding: 22px 26px 6px;
}
.sheet-features { flex: 1.15; min-width: 0; }
.sheet-h {
  position: relative; margin: 0 0 12px; padding-inline-start: 13px;
  font-size: 1.2rem; font-weight: 800; color: var(--accent);
}
.sheet-h::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .18em; bottom: .18em;
  width: 5px; border-radius: 3px; background: var(--accent);
}
.bullets { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.bullets li { position: relative; padding-inline-start: 18px; font-size: .96rem; }
.bullets li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .62em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.sheet-photo {
  flex: 1; position: relative; min-width: 0;
  display: flex; align-items: center; justify-content: center;
}
.sheet-photo img { max-height: 280px; width: auto; object-fit: contain; cursor: zoom-in; }

/* Warranty seal */
.seal {
  position: absolute; inset-inline-end: 4px; bottom: 0;
  width: 78px; height: 78px; border-radius: 50%;
  background: #d11f2a; color: #fff;
  display: grid; place-content: center; text-align: center;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #d11f2a, 0 4px 10px rgba(0,0,0,.25);
  transform: rotate(-12deg);
}
.seal-top { font-size: .72rem; font-weight: 700; line-height: 1; }
.seal-bottom { font-size: .82rem; font-weight: 800; line-height: 1.15; margin-top: 2px; }

/* Applications band */
.sheet-apps {
  background: var(--sheet-lightblue);
  padding: 20px 26px;
}
.apps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.apps-list li { position: relative; padding-inline-start: 18px; font-size: 1.05rem; font-weight: 500; }
.apps-list li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .68em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}

/* Specs / benefits */
.sheet-specs, .sheet-benefits { padding: 22px 26px; }
.spec-scroll { overflow-x: auto; }
.spec-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.spec-table th, .spec-table td { padding: 9px 10px; text-align: center; white-space: nowrap; }
.spec-table thead th {
  color: var(--accent); font-weight: 800; border-bottom: 2px solid var(--accent);
}
.spec-table tbody td { border-bottom: 1px solid var(--border); }
.spec-table tbody tr:last-child td { border-bottom: 0; }
.spec-table tbody td:first-child { font-weight: 700; }

/* Banner + footer bar */
.sheet-banner {
  background: #f1f5fb; color: #334155; text-align: center;
  padding: 12px 20px; font-size: .92rem;
}
.sheet-foot {
  background: var(--sheet-blue); text-align: center; padding: 12px;
}
.sheet-foot a { color: #fff; font-weight: 700; letter-spacing: .3px; }

/* ----------------------------- Lightbox ----------------------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center;
  background: rgba(8, 12, 22, 0.88); padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox-img { max-width: 96vw; max-height: 90vh; border-radius: 8px; }
.lightbox-close {
  position: absolute; top: 16px; inset-inline-end: 20px;
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.15); color: #fff; font-size: 1.7rem;
  cursor: pointer; line-height: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,.28); }

/* ----------------------------- Empty state -------------------------- */
.empty-state { text-align: center; padding: 80px 20px; }
.btn {
  display: inline-block; margin-top: 16px; background: var(--accent);
  color: #fff; padding: 12px 24px; border-radius: 999px; font-weight: 700;
}

/* ------------------------------ Footer ------------------------------ */
.footer {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-align: center; color: var(--muted); padding: 26px 20px;
  border-top: 1px solid var(--border); background: var(--surface);
}
.footer-company { color: var(--text); font-size: 1rem; }
.footer-sub { font-size: .88rem; }
.footer-link { color: var(--accent); font-weight: 700; margin-top: 2px; }
.footer-copy { font-size: .8rem; margin-top: 4px; }

/* ----------------------------- Responsive --------------------------- */
@media (max-width: 720px) {
  main { padding: 22px 14px 48px; }
  .reader { gap: 22px; }
  .sheet-body { flex-direction: column; }
  .sheet-photo img { max-height: 240px; }
  .sheet-head, .sheet-apps, .sheet-specs, .sheet-benefits { padding-left: 18px; padding-right: 18px; }
  .sheet-band { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; }
}

/* ------------------------------ Dark mode --------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1320; --surface: #161b29; --text: #e7eaf2; --muted: #9aa3b8;
    --border: #28304a; --shadow: 0 6px 26px rgba(0, 0, 0, 0.4);
    --sheet-gray: #1f2740; --sheet-lightblue: #16243f;
  }
  .card-media { background: radial-gradient(circle at 50% 40%, #1c2335, #141a28); }
  .sheet-title { color: #eef1f8; }
  .sheet-banner { background: #131a2b; color: #b9c2d6; }
}
