/* 
  AI Troll - Modern Production-Ready Stylesheet
  Theme: Dark Glassmorphism with Glowing Green/Emerald Accents (Green Troll Theme)
*/

/* Self-hosted IBM Plex Mono (SIL OFL 1.1) — headings + body.
   No external font requests (GDPR-safe). Covers Latin + Cyrillic so en/ru stay
   consistent; ar/ja/ko/zh-CN keep their own fonts below (no mono covers those scripts). */
@import url('fonts/ibm-plex-mono.css');

:root {
  /* Colors - Android App Match */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #f1f5f9; /* The soft grey used for cards in the settings */
  --bg-glass: rgba(255, 255, 255, 0.9);
  
  --accent: #2d3748; /* Dark slate used for sliders and active states */
  --accent-glow: rgba(45, 55, 72, 0.1);
  --accent-hover: #1a202c;
  
  --text-primary: #171923; /* Almost black */
  --text-secondary: #4a5568; /* Grey text */
  --text-muted: #a0aec0;
  
  --border: rgba(0, 0, 0, 0.05); /* Very subtle borders */
  --border-focus: rgba(45, 55, 72, 0.5);
  
  /* Fonts */
  --font-header: 'IBM Plex Mono', ui-monospace, monospace;
  --font-body: 'IBM Plex Mono', ui-monospace, monospace;
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Layout Constants */
  --max-width: 1200px;
  --header-height: 80px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
}

/* Localization Font Fixes */
html[lang="ru"] {
  --font-header: var(--font-body); /* mono font already covers Cyrillic; keep header == body */
}

html[lang="ar"],
html[lang="ja"],
html[lang="ko"],
html[lang="zh-CN"] {
  --font-header: system-ui, -apple-system, sans-serif;
  --font-body: system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  /* Offset in-page anchors so targets don't hide under the fixed header */
  scroll-padding-top: calc(var(--header-height) + 1rem);
  /* Stop mobile browsers from auto-inflating text on rotation */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* Long words / URLs / emails wrap instead of forcing horizontal scroll */
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: rgba(103, 214, 83, 0.2);
}

/* Media is responsive by default (logo sizing keeps its own width/height) */
img, svg, video {
  max-width: 100%;
  height: auto;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-card);
  border-radius: var(--border-radius-sm);
  border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-header);
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1.5rem;
  font-weight: 400;
}

p.lead {
  font-size: 1.2rem;
  color: var(--text-primary);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

p a {
  text-decoration: underline;
  font-weight: 600;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.section-padding {
  padding: 8rem 0;
}

@media (max-width: 768px) {
  .section-padding {
    padding: 4rem 0;
  }
}

/* Header & Navigation */
header.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

header.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: -1;
  pointer-events: none;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 2rem;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-header);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  transition: transform var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-link:hover {
  transform: scale(1.02);
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  background-color: var(--accent);
  flex-shrink: 0;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  font-family: var(--font-header);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 0.5rem 0;
  transition: color var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--accent);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-normal);
}

.nav-link:hover::after, .nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Mobile Menu Toggle Button */
.mobile-nav-toggle {
  display: none;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1001;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  line-height: 1;
  padding: 0 0 3px 0;
  text-align: center;
  transition: all var(--transition-fast);
}

.mobile-nav-toggle:hover, .mobile-nav-toggle:focus-visible {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.05);
  box-shadow: 0 0 12px var(--accent-glow);
  outline: none;
}

.mobile-nav-toggle:active {
  transform: scale(0.95);
}

@media (max-width: 1024px) {
  .mobile-nav-toggle {
    display: flex;
  }

  #primary-navigation {
    position: absolute;
  }

  .nav-menu {
    position: fixed;
    inset: 0;
    z-index: 999; /* sits under the toggle (1001), over page content */
    background: var(--bg-primary);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    /* top padding clears the header bar; scroll if the list is tall */
    padding: calc(var(--header-height) + 1rem) 2rem 3rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
  }

  .nav-menu.open {
    transform: translateX(0);
  }

  .nav-link {
    font-size: 1.5rem;
  }

  /* Lock background scrolling while the off-canvas menu is open */
  body.nav-open {
    overflow: hidden;
  }
}

/* Main Content Padding for Sticky Header */
main {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height) - 150px);
}

/* Hero Section */
.hero {
  position: relative;
  overflow: hidden;
  padding: 6rem 0;
  display: flex;
  align-items: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}

@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

@media (max-width: 992px) {
  .hero-content {
    align-items: center;
  }
}

.hero-badge {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-family: var(--font-header);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  display: inline-block;
}

.hero-title-sub {
  font-size: 1.5rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-header);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 2rem;
  min-height: 44px; /* comfortable touch target */
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff !important;
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(103, 214, 83, 0.2);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

/* Hero Image Wrap */
.hero-image-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-img {
  width: 100%;
  max-width: 380px;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 0 40px var(--accent-glow);
  transform: rotate(-2deg);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hero-image-wrap:hover .hero-img {
  transform: rotate(0deg) scale(1.03);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15), 0 0 60px rgba(103, 214, 83, 0.3);
}

