/* ============================================================
   Myket Maven Repository — style.css
   RTL Persian, Dark/Light mode, Modern Professional Design
   ============================================================ */

/* ── Design Tokens ──────────────────────────────────────────── */
/* Default theme: dark (no flash before JS / no class needed on <html>) */
:root {
  /* Brand */
  --color-brand:       #0091EA;
  --color-brand-dark:  #0077c2;
  --color-brand-light: #4fc3f7;
  --color-accent:      #5c6bc0;
  --color-accent2:     #7c4dff;

  /* Backgrounds */
  --bg-base:        #0d0f1a;
  --bg-subtle:      #111827;
  --bg-card:        #151929;
  --bg-code:        #0b0d1a;
  --bg-stats:       #1a1b40;

  /* Text */
  --text-primary:   #f0f4ff;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-on-dark:   #f8fafc;

  /* Border */
  --border:         #1e2436;
  --border-code:    #252845;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,.45);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.5);
  --shadow-xl:  0 20px 60px rgba(0,0,0,.55);

  /* Radius */
  --r-sm:  6px;
  --r-md:  12px;
  --r-lg:  18px;
  --r-xl:  24px;
  --r-full: 9999px;

  /* Spacing scale */
  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;  --space-4: 16px;
  --space-5: 20px;  --space-6: 24px;  --space-7: 28px;  --space-8: 32px;
  --space-10: 40px; --space-12: 48px; --space-16: 64px; --space-20: 80px;
  --space-24: 96px;

  /* Typography */
  --font-sans: 'Vazirmatn', 'Tahoma', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  /* Transitions */
  --transition: 200ms ease;
  --transition-slow: 350ms ease;

  /* Nav height */
  --nav-h: 68px;
}

/* Opt-in light mode */
html.light {
  --bg-base:        #ffffff;
  --bg-subtle:      #f6f8fc;
  --bg-card:        #ffffff;
  --bg-code:        #1e1e2e;
  --bg-stats:       #3f3d8b;

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;

  --border:         #e2e8f0;
  --border-code:    #3b3b5e;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.05);
  --shadow-xl:  0 20px 60px rgba(0,0,0,.15);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.8;
  direction: rtl;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

a { color: var(--color-brand); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-brand-dark); }

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

ul, ol { list-style: none; }

/* ── Container ──────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--r-full);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn--primary {
  background: var(--color-brand);
  color: #fff;
  border-color: var(--color-brand);
}
.btn--primary:hover {
  background: var(--color-brand-dark);
  border-color: var(--color-brand-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 145, 234, .4);
}
.btn--outline {
  background: transparent;
  color: rgba(255,255,255,.9);
  border-color: rgba(255,255,255,.4);
}
.btn--outline:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.7);
  color: #fff;
}
.btn--sm  { padding: var(--space-2) var(--space-4); font-size: 0.85rem; }
.btn--lg  { padding: var(--space-4) var(--space-8); font-size: 1rem; }

/* ── Typography helpers ─────────────────────────────────────── */
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}
.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
}
.section-text {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.9;
  max-width: 720px;
  margin-bottom: var(--space-4);
}
.centered { text-align: center; margin-inline: auto; }

.section {
  padding-block: var(--space-20);
}
.section-header { margin-bottom: var(--space-12); }

.link { color: var(--color-brand); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--color-brand-dark); }

