/* -------------------------------------------------------------
   Ali Miri (Dakto Studio) — Portfolio & App Showcase
   Design System: Modern Glassmorphic Tech (Dark & Light)
   Built with CSS Logical Properties for Seamless RTL/LTR Support
------------------------------------------------------------- */

:root {
  /* ---- Modern Tech — Dark Mode (Default) ---- */
  --bg-dark: #090b10;
  --bg-surface: #0f131d;
  --bg-card: rgba(18, 24, 38, 0.72);
  --bg-card-hover: rgba(26, 34, 54, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-active: rgba(255, 255, 255, 0.09);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-on-accent: #ffffff;

  --border: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(99, 102, 241, 0.55);

  /* Brand Accents */
  --accent-primary: #6366f1;           /* Electric Indigo */
  --accent-primary-hover: #4f46e5;
  --accent-primary-glow: rgba(99, 102, 241, 0.28);
  --accent-indigo: var(--accent-primary);
  --accent-indigo-glow: var(--accent-primary-glow);

  /* App Accents */
  --accent-kaghaz: #f59e0b;           /* Amber / Gold */
  --accent-kaghaz-glow: rgba(245, 158, 11, 0.25);
  --accent-artilo: #f43f5e;           /* Rose Coral */
  --accent-artilo-glow: rgba(244, 63, 94, 0.25);
  --accent-danak: #06b6d4;            /* Cyan */
  --accent-danak-glow: rgba(6, 182, 212, 0.25);
  --accent-shakhes: #10b981;          /* Emerald */
  --accent-shakhes-glow: rgba(16, 185, 129, 0.25);
  --accent-modam: #8b5cf6;            /* Violet */
  --accent-modam-glow: rgba(139, 92, 246, 0.25);

  --topbar-bg: rgba(9, 11, 16, 0.78);
  --drawer-bg: rgba(15, 19, 29, 0.95);
  --footer-bg: #06080c;
  --grid-line: rgba(255, 255, 255, 0.025);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.45);
  --shadow-hard: var(--shadow-md);
  --shadow-hard-sm: var(--shadow-sm);
  --shadow-nav: 0 10px 30px rgba(0, 0, 0, 0.5);
  --glow-accent: 0 0 24px var(--accent-primary-glow);

  --font-fa: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-fa-display: "Vazirmatn", sans-serif;
  --font-en-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-en-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Inter", "Vazirmatn", ui-monospace, SFMono-Regular, monospace;

  --max-w: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-gap: clamp(64px, 10vw, 110px);
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Modern Tech — Light Mode ---- */
:root[data-theme="light"] {
  --bg-dark: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(0, 0, 0, 0.035);
  --bg-glass-active: rgba(0, 0, 0, 0.07);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-on-accent: #ffffff;

  --border: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(99, 102, 241, 0.45);

  --accent-primary: #4f46e5;
  --accent-primary-hover: #4338ca;
  --accent-primary-glow: rgba(79, 70, 229, 0.2);
  --accent-indigo: var(--accent-primary);
  --accent-indigo-glow: var(--accent-primary-glow);

  --accent-kaghaz: #d97706;
  --accent-kaghaz-glow: rgba(217, 119, 6, 0.2);
  --accent-artilo: #e11d48;
  --accent-artilo-glow: rgba(225, 29, 72, 0.2);
  --accent-danak: #0891b2;
  --accent-danak-glow: rgba(8, 145, 178, 0.2);
  --accent-shakhes: #059669;
  --accent-shakhes-glow: rgba(5, 150, 105, 0.2);
  --accent-modam: #7c3aed;
  --accent-modam-glow: rgba(124, 58, 237, 0.2);

  --topbar-bg: rgba(248, 250, 252, 0.82);
  --drawer-bg: rgba(255, 255, 255, 0.98);
  --footer-bg: #f1f5f9;
  --grid-line: rgba(0, 0, 0, 0.03);

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 25px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px -10px rgba(15, 23, 42, 0.12);
  --shadow-hard: var(--shadow-md);
  --shadow-hard-sm: var(--shadow-sm);
  --shadow-nav: 0 8px 24px rgba(15, 23, 42, 0.06);
  --glow-accent: 0 0 20px var(--accent-primary-glow);
}

/* ---------- RESET & BASE ---------- */

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

html {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html[dir="rtl"] body {
  font-family: var(--font-fa);
}

html[dir="ltr"] body {
  font-family: var(--font-en-body);
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Ambient glow in background */
body::before {
  content: "";
  position: fixed;
  inset-block-start: -150px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  width: min(1000px, 95vw);
  height: 600px;
  background: radial-gradient(circle, var(--accent-primary-glow) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
}

:root[data-theme="light"] body::before {
  opacity: 0.45;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  line-height: 1.28;
  font-weight: 700;
}

html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4 {
  font-family: var(--font-fa-display);
  font-weight: 800;
}

html[dir="ltr"] h1, html[dir="ltr"] h2, html[dir="ltr"] h3, html[dir="ltr"] h4 {
  font-family: var(--font-en-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

.wrap {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 1;
}

::selection {
  background: var(--accent-primary);
  color: var(--text-on-accent);
}

:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

/* ---------- NAVBAR ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-block-end: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.topbar.scrolled {
  box-shadow: var(--shadow-nav);
  border-block-end-color: rgba(255, 255, 255, 0.12);
}

:root[data-theme="light"] .topbar.scrolled {
  border-block-end-color: rgba(15, 23, 42, 0.1);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 12px;
  gap: 16px;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  transition: transform 0.25s var(--ease-smooth);
}

.nav-logo:hover {
  transform: translateY(-1px);
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-primary) 0%, #a855f7 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.04em;
  box-shadow: 0 4px 14px var(--accent-primary-glow);
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.nav-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* Desktop Navigation (visible on screen > 820px) */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-glass);
  padding: 4px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.nav-desktop .nav-link {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.25s var(--ease-smooth);
}

.nav-desktop .nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-glass-active);
}

.nav-desktop .nav-link.active {
  color: #ffffff;
  background: var(--accent-primary);
  box-shadow: 0 2px 12px var(--accent-primary-glow);
}

/* Nav Actions (Theme, Lang, Mobile toggle) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-toggle {
  display: inline-flex;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  transition: all 0.22s var(--ease-smooth);
}

.lang-btn[aria-pressed="true"] {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--accent-primary-glow);
}

.lang-btn:hover:not([aria-pressed="true"]) {
  color: var(--text-primary);
}

/* Theme Toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-secondary);
  transition: all 0.25s var(--ease-smooth);
}

.theme-toggle:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-glass-active);
  transform: translateY(-1px);
}

.theme-toggle:active {
  transform: scale(0.94);
}

.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Mobile Hamburger Toggle */
.mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-primary);
  transition: all 0.2s var(--ease-smooth);
}

.mobile-toggle:hover {
  background: var(--bg-glass-active);
  border-color: var(--accent-primary);
}

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

.mobile-toggle .icon-close { display: none; }
.mobile-toggle[aria-expanded="true"] .icon-hamburger { display: none; }
.mobile-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Mobile Navigation Drawer & Backdrop */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1990;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.nav-menu {
  display: none;
}

@media (max-width: 820px) {
  .nav-desktop {
    display: none;
  }

  .mobile-toggle {
    display: inline-flex;
  }

  .nav-menu {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(340px, 86vw);
    z-index: 2000;
    background: var(--drawer-bg);
    border-inline-start: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    padding: 24px;
    transform: translateX(100%);
    transition: transform 0.32s var(--ease-smooth);
    visibility: hidden;
    overflow-y: auto;
  }

  html[dir="ltr"] .nav-menu {
    transform: translateX(100%);
  }

  html[dir="rtl"] .nav-menu {
    transform: translateX(-100%);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.6);
    border-inline-start: none;
    border-inline-end: 1px solid var(--border);
  }

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

  .nav-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block-end: 20px;
    border-block-end: 1px solid var(--border);
    margin-block-end: 16px;
  }

  .nav-menu-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-glass);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    line-height: 1;
    transition: all 0.2s ease;
  }

  .nav-menu-close:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
  }

  .nav-menu-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    padding-block: 8px;
  }

  .nav-menu-body .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    transition: all 0.22s var(--ease-smooth);
    min-height: 48px;
  }

  .nav-menu-body .nav-link:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
    transform: translateX(4px);
  }

  html[dir="rtl"] .nav-menu-body .nav-link:hover {
    transform: translateX(-4px);
  }

  .nav-menu-body .nav-link.active {
    background: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 4px 16px var(--accent-primary-glow);
  }

  .nav-menu-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-block-start: 20px;
    border-block-start: 1px solid var(--border);
    margin-block-start: auto;
  }

  .nav-menu-foot .lang-toggle {
    width: 100%;
    display: flex;
  }

  .nav-menu-foot .lang-btn {
    flex: 1;
    text-align: center;
    padding-block: 8px;
    font-size: 0.9rem;
  }
}