/* Features Section */
.features-grid {
  display: grid;
  /* min() keeps columns from overflowing viewports narrower than 320px */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 2rem;
  margin-top: 3.5rem;
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  padding: 2.5rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 0;
  background: var(--accent);
  transition: height var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(103, 214, 83, 0.2);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(103, 214, 83, 0.05);
}

.feature-card:hover::before {
  height: 100%;
}

.feature-icon {
  width: 50px;
  height: 50px;
  background: var(--accent-glow);
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(103, 214, 83, 0.2);
}

.feature-card h3 {
  margin-bottom: 1rem;
  min-height: 2.5em; /* 1.25 line-height * 2 lines */
  display: flex;
  align-items: flex-start;
}

.feature-card p {
  color: var(--text-secondary);
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* Why AI Troll & Standard Layout Blocks */
.content-section {
  position: relative;
}

.split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

@media (max-width: 992px) {
  .split-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

.content-img-wrap {
  position: relative;
  display: flex;
  justify-content: center;
}

.content-img {
  width: 100%;
  max-width: 450px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border);
  box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

.content-text p {
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

/* Get Started Grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3.5rem;
}

@media (max-width: 768px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

.step-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  padding: 2.5rem;
  position: relative;
  text-align: center;
}

.step-number {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-header);
  font-size: 1.25rem;
  font-weight: 800;
  border: 4px solid var(--bg-primary);
  box-shadow: 0 0 15px var(--accent-glow);
}

.step-card h3 {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.step-card p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* Documentation Layout with Sidebar */
.docs-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  padding: 4rem 0;
}

@media (max-width: 992px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  height: fit-content;
  max-height: calc(100vh - var(--header-height) - 4rem);
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  padding: 2rem;
}

@media (max-width: 992px) {
  .docs-sidebar {
    position: relative;
    top: 0;
    max-height: none;
  }
}

.docs-nav-title {
  font-family: var(--font-header);
  font-size: 0.875rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  font-weight: 600;
}

.docs-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}



.docs-menu-item a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  display: block;
  padding: 0.25rem 0;
  transition: color var(--transition-fast);
}

.docs-menu-item a:hover, .docs-menu-item a.active {
  color: var(--accent);
}

.docs-content {
  max-width: 800px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  padding: 4rem;
}

@media (max-width: 768px) {
  .docs-content {
    padding: 2rem;
  }
}

.docs-section {
  margin-bottom: 4.5rem;
  scroll-margin-top: calc(var(--header-height) + 2rem);
}

.docs-section h2 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

.docs-section h3 {
  margin-top: 2rem;
}

.docs-section ul {
  list-style: none;
  margin-bottom: 1.5rem;
}

.docs-section ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.docs-section ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.alert-box {
  background: var(--accent-glow);
  border: 1px solid rgba(103, 214, 83, 0.2);
  border-radius: var(--border-radius-sm);
  padding: 1.5rem;
  margin: 2rem 0;
  color: var(--text-primary);
}

.alert-box strong {
  color: var(--accent);
}

/* FAQ Layout (Category-based details/summary) */
.faq-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-top: 3.5rem;
}

.faq-category {
  margin-bottom: 3rem;
}

.faq-category-title {
  font-size: 1.8rem;
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  margin-bottom: 2rem;
}

.accordion-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Details/Summary styling */
details.faq-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  transition: all var(--transition-normal);
}

details.faq-item[open] {
  border-color: rgba(103, 214, 83, 0.3);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
}

summary.faq-question {
  padding: 1.5rem 2rem;
  font-family: var(--font-header);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color var(--transition-fast);
}

summary.faq-question::-webkit-details-marker {
  display: none;
}

summary.faq-question::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--accent);
  transition: transform var(--transition-normal);
}

details.faq-item[open] summary.faq-question::after {
  transform: rotate(45deg);
}

summary.faq-question:hover {
  background: var(--bg-card);
}

.faq-answer {
  padding: 1.5rem 2rem 1.5rem 2rem;
  border-top: 1px solid var(--border);
  font-size: 1rem;
  color: var(--text-secondary);
}

.faq-answer > *:last-child {
  margin-bottom: 0;
}

.faq-answer ul {
  list-style: none;
  margin-top: 1rem;
}

.faq-answer ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
}

.faq-answer ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.faq-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.faq-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  padding: 1.5rem;
}

.faq-table-card h4 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.faq-table-card p {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

/* Legal Document Styles */
.legal-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  padding: 4rem 0;
}

@media (max-width: 992px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

.legal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  padding: 4rem;
}

@media (max-width: 768px) {
  .legal-content {
    padding: 2rem;
  }
}

.legal-content section {
  margin-bottom: 4rem;
  scroll-margin-top: calc(var(--header-height) + 2rem);
}

.legal-content section:last-child {
  margin-bottom: 0;
}

