:root {
  color-scheme: dark;
  --bg: #101b1a;
  --bg-deep: #0c1514;
  --surface: #172923;
  --surface-alt: #1c312a;
  --surface-hover: #213a32;
  --ink: #162a24;
  --paper: #f5ead1;
  --muted: #b8c4b4;
  --muted-soft: #97a899;
  --brass: #e8c489;
  --brass-strong: #efd6a8;
  --brass-deep: #ddb47b;
  --edge: rgba(146, 173, 149, 0.24);
  --edge-strong: rgba(232, 196, 137, 0.45);
  --blue: #5c9bff;
  --red: #e06f63;
  --gold: #eab852;
  --purple: #a87ce4;
  --ok: #88d8a6;
  --display: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  line-height: 1.55;
  color: var(--paper);
  background:
    radial-gradient(ellipse 90% 45% at 50% -10%, rgba(44, 79, 69, 0.45), transparent 70%),
    linear-gradient(180deg, #12211e 0%, var(--bg) 38%, var(--bg-deep) 100%);
  overflow-x: clip;
}

[dir="rtl"] body,
[dir="rtl"] {
  font-family: Tahoma, system-ui, -apple-system, "Segoe UI", sans-serif;
}

[dir="rtl"] .brand-title,
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3 {
  font-family: Tahoma, system-ui, sans-serif;
  letter-spacing: 0;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid #fbdb9d;
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--brass);
  color: var(--ink);
  font-weight: 700;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

.container {
  width: min(1140px, 100% - 32px);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--edge);
  background: rgba(16, 27, 26, 0.88);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--edge-strong);
  flex: none;
}

.brand-title {
  font: 700 1.25rem/1 var(--display);
  letter-spacing: -0.02em;
  color: var(--paper);
}

.nav-links {
  display: none;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--brass);
}

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

.lang-btn {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--surface);
  color: var(--paper);
  font-size: 0.82rem;
  font-weight: 700;
}

.lang-btn:hover {
  border-color: var(--edge-strong);
  background: var(--surface-alt);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 0.94rem;
  font-weight: 700;
  transition: transform 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-header {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn-primary {
  border-color: #f3d7a6;
  color: var(--ink);
  background: linear-gradient(135deg, var(--brass-strong), var(--brass-deep));
  box-shadow: 0 8px 20px rgba(7, 23, 19, 0.45), inset 0 1px rgba(255, 246, 220, 0.55);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f6e0b7, #e4be86);
}

.btn-secondary {
  border-color: var(--edge-strong);
  color: var(--paper);
  background: var(--surface-alt);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--brass);
}

.btn-quiet {
  min-height: 38px;
  padding: 6px 12px;
  border-color: var(--edge);
  background: var(--surface);
  color: var(--paper);
  font-size: 0.82rem;
}

.btn-quiet:hover {
  border-color: var(--edge-strong);
}

/* Hero */
.hero {
  padding: 40px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 5px 12px;
  border: 1px solid var(--edge-strong);
  border-radius: 999px;
  background: rgba(23, 41, 35, 0.85);
  color: var(--brass);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}

.hero h1 {
  margin: 0;
  color: var(--paper);
  font: 700 clamp(2.1rem, 5.2vw, 3.6rem)/1.04 var(--display);
  letter-spacing: -0.03em;
}

.hero-lead {
  margin: 18px 0 0;
  max-width: 56ch;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.5vw, 1.12rem);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-cta .btn {
  flex: 1 1 220px;
}

.apk-pill {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: rgba(23, 41, 35, 0.72);
  color: var(--muted);
  font-size: 0.82rem;
}

.apk-pill strong {
  color: var(--paper);
}

.spec-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--edge);
  list-style: none;
}

.spec-strip li {
  min-width: 0;
}

.spec-value {
  display: block;
  color: var(--brass);
  font: 700 1.25rem/1.15 var(--display);
}

.spec-label {
  display: block;
  margin-top: 4px;
  color: var(--muted-soft);
  font-size: 0.78rem;
}

/* Live tactical preview */
.preview-shell {
  width: min(360px, 100%);
  margin-inline: auto;
  padding: 12px;
  border: 1px solid var(--edge-strong);
  border-radius: 16px;
  background: linear-gradient(180deg, #1b3029 0%, #12211e 100%);
  box-shadow: 0 22px 48px rgba(4, 12, 10, 0.65);
}

.preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.76rem;
  color: var(--muted);
}

.preview-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ok);
  font-weight: 700;
}

.preview-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 13;
  border: 1px solid var(--edge);
  border-radius: 10px;
  overflow: hidden;
  background: #142421;
}

.preview-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.preview-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.74rem;
  color: var(--muted);
}

