:root {
  --bg: #ffffff;
  --bg-muted: #f2f2f7;
  --text-primary: #1c1c1e;
  --text-secondary: #3a3a3c;
  --text-muted: #8e8e93;
  --card-bg: #ffffff;
  --card-border: #e5e5ea;
  --accent: #007aff;
  --accent-dark: #1c1c1e;
  --max-width: 720px;
  --illus-blue: #d6e9ff;
  --illus-teal: #cce8ee;
  --illus-sand: #fff0d6;
  --illus-lavender: #e8deff;
  --illus-mint: #d4f5e4;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.75;
}

body.signal-page {
  background: var(--bg-muted);
}

body.rtl {
  direction: rtl;
  text-align: right;
}

body.ltr {
  direction: ltr;
  text-align: left;
}

.shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.page-stack {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.stack-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack-heading {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: var(--bg);
  object-fit: contain;
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.brand p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* —— Site header + drawer menu —— */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.site-brand-name {
  font-size: 1.25rem;
  font-weight: 800;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card-bg);
  cursor: pointer;
  transition: background 0.2s ease;
}

.menu-toggle:hover {
  background: var(--bg-muted);
}

.menu-toggle-bar {
  display: block;
  width: 100%;
  height: 2.5px;
  border-radius: 2px;
  background: var(--text-primary);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 90;
}

.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.site-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(300px, 88vw);
  height: 100vh;
  padding: 24px 20px 32px;
  background: var(--card-bg);
  border-inline-start: 1px solid var(--card-border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  z-index: 100;
  overflow-y: auto;
}

.site-drawer.open {
  transform: translateX(0);
}

body.drawer-open {
  overflow: hidden;
}

.drawer-heading {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.drawer-link {
  display: block;
  padding: 12px 14px;
  margin-bottom: 4px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s ease;
}

.drawer-link:hover {
  background: var(--bg-muted);
}

.drawer-link.active {
  background: var(--accent-dark);
  color: #fff;
  font-weight: 600;
}

.drawer-divider {
  height: 1px;
  margin: 14px 0;
  background: var(--card-border);
  border: none;
}

.page-title-block {
  margin-bottom: 20px;
}

.page-title-block h1 {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 800;
  color: var(--text-primary);
}

.features-intro {
  text-align: center;
  padding: 4px 4px 8px;
  margin-bottom: 8px;
}

.features-intro h2 {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 5vw, 2.1rem);
  font-weight: 800;
  line-height: 1.25;
}

.features-intro p {
  margin: 0 auto;
  max-width: 36em;
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* —— About developer page —— */
.about-page {
  text-align: center;
  padding: 8px 0 16px;
}

.about-photo-wrap {
  display: inline-flex;
  padding: 5px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007aff 0%, #34c759 100%);
  box-shadow: 0 8px 28px rgba(0, 122, 255, 0.22);
}

.about-photo {
  display: block;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 4px solid var(--card-bg);
  background: var(--bg-muted);
}

.about-name {
  margin: 0 0 6px;
  font-size: clamp(1.45rem, 4vw, 1.75rem);
  font-weight: 800;
  color: var(--text-primary);
}

.about-role {
  margin: 0 0 24px;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

.about-card {
  text-align: right;
  max-width: 100%;
}

.about-card p {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.8;
}

.about-card p:last-child {
  margin-bottom: 0;
}

.about-contact {
  padding-top: 4px;
  border-top: 1px solid var(--card-border);
  margin-top: 8px !important;
}

/* —— Standalone document pages —— */
.doc-page .page-title-block {
  margin-bottom: 8px;
}

.breadcrumb {
  margin: 0 0 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span[aria-hidden="true"] {
  margin: 0 6px;
  opacity: 0.5;
}

.doc-page-banner {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg-muted);
  border: 1px solid var(--card-border);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.page-privacy .doc-page-banner { border-inline-start: 4px solid #007aff; }
.page-terms .doc-page-banner { border-inline-start: 4px solid #5856d6; }
.page-encryption .doc-page-banner { border-inline-start: 4px solid #34c759; }
.page-faq .doc-page-banner { border-inline-start: 4px solid #ff9500; }
.page-about .doc-page-banner { border-inline-start: 4px solid #af52de; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.nav a,
.btn-link {
  color: var(--text-primary);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--bg-muted);
  font-size: 0.88rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nav a:hover,
.btn-link:hover {
  background: #ececef;
  border-color: #d1d1d6;
}

.nav a.active {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #ffffff;
  font-weight: 600;
}

/* —— Signal-style homepage showcase —— */
.signal-hero {
  text-align: center;
  padding: 8px 4px 24px;
}

.signal-hero h2 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary);
}

.signal-hero p {
  margin: 0 auto;
  max-width: 36em;
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.signal-showcase {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.signal-feature-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.signal-feature-illus {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 24px 20px;
}

.signal-feature-illus svg {
  width: 100%;
  max-width: 300px;
  height: auto;
}

.signal-feature-illus.illus-blue { background: var(--illus-blue); }
.signal-feature-illus.illus-teal { background: var(--illus-teal); }
.signal-feature-illus.illus-sand { background: var(--illus-sand); }
.signal-feature-illus.illus-lavender { background: var(--illus-lavender); }
.signal-feature-illus.illus-mint { background: var(--illus-mint); }

.signal-gps-spotlight {
  text-align: center;
  padding: 8px 4px 4px;
}

.signal-gps-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #34c759 0%, #30b350 100%);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(52, 199, 89, 0.35);
}

.signal-gps-spotlight h2 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-primary);
}

.signal-gps-lead {
  margin: 0 auto 20px;
  max-width: 38em;
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.signal-gps-card {
  text-align: center;
  border-color: rgba(52, 199, 89, 0.35);
  box-shadow: 0 4px 20px rgba(52, 199, 89, 0.12);
}

.signal-gps-card .signal-feature-illus {
  min-height: 220px;
}

.about-contact-card p {
  margin: 0 0 14px;
  color: var(--text-secondary);
}

.signal-feature-body {
  padding: 24px 22px 28px;
  text-align: center;
}

.signal-feature-body h3 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.35;
}

.signal-feature-body p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px 22px;
  margin: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card-subtitle {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.docs-section-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.doc-entry-card {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none !important;
  color: inherit !important;
  padding: 20px 22px;
  margin: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

a.doc-entry-card:visited {
  color: inherit;
}

.doc-entry-card:hover {
  border-color: #d1d1d6;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.doc-entry-card:active {
  transform: scale(0.995);
}

.doc-entry-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--bg-muted);
  position: relative;
}

.doc-entry-icon::after {
  content: "";
  position: absolute;
  inset: 11px 13px;
  border: 2px solid var(--text-primary);
  border-radius: 2px;
  opacity: 0.85;
}

.doc-entry-text {
  flex: 1;
  min-width: 0;
}

.doc-entry-title {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.doc-entry-sub {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.doc-entry-arrow {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--text-muted);
  border-inline-end: 2px solid var(--text-muted);
  transform: rotate(45deg);
  opacity: 0.7;
}

body.rtl .doc-entry-arrow {
  transform: rotate(-135deg);
}

.about-card h2 {
  margin-bottom: 14px;
}

.about-lead {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.about-highlight {
  background: linear-gradient(135deg, #f8f9fa 0%, #eef1f4 100%);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 16px 0;
}

.about-highlight p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.tech-list {
  margin: 10px 0 0;
  padding-inline-start: 1.2rem;
}

.tech-list li {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.93rem;
}

.tech-list li strong {
  color: var(--text-primary);
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.feature-item {
  background: var(--bg-muted);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 16px;
}

.feature-label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.feature-item p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (min-width: 520px) {
  .feature-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  color: var(--text-primary);
}

.card h3 {
  margin: 22px 0 8px;
  font-size: 1rem;
  color: var(--text-secondary);
}

.card p,
.card li {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.card ul {
  margin: 8px 0 0;
  padding-inline-start: 1.2rem;
}

.card a {
  color: var(--text-primary);
  font-weight: 500;
}

.meta {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 18px;
}

.lang-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.lang-switch button {
  cursor: pointer;
  border: 1px solid var(--card-border);
  background: var(--bg-muted);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
}

.lang-switch button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.section-hidden {
  display: none;
}

.faq-intro {
  background: linear-gradient(135deg, #f8f9fa 0%, #eef1f4 100%);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 24px;
}

.faq-intro ul {
  margin: 10px 0 0;
  padding-inline-start: 20px;
}

.faq-section {
  margin-top: 28px;
}

.faq-section > h2 {
  font-size: 1.15rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-dark);
}

.faq-item {
  border: 1px solid var(--card-border);
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--bg-muted);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 14px 16px;
  list-style: none;
  color: var(--text-primary);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: inline-end;
  font-weight: 400;
  color: var(--text-muted);
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item .faq-answer {
  padding: 0 16px 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.faq-item .faq-answer ul,
.faq-item .faq-answer ol {
  margin: 8px 0;
  padding-inline-start: 20px;
}

.faq-item .faq-answer li {
  margin-bottom: 4px;
}

.footer {
  margin-top: 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer a {
  color: var(--text-secondary);
}

@media (min-width: 640px) {
  .shell {
    padding: 40px 28px 56px;
  }

  .card {
    padding: 28px 30px;
  }
}