body.nav-locked {
  overflow: hidden;
}

/* ---------- BUTTONS ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--ease-smooth);
  white-space: nowrap;
  min-height: 46px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, #7c3aed 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 18px var(--accent-primary-glow);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.45);
  border-color: rgba(255, 255, 255, 0.35);
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Store Badges (Myket / Cafe Bazaar) */
.store-badges {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--ease-smooth);
  min-height: 48px;
}

.store-badge:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.store-badge img {
  height: 28px;
  width: auto;
  display: block;
}

/* ---------- BADGES & HEADINGS ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.25);
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent-primary);
  margin-bottom: 20px;
  letter-spacing: 0;
}

:root[data-theme="light"] .badge {
  background: rgba(79, 70, 229, 0.06);
  border-color: rgba(79, 70, 229, 0.2);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-primary);
  flex-shrink: 0;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-primary);
  margin-bottom: 12px;
}

.section-eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  flex-shrink: 0;
}

.section-title {
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  line-height: 1.25;
  color: var(--text-primary);
}

.section-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin-bottom: 44px;
  line-height: 1.8;
}

/* ---------- HERO SECTION ---------- */

.hero {
  padding-block: clamp(60px, 12vw, 130px) clamp(50px, 8vw, 90px);
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(36px, 5vw, 64px);
  align-items: center;
}