/* ── Navigation ─────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: all var(--transition-slow);
}
html:not(.light) .site-header {
  background: rgba(13, 15, 26, .8);
}
.site-header--scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-img {
  display: block;
  height: 48px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  margin-inline-start: auto;
}
.nav-links a {
  padding: var(--space-2) var(--space-3);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--r-sm);
  transition: all var(--transition);
}
.nav-links a:hover {
  color: var(--color-brand);
  background: rgba(0, 145, 234, .08);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--r-sm);
  transition: all var(--transition);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.nav-dropdown-toggle:hover,
.nav-dropdown--open .nav-dropdown-toggle {
  color: var(--color-brand);
  background: rgba(0, 145, 234, .08);
}

.nav-dropdown-chevron {
  transition: transform var(--transition);
}

.nav-dropdown--open .nav-dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  inset-inline-start: 0;
  min-width: 190px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  display: none;
  flex-direction: column;
  gap: var(--space-1);
  z-index: 100;
  list-style: none;
}

.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  bottom: 100%;
  inset-inline: -1rem;
  height: var(--space-2);
}

.nav-dropdown-menu a {
  display: block;
  white-space: nowrap;
}

@media (min-width: 681px) {
  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown--open .nav-dropdown-menu {
    display: flex;
  }
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition);
  color: var(--text-primary);
}
.theme-toggle:hover {
  background: var(--bg-subtle);
  border-color: var(--color-brand);
}

.theme-icon { display: none; }
.theme-icon--light { display: inline; }
html:not(.light) .theme-icon--light { display: none; }
html:not(.light) .theme-icon--dark  { display: inline; }

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}
.nav-burger--open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-burger--open span:nth-child(2) { opacity: 0; }
.nav-burger--open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1070 0%, #2d1b8e 30%, #3730a3 60%, #1e40af 100%);
  padding-top: var(--nav-h);
}

.hero-bg-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, .3) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, .25) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(59, 130, 246, .2) 0%, transparent 50%);
  pointer-events: none;
}

/* Geometric pattern overlay */
.hero-bg-pattern::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-block: var(--space-20);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--r-full);
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.85);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: var(--space-8);
  backdrop-filter: blur(8px);
  cursor: default;
  transition: all var(--transition);
}
.hero-badge:hover { background: rgba(255,255,255,.13); }

.hero-title {
  font-size: clamp(2rem, 5.5vw, 3.8rem);
  font-weight: 900;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: var(--space-6);
  text-shadow: 0 2px 20px rgba(0,0,0,.2);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: rgba(255,255,255,.8);
  margin-bottom: var(--space-10);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hero-services {
  gap: var(--space-3);
}

.hero-services .btn {
  min-width: 9.5rem;
  flex: 0 1 auto;
  justify-content: center;
  text-align: center;
}

/* ── Intro Section ──────────────────────────────────────────── */
.intro-section { background: var(--bg-base); }
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-16);
}

.intro-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 300px;
}

.intro-mockup {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-6);
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
}
.mockup-bar {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot--red    { background: #ff5f57; }
.dot--yellow { background: #febc2e; }
.dot--green  { background: #28c840; }

.mockup-line {
  height: 10px;
  border-radius: var(--r-full);
  background: var(--bg-subtle);
  margin-bottom: var(--space-3);
}
html:not(.light) .mockup-line { background: #1e2436; }
.mockup-line--wide  { width: 80%; }
.mockup-line--med   { width: 60%; }
.mockup-line--sm    { width: 40%; }
.mockup-line--full  { width: 95%; }

.intro-icon {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.15));
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.check-list li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}
.check-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 145, 234, .12);
  color: var(--color-brand);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Stats Section ──────────────────────────────────────────── */
.stats-section {
  background: var(--bg-stats);
  padding-block: var(--space-16);
}
html:not(.light) .stats-section { background: #111330; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}
.stat-item {
  text-align: center;
}
.stat-number {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
  margin-bottom: var(--space-2);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 0.95rem;
  color: rgba(255,255,255,.7);
  font-weight: 500;
}

/* ── Why Section ────────────────────────────────────────────── */
.why-section { background: var(--bg-base); }

/* ── Features Section ───────────────────────────────────────── */
.features-section { background: var(--bg-subtle); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-8);
  text-align: center;
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--color-brand), var(--color-accent2));
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  opacity: 0;
  transition: opacity var(--transition);
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0, 145, 234, .3);
}
.feature-card:hover::before { opacity: 1; }

.feature-icon {
  font-size: 2.2rem;
  margin-bottom: var(--space-5);
  line-height: 1;
}
.feature-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}
.feature-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ── Auto Update Section ────────────────────────────────────── */
.autoupdate-section { background: var(--bg-base); }