.legal-content h2 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
}

.legal-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.legal-content ul {
  list-style: none;
  margin-bottom: 1.5rem;
}

.legal-content ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.legal-content ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1;
}

/* Footer Section */
footer.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 4rem 0;
  margin-top: 8rem;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.footer-logo {
  font-family: var(--font-header);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--accent);
  background-color: var(--accent);
}

.footer-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
}

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

.footer-contact {
  color: var(--text-secondary);
  font-size: 1rem;
}

.footer-copyright {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 1rem;
}

/* Language Selector Styles */
.lang-selector-container {
  display: flex;
  align-items: center;
}

.lang-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.lang-selector-wrapper:hover, .lang-selector-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.globe-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.lang-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  padding-right: 0.5rem;
}

.lang-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Version 2.0 Release Notes Styles */
.release-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 2.5rem;
  margin-top: 2rem;
}

.release-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.release-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(103, 214, 83, 0.1);
}

.release-tag {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* 404 Error Page Styles */
body.error-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh; /* accounts for mobile browser address bar */
  background-color: var(--bg-primary);
  margin: 0;
  padding: 2rem;
}

.error-container {
  width: 100%;
  max-width: 500px;
  text-align: center;
}

.error-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  padding: 3.5rem 2.5rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.error-mascot {
  margin-bottom: 1.5rem;
}

.error-logo-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  object-fit: cover;
  transition: transform var(--transition-normal);
  background-color: var(--accent);
}

.error-card:hover .error-logo-img {
  transform: rotate(10deg) scale(1.05);
}

.error-code {
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
  margin: 0;
  background: linear-gradient(135deg, #ef4444 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.2));
}

.error-card h2 {
  font-size: 2rem;
  margin: 1rem 0 1.5rem 0;
  color: var(--text-primary);
}

.error-message {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.error-actions {
  width: 100%;
}

.error-actions .btn {
  display: inline-block;
  width: 100%;
  padding: 1rem 2rem;
}

/* Arabic Right-to-Left (RTL) Layout Adjustments */
html[dir="rtl"] .release-tag {
  right: auto;
  left: 1rem;
}

html[dir="rtl"] .docs-sidebar {
  /* padding overrides removed due to symmetrical 2rem padding */
}

@media (max-width: 992px) {
  html[dir="rtl"] .docs-sidebar {
    /* padding overrides removed */
  }
}

html[dir="rtl"] .lang-select {
  padding-right: 0;
  padding-left: 0.5rem;
}

html[dir="rtl"] .faq-category-title {
  border-left: none;
  border-right: 4px solid var(--accent);
  padding-left: 0;
  padding-right: 1rem;
}

html[dir="rtl"] .docs-section ul li {
  padding-left: 0;
  padding-right: 1.5rem;
}

html[dir="rtl"] .docs-section ul li::before {
  content: "←";
  left: auto;
  right: 0;
}

html[dir="rtl"] .faq-answer ul li {
  padding-left: 0;
  padding-right: 1.5rem;
}

html[dir="rtl"] .faq-answer ul li::before {
  left: auto;
  right: 0;
}

html[dir="rtl"] .legal-content ul li {
  padding-left: 0;
  padding-right: 1.5rem;
}

html[dir="rtl"] .legal-content ul li::before {
  left: auto;
  right: 0;
}

/* Interactive Step Card Links */
.step-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.step-card-link .step-card {
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal), background var(--transition-normal);
  pointer-events: none;
}

.step-card-link:hover .step-card {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(103, 214, 83, 0.15);
  background: var(--bg-glass);
}

/* Play Store Badge Hover Animation */
.play-store-badge:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 20px rgba(103, 214, 83, 0.25);
  border-color: var(--accent);
}

/* ==========================================================================
   Mobile Refinements
   Tighter spacing and full-width tap targets on small phones.
   ========================================================================== */
@media (max-width: 768px) {
  /* Roomy desktop card padding is cramped on a phone — tighten it up */
  .feature-card,
  .step-card,
  .release-card,
  .faq-table-card {
    padding: 1.75rem;
  }

  summary.faq-question {
    padding: 1.25rem 1.5rem;
    font-size: 1.05rem;
  }

  .faq-answer {
    padding: 1.25rem 1.5rem 1.25rem 1.5rem;
  }

  .faq-category-title {
    font-size: 1.5rem;
  }

  .docs-content,
  .docs-sidebar,
  .legal-content {
    padding: 1.75rem;
  }

  .release-tag {
    position: static;
    display: table;
    margin: 0 auto 1.5rem auto;
  }
}

@media (max-width: 480px) {
  /* Reclaim horizontal space on the smallest screens */
  .container {
    padding: 0 1.25rem;
  }

  .section-padding {
    padding: 3rem 0;
  }

  /* Stack hero CTAs full-width so they're easy to tap with a thumb */
  .hero-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .feature-card,
  .step-card,
  .release-card {
    padding: 1.5rem;
  }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


