:root {
  font-family: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
  --bg: #04060c;
  --card: #0b101d;
  --accent: #47e5ff;
  --accent-2: #786bff;
  --muted: #95a2c5;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f2f5ff;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, #0f1729, var(--bg));
  color: var(--text);
  padding-bottom: 120px;
}

.stars {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, rgba(71, 229, 255, 0.25), transparent 60%),
    url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='15' cy='15' r='1' fill='%23ffffff22'/%3E%3Ccircle cx='120' cy='40' r='1' fill='%23ffffff11'/%3E%3Ccircle cx='90' cy='140' r='1' fill='%23ffffff11'/%3E%3Ccircle cx='30' cy='100' r='1' fill='%23ffffff22'/%3E%3C/svg%3E")
      repeat;
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

main,
header,
footer {
  position: relative;
  z-index: 1;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px clamp(24px, 6vw, 80px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(130deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-weight: 600;
  color: #041221;
}

.logo-title {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.logo-tagline {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

nav a.github {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.lang-switcher {
  position: relative;
}

.lang-switcher button {
  border: 1px solid var(--line);
  background: rgba(7, 10, 18, 0.8);
  border-radius: 999px;
  color: var(--text);
  padding: 8px 18px;
  font-family: inherit;
  cursor: pointer;
}

.lang-switcher ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 8px 0;
  position: absolute;
  right: 0;
  min-width: 200px;
  background: rgba(7, 10, 18, 0.95);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(3, 6, 15, 0.55);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 3;
}

.lang-switcher.open ul {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.lang-switcher ul li {
  padding: 10px 16px;
  cursor: pointer;
  color: var(--muted);
}

.lang-switcher ul li:hover,
.lang-switcher ul li.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 48px;
  padding: clamp(24px, 8vw, 96px);
}

.hero-text h1 {
  font-size: clamp(2.4rem, 4vw, 3.5rem);
  margin: 16px 0;
}

.hero-text p {
  color: var(--muted);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.btn {
  border-radius: 999px;
  padding: 14px 28px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #03060f;
  box-shadow: 0 10px 30px rgba(71, 229, 255, 0.25);
}

.btn.ghost {
  border-color: var(--line);
  color: var(--text);
}

.btn:hover {
  transform: translateY(-2px);
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.hero-meta div {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  color: var(--muted);
}

.hero-meta span {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
}

.radar {
  width: min(320px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  border: 1px solid var(--line);
  background: radial-gradient(circle, rgba(71, 229, 255, 0.05), transparent);
}

.ring {
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ring-2 {
  inset: 30%;
}

.ring-3 {
  inset: 45%;
}

.needle {
  position: absolute;
  width: 2px;
  height: 45%;
  top: 5%;
  left: 50%;
  transform-origin: bottom center;
  background: linear-gradient(180deg, var(--accent), transparent);
}

.device-card {
  position: absolute;
  bottom: -20px;
  right: -20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  width: 220px;
  box-shadow: 0 12px 30px rgba(3, 6, 15, 0.5);
}

.device-label {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.device-value {
  margin: 6px 0 12px;
  font-weight: 600;
}

.wave-preview {
  display: grid;
  grid-template-columns: repeat(36, minmax(0, 1fr));
  gap: 2px;
  height: 60px;
  align-items: end;
}

.wave-preview span {
  width: 100%;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--accent), rgba(71, 229, 255, 0));
  transform-origin: center bottom;
}

.section {
  padding: clamp(24px, 8vw, 96px);
}

.section-heading h2 {
  margin: 12px 0 16px;
  font-size: clamp(2rem, 3vw, 2.6rem);
}

.section-heading p {
  color: var(--muted);
  max-width: 640px;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.features .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.features article {
  border-radius: 20px;
  padding: 24px;
  background: rgba(11, 16, 29, 0.8);
  border: 1px solid var(--line);
  min-height: 200px;
}

.features article h3 {
  margin-top: 0;
}

.stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.stack-card {
  background: rgba(8, 12, 22, 0.9);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
}

.stack-card ul {
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.6;
}

.stack-card pre {
  background: rgba(2, 4, 9, 0.9);
  border-radius: 16px;
  padding: 16px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #8ff8ff;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.timeline div {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}

.timeline span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.gallery .card {
  border-radius: 20px;
  border: 1px solid var(--line);
  padding: 24px;
  min-height: 160px;
  background: rgba(4, 6, 12, 0.85);
}

.cta-card {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(24px, 5vw, 48px);
  background: linear-gradient(120deg, rgba(71, 229, 255, 0.1), rgba(120, 107, 255, 0.1));
}

.cta-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

footer {
  padding: 32px clamp(24px, 6vw, 96px);
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 16px;
}

footer a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 16px;
}

html[dir="rtl"] body {
  direction: rtl;
}

html[dir="rtl"] .site-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

html[dir="rtl"] nav {
  flex-wrap: wrap;
  justify-content: flex-start;
}

html[dir="rtl"] .header-actions {
  width: 100%;
  justify-content: space-between;
}

html[dir="rtl"] .hero-meta div,
html[dir="rtl"] .section-heading p,
html[dir="rtl"] p {
  text-align: start;
}

@media (max-width: 640px) {
  nav {
    display: none;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .hero {
    padding-top: 0;
  }
  .device-card {
    position: relative;
    bottom: auto;
    right: auto;
    margin-top: 24px;
  }
}