.hero-title {
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
  color: var(--text-primary);
}

.gradient-text {
  color: var(--text-primary);
}

.highlight-text {
  background: linear-gradient(135deg, var(--accent-primary) 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 1.8vw, 1.22rem);
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 34px;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-size: 1.95rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
}

.stat-lbl {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Hero Cards / App Showcase Visual */
.hero-visual {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.hero-visual .preview-card:nth-child(5) {
  grid-column: span 2;
}

.preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease-smooth);
}

.preview-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: 0;
  width: 3px;
  background: var(--accent-primary);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.preview-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md), 0 0 16px var(--accent-primary-glow);
}

.preview-card:hover::before {
  opacity: 1;
}

.preview-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--bg-surface);
  transition: transform 0.3s var(--ease-bounce);
}

.preview-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-card:hover .preview-icon {
  transform: scale(1.08) rotate(-2deg);
}

.preview-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

/* ---------- APP SHOWCASE CARDS ---------- */

.app-showcase {
  padding-block: var(--section-gap);
  border-top: 1px solid var(--border);
  position: relative;
}

.app-card-featured {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 5vw, 44px);
  margin-bottom: 40px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  transition: all 0.35s var(--ease-smooth);
}

/* Color Accent Bars for App Cards */
.app-card-featured::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  background: var(--accent-primary);
  opacity: 0.85;
}

.app-card-featured.card-kaghaz::before { background: var(--accent-kaghaz); }
.app-card-featured.card-artilo::before { background: var(--accent-artilo); }
.app-card-featured.card-danak::before { background: var(--accent-danak); }
.app-card-featured.card-shakhes::before { background: var(--accent-shakhes); }
.app-card-featured.card-modam::before { background: var(--accent-modam); }