.faction-dots {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot-blue { background: var(--blue); }
.dot-red { background: var(--red); }
.dot-gold { background: var(--gold); }
.dot-purple { background: var(--purple); }

/* Sections */
.section {
  padding: 56px 0;
  border-top: 1px solid var(--edge);
}

.section-head {
  max-width: 64ch;
  margin-bottom: 28px;
}

.section-kicker {
  margin: 0 0 8px;
  color: var(--brass);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section h2 {
  margin: 0;
  color: var(--paper);
  font: 700 clamp(1.6rem, 3.2vw, 2.3rem)/1.12 var(--display);
  letter-spacing: -0.02em;
}

.section-sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

/* Modes asymmetric layout */
.modes-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.mode-feature {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--edge-strong);
  border-radius: 14px;
  background: linear-gradient(145deg, #1d352e, #152621);
}

.mode-feature h3 {
  margin: 8px 0 10px;
  font: 700 1.55rem/1.15 var(--display);
  color: var(--paper);
}

.mode-feature p {
  margin: 0;
  color: var(--muted);
}

.feature-badge {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--edge-strong);
  border-radius: 6px;
  color: var(--brass);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mode-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mode-facts li {
  padding: 12px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: rgba(16, 27, 26, 0.55);
}

.mode-facts strong {
  display: block;
  color: var(--brass);
  font-size: 0.88rem;
}

.mode-facts span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.modes-secondary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.mode-panel {
  padding: 20px;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--surface);
}

.mode-panel h3 {
  margin: 0 0 8px;
  font: 700 1.22rem/1.2 var(--display);
  color: var(--paper);
}

.mode-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.mode-meta {
  display: inline-block;
  margin-top: 12px;
  color: var(--brass);
  font-size: 0.78rem;
  font-weight: 700;
}

/* Arsenal Tabs & Table */
.tab-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--bg-deep);
  margin-bottom: 18px;
}

.tab-btn {
  min-height: 38px;
  padding: 6px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.tab-btn[aria-selected="true"] {
  background: var(--brass);
  color: var(--ink);
}

.arsenal-table-wrap {
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--surface);
  overflow-x: auto;
}

.arsenal-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 540px;
  text-align: start;
}

.arsenal-table th,
.arsenal-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--edge);
  font-size: 0.88rem;
}

.arsenal-table th {
  color: var(--brass);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(12, 21, 20, 0.45);
}

.arsenal-table tr:last-child td {
  border-bottom: 0;
}

.arsenal-table td strong {
  color: var(--paper);
}

.arsenal-table td {
  color: var(--muted);
}

.is-hidden {
  display: none;
}

/* Android Download & Security */
.download-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.download-card,
.security-card {
  padding: 24px;
  border: 1px solid var(--edge-strong);
  border-radius: 14px;
  background: var(--surface);
}

.security-card {
  border-color: var(--edge);
  background: #142420;
}

.download-card h3,
.security-card h3 {
  margin: 0 0 10px;
  font: 700 1.38rem/1.2 var(--display);
  color: var(--paper);
}

.download-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.download-meta li {
  padding: 10px 12px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: rgba(16, 27, 26, 0.55);
}

.download-meta span {
  display: block;
  color: var(--muted-soft);
  font-size: 0.74rem;
}

.download-meta strong {
  display: block;
  margin-top: 2px;
  color: var(--paper);
  font-size: 0.86rem;
}

.checksum-box {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--bg-deep);
}

.checksum-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.76rem;
  color: var(--brass);
  font-weight: 700;
}

.checksum-value {
  display: block;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  word-break: break-all;
}

.copy-note {
  margin: 6px 0 0;
  min-height: 1.2em;
  font-size: 0.76rem;
  color: var(--ok);
}

.install-steps {
  margin: 18px 0 0;
  padding-inline-start: 20px;
  color: var(--muted);
  font-size: 0.88rem;
}

.install-steps li + li {
  margin-top: 8px;
}

.security-list {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.security-list li {
  padding: 12px 14px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: rgba(23, 41, 35, 0.65);
}

.security-list strong {
  display: block;
  color: var(--paper);
  font-size: 0.9rem;
}

.security-list span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Footer */
.site-footer {
  padding: 28px 0 40px;
  border-top: 1px solid var(--edge);
  color: var(--muted-soft);
  font-size: 0.84rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a:hover {
  color: var(--brass);
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }

  .modes-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-feature {
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
  }

  .download-grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding: 56px 0 72px;
  }

  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 48px;
  }

  .hero-cta .btn {
    flex: 0 1 auto;
  }

  .modes-secondary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .spec-strip {
    grid-template-columns: 1fr;
  }

  .mode-facts,
  .download-meta {
    grid-template-columns: 1fr;
  }
}