.flow-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-6);
  max-width: 820px;
  margin-inline: auto;
}

.flow-arrow {
  font-size: 2rem;
  color: var(--color-brand);
  text-align: center;
  font-weight: 300;
}

.flow-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-8);
  text-align: center;
  transition: all var(--transition-slow);
}
.flow-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.flow-card--exists { border-top: 3px solid var(--color-brand); }
.flow-card--new    { border-top: 3px solid var(--color-accent2); }

.flow-icon  { font-size: 2rem; margin-bottom: var(--space-4); }
.flow-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.flow-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ── Checksum Section ───────────────────────────────────────── */
.checksum-section { background: var(--bg-subtle); }

.checksum-box {
  max-width: 760px;
  margin-inline: auto;
}
.checksum-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  text-align: right;
}
.checksum-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  background: rgba(0, 145, 234, .06);
  border: 1px solid rgba(0, 145, 234, .2);
  border-radius: var(--r-md);
  padding: var(--space-4) var(--space-5);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-top: var(--space-4);
}
.note-check {
  color: #22c55e;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── Repos Section ──────────────────────────────────────────── */
.repos-section { background: var(--bg-base); }

.repos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.repo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all var(--transition);
  text-decoration: none;
}
.repo-card:hover {
  border-color: var(--color-brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  background: rgba(0, 145, 234, .04);
}
.repo-url {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
  direction: ltr;
  text-align: center;
}
html:not(.light) .repo-url { color: var(--color-brand-light); }

.repos-tip {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  background: rgba(255, 193, 7, .06);
  border: 1px solid rgba(255, 193, 7, .3);
  border-radius: var(--r-lg);
  padding: var(--space-5) var(--space-6);
}
html:not(.light) .repos-tip {
  background: rgba(255, 193, 7, .05);
  border-color: rgba(255, 193, 7, .2);
}
.tip-icon { font-size: 1.4rem; flex-shrink: 0; }
.repos-tip p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ── Getting Started Section ────────────────────────────────── */
.getting-started-section { background: var(--bg-subtle); }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}
.step-item {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--space-5) var(--space-6);
}
.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-brand), var(--color-accent2));
  color: white;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}
.step-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}
.step-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  direction: ltr;
  font-family: var(--font-mono);
}

/* ── Gradle Section ─────────────────────────────────────────── */
.gradle-section { background: var(--bg-base); }

.diff-section {
  max-width: 860px;
  margin-inline: auto;
  min-width: 0;
}
.diff-label { margin-bottom: var(--space-2); }

.diff-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  margin-top: var(--space-6);
  min-width: 0;
}
.diff-item {
  min-width: 0;
}
.diff-item .code-block {
  margin: 0;
  max-width: 100%;
}
.diff-badge {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
}
.diff-badge--bad  { color: #ef4444; }
.diff-badge--good { color: #22c55e; }

.info-note {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: rgba(99, 102, 241, .06);
  border: 1px solid rgba(99, 102, 241, .2);
  border-radius: var(--r-md);
  padding: var(--space-4) var(--space-5);
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: var(--space-5);
}
.info-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ── SDK Section ────────────────────────────────────────────── */
.sdk-section { background: var(--bg-subtle); }

/* ── Flutter Section ────────────────────────────────────────── */
.flutter-section { background: var(--bg-base); }

.flutter-overview {
  max-width: 420px;
  margin: var(--space-4) auto 0;
}

.sdk-download-btn { text-align: center; margin-top: var(--space-6); margin-bottom: var(--space-4); }

.sdk-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-width: 860px;
  margin-inline: auto;
}
.sdk-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-8);
  min-width: 0;
}
.sdk-step-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}
.sdk-step-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
  line-height: 1.8;
}
.os-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  min-width: 0;
}
/* Let grid tracks shrink below intrinsic content (code/pre) instead of overflowing. */
.os-grid > * {
  min-width: 0;
}
.os-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  text-align: right;
}