.app-card-featured:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

:root[data-theme="light"] .app-card-featured:hover {
  border-color: rgba(15, 23, 42, 0.15);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.app-logo-img {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--bg-surface);
  transition: transform 0.35s var(--ease-bounce);
}

.app-brand:hover .app-logo-img {
  transform: scale(1.06) rotate(-2deg);
}

.app-meta h3 {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.app-category {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.app-category.kaghaz { color: var(--accent-kaghaz); }
.app-category.artilo { color: var(--accent-artilo); }
.app-category.danak { color: var(--accent-danak); }
.app-category.shakhes { color: var(--accent-shakhes); }
.app-category.modam { color: var(--accent-modam); }

.app-card-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.85;
  max-width: 820px;
  margin-bottom: 28px;
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--text-secondary);
  font-weight: 600;
  transition: all 0.22s ease;
}

.pill svg {
  color: var(--accent-primary);
  flex-shrink: 0;
}

.pill:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  background: var(--bg-glass-active);
}

/* Gallery Grid & Mobile Swipe Carousel */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.screenshot-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  aspect-ratio: 9/16;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform 0.35s var(--ease-smooth), border-color 0.25s ease, box-shadow 0.35s var(--ease-smooth);
}

.screenshot-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease-smooth);
}

.screenshot-item:hover {
  border-color: var(--accent-primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), 0 0 16px var(--accent-primary-glow);
}

.screenshot-item:hover img {
  transform: scale(1.04);
}

/* Mobile Android Screen Swipe Carousel for Screenshots (<= 680px) */
@media (max-width: 680px) {
  .gallery-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 14px;
    padding-block-end: 12px;
    margin-inline: -12px;
    padding-inline: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }

  .gallery-grid::-webkit-scrollbar {
    height: 4px;
  }

  .gallery-grid::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
  }

  .screenshot-item {
    flex: 0 0 74%;
    max-width: 250px;
    scroll-snap-align: center;
    border-radius: var(--radius-md);
  }
}

/* ---------- ABOUT & DEVELOPER SECTION ---------- */

.about-section {
  padding-block: var(--section-gap);
  border-top: 1px solid var(--border);
}

.about-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(28px, 5vw, 52px);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(24px, 5vw, 48px);
  align-items: center;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.profile-avatar {
  width: 190px;
  height: 190px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-md);
  margin: 0 auto;
}

.avatar-placeholder {
  width: 190px;
  height: 190px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en-display);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--accent-primary);
  margin: 0 auto;
}

.about-bio {
  font-size: 1.08rem;
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 24px;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.tech-tag {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--text-secondary);
  font-weight: 600;
  transition: all 0.2s ease;
}

.tech-tag:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-glass-active);
  transform: translateY(-1px);
}

/* ---------- APP DETAIL HERO & SPECIFIC PAGES ---------- */

.page-hero {
  padding-block: clamp(60px, 10vw, 110px) clamp(40px, 6vw, 70px);
  position: relative;
}

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

.app-hero-logo {
  width: 170px;
  height: 170px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-lg);
  margin: 0 auto;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-block: 40px;
}

.spec-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s var(--ease-smooth);
}

.spec-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md), 0 0 16px var(--accent-primary-glow);
}

.spec-card h4 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.spec-card p {
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ---------- RESUME TIMELINE & SKILLS (dev.html) ---------- */

.timeline-container {
  position: relative;
  max-width: 820px;
  margin: 0 auto 50px;
}

.timeline-container::before {
  content: "";
  position: absolute;
  inset-inline-start: 16px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--border);
}

.timeline-card-item {
  position: relative;
  padding-inline-start: 48px;
  margin-bottom: 32px;
}

.timeline-card-dot {
  position: absolute;
  inset-inline-start: 9px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 3px solid var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-primary-glow);
}

.timeline-card-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.25s var(--ease-smooth);
}

.timeline-card-item:hover .timeline-card-content {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.timeline-date-tag {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 6px;
}

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

.skill-category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s var(--ease-smooth);
}

.skill-category-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.skill-category-card h4 {
  font-size: 1.15rem;
  margin-bottom: 18px;
  color: var(--text-primary);
}

/* ---------- CONTACT SECTION ---------- */

.contact-section {
  padding-block: var(--section-gap);
  border-top: 1px solid var(--border);
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(36px, 6vw, 64px);
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.contact-buttons {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.contact-btn-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--ease-smooth);
  min-height: 48px;
}

.contact-btn-item:hover {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 18px var(--accent-primary-glow);
}

/* ---------- FOOTER ---------- */

.footer {
  border-top: 1px solid var(--border);
  background: var(--footer-bg);
  padding-block: 56px 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 12px;
  max-width: 280px;
  line-height: 1.7;
}

.footer-col h5 {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-col a:hover {
  color: var(--accent-primary);
  transform: translateX(2px);
}

html[dir="rtl"] .footer-col a:hover {
  transform: translateX(-2px);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- LIGHTBOX / MODAL ---------- */

.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(4, 6, 10, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  display: flex;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  object-fit: contain;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.3s var(--ease-smooth);
}

.lightbox-modal.active .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  inset-inline-end: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.lightbox-close:hover {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

/* ---------- SCROLL REVEAL ANIMATIONS ---------- */

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  will-change: opacity, transform;
}

.reveal-on-scroll:not(.visible) {
  transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
}

.reveal-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- FAQ ACCORDION ---------- */

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 28px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--ease-smooth);
}

.faq-item[open] {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md), 0 0 16px var(--accent-primary-glow);
}

.faq-question {
  padding: 18px 22px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  user-select: none;
}

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

.faq-question::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--accent-primary);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-smooth);
}

.faq-item[open] .faq-question::after {
  content: "−";
  background: var(--accent-primary);
  color: #ffffff;
}

.faq-answer {
  padding: 0 22px 20px 22px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.85;
}

/* ---------- CARD ACTIONS ---------- */

.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* =============================================================
   RESPONSIVE BREAKPOINTS (Mobile Android & Tablet Optimizations)
   ============================================================= */

#apps, #about, #contact, .faq-section {
  scroll-margin-top: 80px;
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-visual {
    max-width: 580px;
    margin: 0 auto;
    width: 100%;
  }

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

  .app-hero-logo {
    margin-bottom: 20px;
  }

  .about-box {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-avatar, .avatar-placeholder {
    margin-inline: auto;
  }

  .tech-tags {
    justify-content: center;
  }
}

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

  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 2.2rem;
  }

  .section-title {
    font-size: 1.85rem;
  }

  .hero-stats {
    gap: 16px;
    justify-content: space-between;
  }

  .stat-val {
    font-size: 1.6rem;
  }

  .hero-visual {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hero-visual .preview-card:nth-child(5) {
    grid-column: auto;
  }

  .preview-card {
    padding: 12px 14px;
    gap: 12px;
  }

  .preview-icon {
    width: 44px;
    height: 44px;
  }

  .app-card-featured {
    padding: 20px 16px;
    margin-bottom: 28px;
    border-radius: var(--radius-lg);
  }

  .app-brand {
    gap: 12px;
  }

  .app-logo-img {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
  }

  .app-meta h3 {
    font-size: 1.25rem;
  }

  .feature-pills {
    gap: 6px;
  }

  .pill {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .card-actions {
    width: 100%;
  }

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

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

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

  .hero-actions .store-badges {
    width: 100%;
  }

  .hero-actions .store-badge {
    width: 100%;
  }

  .contact-card {
    padding: 28px 20px;
  }

  .contact-buttons {
    flex-direction: column;
    width: 100%;
  }

  .contact-btn-item {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .topbar .wrap {
    padding-block: 10px;
  }

  .nav-name {
    font-size: 1.15rem;
  }

  .logo-icon {
    width: 34px;
    height: 34px;
    font-size: 0.88rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-brand p {
    margin-inline: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