/* ── Styled Lists ───────────────────────────────────────────── */
.styled-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.styled-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: var(--space-2) 0;
}
.styled-list li::before {
  content: '▸';
  color: var(--color-brand);
  font-size: 0.7rem;
  margin-top: 5px;
  flex-shrink: 0;
}
.styled-list--ordered { counter-reset: list; }
.styled-list--ordered li::before {
  content: counter(list) '.';
  counter-increment: list;
  font-weight: 700;
  color: var(--color-brand);
  font-size: 0.85rem;
  margin-top: 1px;
}
.styled-list--ltr {
  direction: ltr;
  text-align: left;
}

/* ── Code Blocks ────────────────────────────────────────────── */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border-code);
  border-radius: var(--r-md);
  overflow: hidden;
  margin: var(--space-4) 0;
  box-shadow: var(--shadow-md);
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  /* Isolate LTR code from page RTL so width/scroll behavior is predictable. */
  direction: ltr;
  unicode-bidi: isolate;
}
.code-block--file { margin-bottom: var(--space-5); }

.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid var(--border-code);
  user-select: none;
}
.code-block__lang {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(255,255,255,.35);
  font-weight: 500;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.code-block__copy {
  background: none;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--r-sm);
  color: rgba(255,255,255,.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  transition: all var(--transition);
}
.code-block__copy:hover {
  border-color: rgba(255,255,255,.4);
  color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.06);
}

.code-block__pre {
  margin: 0;
  padding: var(--space-5) var(--space-6);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.75;
  color: #cdd6f4;
  direction: ltr;
  text-align: left;
  white-space: pre;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

/* Syntax colors (light theme for the dark code block) */
.code-block__pre .kw  { color: #cba6f7; }  /* keyword  – lavender */
.code-block__pre .fn  { color: #89b4fa; }  /* function – blue     */
.code-block__pre .str { color: #a6e3a1; }  /* string   – green    */
.code-block__pre .cm  { color: #6c7086; }  /* comment  – overlay  */
.code-block__pre .num { color: #fab387; }  /* number   – peach    */

/* Scrollbar inside code */
.code-block__pre::-webkit-scrollbar { height: 6px; }
.code-block__pre::-webkit-scrollbar-track { background: transparent; }
.code-block__pre::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
.code-block__pre::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

/* Inline code */
.inline-code, code.inline-code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(0, 145, 234, .1);
  color: var(--color-brand);
  border: 1px solid rgba(0, 145, 234, .2);
  border-radius: var(--r-sm);
  padding: 1px 6px;
}
html:not(.light) .inline-code, html:not(.light) code.inline-code {
  background: rgba(0, 145, 234, .15);
  color: var(--color-brand-light);
}
.code-inline {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: rgba(0, 145, 234, .08);
  color: var(--color-brand);
  padding: 2px 8px;
  border-radius: var(--r-sm);
}

/* ── FAQ Section ────────────────────────────────────────────── */
.faq-section { background: var(--bg-base); }

.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 860px;
  margin-inline: auto;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.faq-item:hover { box-shadow: var(--shadow-sm); }
.faq-item[open] {
  border-color: rgba(0, 145, 234, .3);
  box-shadow: var(--shadow-md);
}
.faq-item[open] .faq-question::after { transform: rotate(-180deg); }

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  user-select: none;
  gap: var(--space-4);
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: '⌄';
  font-size: 1.1rem;
  color: var(--color-brand);
  flex-shrink: 0;
  transition: transform var(--transition);
  line-height: 1;
}
.faq-question:hover { color: var(--color-brand); }

.faq-answer {
  padding: 0 var(--space-6) var(--space-5);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.85;
  border-top: 1px solid var(--border);
  padding-top: var(--space-5);
}
.faq-answer p { margin-bottom: var(--space-4); }
.faq-answer .code-block { margin: var(--space-4) 0; }

/* ── CTA Section ────────────────────────────────────────────── */
.cta-section {
  background: linear-gradient(135deg, #1a1070 0%, #3730a3 50%, #1e40af 100%);
  padding-block: var(--space-20);
  text-align: center;
}
.cta-inner { max-width: 640px; }
.cta-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  color: #ffffff;
  margin-bottom: var(--space-5);
  line-height: 1.2;
}
.cta-text {
  font-size: 1.05rem;
  color: rgba(255,255,255,.8);
  margin-bottom: var(--space-8);
  line-height: 1.7;
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  padding-block: var(--space-8);
}
html:not(.light) .site-footer { background: #0a0b14; }

.footer-inner { text-align: center; }
.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Scroll-top margin (fixed nav) ──────────────────────────── */
[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .intro-grid { grid-template-columns: 1fr; gap: var(--space-10); }
  .intro-visual { order: -1; }
  .features-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .steps-grid { grid-template-columns: 1fr; }
  .diff-grid { grid-template-columns: 1fr; }
  .os-grid { grid-template-columns: 1fr; }
  .flow-grid { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); margin-block: calc(-1 * var(--space-2)); }
}

@media (max-width: 680px) {
  :root { --nav-h: 60px; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    inset-inline: 0;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: var(--space-4);
    gap: var(--space-1);
    transform: translateY(-120%);
    opacity: 0;
    transition: all var(--transition-slow);
    box-shadow: var(--shadow-lg);
    z-index: 99;
  }
  .nav-links--open {
    transform: translateY(0);
    opacity: 1;
  }
  .nav-links a {
    padding: var(--space-3) var(--space-4);
    width: 100%;
    text-align: center;
  }
  .nav-dropdown {
    width: 100%;
  }
  .nav-dropdown-toggle {
    width: 100%;
    justify-content: center;
    position: relative;
    padding: var(--space-3) var(--space-4);
  }
  .nav-dropdown-chevron {
    position: absolute;
    inset-inline-end: var(--space-4);
  }
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-inline-start: var(--space-4);
    background: transparent;
    min-width: 0;
  }
  .nav-dropdown--open .nav-dropdown-menu {
    display: flex;
  }
  .nav-burger { display: flex; }
  .nav-actions .btn--sm { display: none; }

  .stats-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .repos-grid { grid-template-columns: 1fr; }

  .hero-title { font-size: clamp(1.7rem, 7vw, 2.5rem); }
  .hero-badge { font-size: 0.75rem; padding: var(--space-2) var(--space-3); }
  .hero-services .btn { min-width: 0; flex: 1 1 calc(50% - var(--space-2)); font-size: 0.85rem; padding: var(--space-3) var(--space-4); }

  .section { padding-block: var(--space-12); }
  .container { padding-inline: var(--space-4); }

  .diff-section .code-block__pre {
    padding: var(--space-4);
    font-size: 0.78rem;
  }
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-badge,
.hero-title,
.hero-subtitle,
.hero-actions {
  animation: fadeInUp .7s ease both;
}
.hero-badge    { animation-delay: .1s; }
.hero-title    { animation-delay: .25s; }
.hero-subtitle { animation-delay: .4s; }
.hero-actions  { animation-delay: .55s; }

/* ── Page Hero (service subpages) ───────────────────────────── */
.page-hero {
  padding-block: calc(var(--nav-h) + var(--space-12)) var(--space-10);
  background: linear-gradient(180deg, var(--bg-subtle) 0%, var(--bg-base) 100%);
  border-bottom: 1px solid var(--border);
}

.page-hero__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-block: var(--space-4) var(--space-3);
}

.page-hero__subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 42rem;
}

.breadcrumb {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--color-brand-light);
  text-decoration: none;
  transition: color var(--transition);
}

.breadcrumb a:hover {
  color: var(--color-brand);
}

/* ── FAQ Index (homepage) ─────────────────────────────────── */
.faq-index-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-8);
}

.faq-index-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.faq-index-card:hover {
  border-color: var(--color-brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.faq-index-icon {
  font-size: 1.75rem;
}

.faq-index-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.faq-index-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 680px) {
  .faq-index-grid { grid-template-columns: 1fr; }
  .page-hero { padding-block: calc(var(--nav-h) + var(--space-8)) var(--space-8); }
}
