/* ==========================================================================
   APK Store - Main Stylesheet (v2 - professional redesign)
   ========================================================================== */

:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #60a5fa;
  --color-accent: #22c55e;
  --color-accent-dark: #16a34a;
  --color-violet: #7c3aed;
  --color-text: #1a1f2b;
  --color-text-light: #6b7280;
  --color-bg: #ffffff;
  --color-bg-alt: #f6f8fb;
  --color-surface: #ffffff;
  --color-border: #e6e9ef;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-hover: 0 16px 32px -12px rgba(37,99,235,0.22);
  --shadow-card: 0 2px 10px rgba(15,23,42,0.06);
  --container-width: 1180px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Sora', var(--font);
  color-scheme: light;
  transition: background-color .25s ease, color .25s ease;
}

[data-theme="dark"] {
  --color-text: #e7eaf3;
  --color-text-light: #9aa3b5;
  --color-bg: #0b1120;
  --color-bg-alt: #131b2e;
  --color-surface: #161f34;
  --color-border: #232d45;
  --shadow: 0 1px 3px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.25);
  --shadow-hover: 0 16px 32px -12px rgba(0,0,0,0.55);
  --shadow-card: 0 2px 10px rgba(0,0,0,0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  animation: fadeInUp .4s ease both;
}

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

a { color: var(--color-primary); text-decoration: none; transition: color .15s ease; }
a:hover { text-decoration: none; color: var(--color-primary-dark); }

h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.01em; }

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Scroll-reveal animation helper ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s cubic-bezier(.22,.68,0,1.01), transform .6s cubic-bezier(.22,.68,0,1.01);
}
.reveal-visible { opacity: 1; transform: translateY(0); }

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(3deg); }
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.45); }
  70% { box-shadow: 0 0 0 12px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(10px);
  position: sticky;
  top: 0;
  z-index: 200;
  transition: box-shadow .2s ease, background-color .25s ease;
}
[data-theme="dark"] .site-header { background: rgba(11,17,32,0.85); }
.site-header.scrolled { box-shadow: 0 4px 20px rgba(15,23,42,0.06); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(120deg, var(--color-primary), var(--color-violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo:hover { text-decoration: none; }
.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
.main-nav a { color: var(--color-text); font-weight: 600; font-size: 0.95rem; position: relative; }
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--color-primary);
  transition: width .2s ease;
}
.main-nav a:hover::after { width: 100%; }
.nav-search { display: flex; align-items: center; gap: 4px; }
.nav-search input {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 9px 14px;
  width: 200px;
  font-size: 0.9rem;
  background: var(--color-bg-alt);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.nav-search input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.nav-search button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
}
.menu-toggle {
  display: none;
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
}
.theme-toggle {
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-left: 12px;
  position: relative;
  flex-shrink: 0;
  transition: transform .2s ease, background .2s ease;
}
.theme-toggle:hover { transform: rotate(15deg) scale(1.06); }
.theme-toggle span { position: absolute; font-size: 1.05rem; transition: opacity .2s ease, transform .2s ease; }
.theme-icon-dark { opacity: 0; transform: scale(.5) rotate(-40deg); }
.theme-icon-light { opacity: 1; transform: scale(1) rotate(0); }
[data-theme="dark"] .theme-icon-light { opacity: 0; transform: scale(.5) rotate(40deg); }
[data-theme="dark"] .theme-icon-dark { opacity: 1; transform: scale(1) rotate(0); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #1d4ed8, #2563eb, #7c3aed, #1d4ed8);
  background-size: 300% 300%;
  animation: gradientShift 14s ease infinite;
  color: #fff;
  padding: 90px 20px 110px;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  animation: floatSlow 7s ease-in-out infinite;
}
.hero::before { width: 260px; height: 260px; top: -70px; left: 4%; }
.hero::after { width: 190px; height: 190px; bottom: -60px; right: 8%; animation-delay: 1.5s; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 40px;
  position: relative;
  z-index: 2;
}
.hero-copy { text-align: left; }
.hero h1 { font-family: var(--font-display); font-size: 2.7rem; margin: 0 0 14px; animation: fadeInUp .7s ease both; }
.hero p { font-size: 1.12rem; opacity: 0.92; margin: 0 0 32px; max-width: 480px; animation: fadeInUp .7s .1s ease both; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 18px;
  animation: fadeInUp .6s ease both;
}
.text-gradient {
  background: linear-gradient(120deg, #fff, #bfdbfe, #fff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 5s linear infinite;
}
.hero-search, .nav-search {
  display: flex;
  max-width: 480px;
  margin: 0;
  animation: fadeInUp .7s .2s ease both;
}
.hero-search input {
  flex: 1;
  padding: 15px 20px;
  border-radius: 999px 0 0 999px;
  border: none;
  font-size: 1rem;
}
.hero-search input:focus { outline: none; }
.hero-search button {
  padding: 15px 30px;
  border: none;
  border-radius: 0 999px 999px 0;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.hero-search button:hover { background: var(--color-accent-dark); transform: translateY(-1px); }

/* ---------- Hero visual (CSS phone mockup) ---------- */
.hero-visual { position: relative; display: flex; justify-content: center; align-items: center; min-height: 340px; }
.hero-phone {
  width: 230px;
  height: 320px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 34px;
  backdrop-filter: blur(6px);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.45);
  padding: 24px 18px 18px;
  animation: floatSlow 6s ease-in-out infinite;
  position: relative;
}
.hero-phone-notch { width: 60px; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.5); margin: 0 auto 22px; }
.hero-phone-app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hero-app-tile {
  aspect-ratio: 1;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
  animation: fadeInUp .6s ease both;
}
.hero-tile-1 { background: linear-gradient(135deg,#fca5a5,#f87171); animation-delay: .05s; }
.hero-tile-2 { background: linear-gradient(135deg,#93c5fd,#60a5fa); animation-delay: .1s; }
.hero-tile-3 { background: linear-gradient(135deg,#fcd34d,#fbbf24); animation-delay: .15s; }
.hero-tile-4 { background: linear-gradient(135deg,#c4b5fd,#a78bfa); animation-delay: .2s; }
.hero-tile-5 { background: linear-gradient(135deg,#6ee7b7,#34d399); animation-delay: .25s; }
.hero-tile-6 { background: linear-gradient(135deg,#fda4af,#fb7185); animation-delay: .3s; }
.hero-phone-bar { width: 90px; height: 5px; border-radius: 999px; background: rgba(255,255,255,0.5); margin: 22px auto 0; }
.hero-float-card {
  position: absolute;
  background: #fff;
  color: var(--color-text);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 999px;
  box-shadow: 0 12px 26px -8px rgba(0,0,0,0.35);
  animation: floatSlow 5s ease-in-out infinite;
  white-space: nowrap;
}
.hero-float-1 { top: 6%; right: -4%; animation-delay: .3s; }
.hero-float-2 { bottom: 18%; left: -10%; animation-delay: 1s; }
.hero-float-3 { bottom: -2%; right: 6%; animation-delay: 1.7s; }
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 34px;
  margin-top: -30px;
  position: relative;
  z-index: 5;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 20px 24px;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-text);
}
.trust-icon { font-size: 1.15rem; }

/* ---------- Stats strip (legacy, unused but harmless if referenced) ---------- */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: -56px;
  position: relative;
  z-index: 5;
}
.stat-tile {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 22px 16px;
  text-align: center;
}
.stat-tile .stat-num { display: block; font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; color: var(--color-primary); }
.stat-tile .stat-lbl { font-size: 0.82rem; color: var(--color-text-light); font-weight: 600; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-title { font-size: 1.5rem; margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; position: relative; padding-bottom: 12px; }
.section-title::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 46px; height: 4px;
  border-radius: 4px;
  background: linear-gradient(120deg, var(--color-primary), var(--color-violet));
}
.section-title .view-all { font-size: 0.85rem; font-weight: 700; color: var(--color-primary); }
.page-title { font-size: 1.9rem; margin-bottom: 8px; }
.page-subtitle { color: var(--color-text-light); margin-bottom: 24px; }

.page-hero {
  background: linear-gradient(120deg, #eef2ff, #f5f3ff);
  padding: 64px 0 44px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}
[data-theme="dark"] .page-hero,
[data-theme="dark"] .page-hero-blog {
  background: linear-gradient(120deg, #131b2e, #1b1436);
}
.page-hero .eyebrow {
  display: inline-block;
  background: rgba(37,99,235,0.1);
  color: var(--color-primary);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.page-hero h1 { font-size: 2.2rem; margin: 0 0 10px; }
.page-hero p { color: var(--color-text-light); max-width: 560px; margin: 0 auto; }

/* ---------- Category chips ---------- */
.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.category-chip {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  padding: 9px 18px;
  border-radius: 999px;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .15s ease;
  opacity: 0;
  animation: fadeInUp .5s ease both;
}
.category-chip span { font-size: 1rem; }
.category-chip:hover { background: var(--color-primary); color: #fff; text-decoration: none; border-color: var(--color-primary); transform: translateY(-3px) scale(1.03); box-shadow: 0 8px 16px -6px rgba(37,99,235,0.4); }

.category-grid-large { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.category-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  color: var(--color-text);
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.category-card::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, var(--color-primary), var(--color-violet));
  opacity: 0;
  transition: opacity .2s ease;
  z-index: 0;
}
.category-card:hover { box-shadow: var(--shadow-hover); text-decoration: none; transform: translateY(-4px); }
.category-card h3, .category-card p, .category-card .category-count { position: relative; z-index: 1; }
.category-card h3 { margin: 0 0 6px; }
.category-card p { color: var(--color-text-light); font-size: 0.9rem; margin: 0 0 30px; }
.category-count { position: absolute; bottom: 16px; left: 22px; font-size: 0.8rem; color: var(--color-primary); font-weight: 700; }

/* ---------- App grid / cards ---------- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.app-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-card);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.app-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); border-color: rgba(37,99,235,0.25); }
.app-card-link { display: flex; gap: 12px; align-items: center; color: inherit; }
.app-card-link:hover { text-decoration: none; }
.app-icon {
  width: 58px; height: 58px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--color-bg-alt);
  flex-shrink: 0;
  box-shadow: var(--shadow);
  transition: transform .25s ease;
}
.app-card:hover .app-icon { transform: rotate(-4deg) scale(1.06); }
.app-name { margin: 0; font-size: 1rem; font-weight: 700; }
.app-meta { margin: 4px 0 0; font-size: 0.82rem; color: var(--color-text-light); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-20deg);
  transition: left .5s ease;
}
.btn:hover::before { left: 130%; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(120deg, var(--color-primary), var(--color-primary-dark)); color: #fff; box-shadow: 0 8px 18px -8px rgba(37,99,235,0.55); }
.btn-primary:hover { box-shadow: 0 10px 22px -6px rgba(37,99,235,0.6); }
.btn-secondary { background: var(--color-bg-alt); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-download { background: linear-gradient(120deg, var(--color-accent), var(--color-accent-dark)); color: #fff; animation: pulseRing 2.4s infinite; }
.btn-download:hover { opacity: .95; }
.btn-large { padding: 15px 34px; font-size: 1.05rem; }
.btn-block { display: block; width: 100%; }
.btn-danger { background: #fee2e2; color: #b91c1c; }

/* ---------- Filter bar ---------- */
.filter-bar { display: flex; gap: 12px; margin-bottom: 24px; }
.filter-bar select {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.page-link {
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-weight: 600;
  transition: all .15s ease;
}
.page-link.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.page-link:hover { text-decoration: none; background: var(--color-bg-alt); }

/* ---------- App page ---------- */
.app-page { animation: fadeInUp .5s ease both; }
.app-hero {
  display: flex;
  gap: 26px;
  align-items: center;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.app-hero-icon { width: 116px; height: 116px; border-radius: 28px; object-fit: cover; background: var(--color-bg-alt); box-shadow: var(--shadow-hover); }
.app-hero-info h1 { margin: 0 0 6px; font-size: 1.9rem; }
.app-hero-meta { margin: 2px 0; color: var(--color-text-light); }
.app-hero-info .btn { margin-top: 16px; }

.screenshot-gallery {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 26px 0;
  scroll-snap-type: x mandatory;
}
.screenshot-gallery img {
  height: 420px;
  border-radius: var(--radius);
  scroll-snap-align: start;
  flex-shrink: 0;
  box-shadow: var(--shadow-card);
  transition: transform .2s ease;
}
.screenshot-gallery img:hover { transform: scale(1.02); }

.lightbox {
  position: fixed; inset: 0;
  background: rgba(10,12,20,0.9);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
  z-index: 999; cursor: zoom-out;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-height: 88vh; max-width: 92vw; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }

.app-content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; margin-top: 24px; }
.content-block { margin-bottom: 34px; }
.content-block h2 { font-size: 1.3rem; margin-bottom: 14px; }
.feature-list { padding-left: 20px; }
.feature-list li { margin-bottom: 6px; }
.install-guide { padding-left: 20px; }
.notice { font-size: 0.85rem; color: var(--color-text-light); background: var(--color-bg-alt); padding: 12px 16px; border-radius: var(--radius-sm); }

details { border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 10px; transition: border-color .15s ease; }
details[open] { border-color: rgba(37,99,235,0.3); }
details summary { cursor: pointer; font-weight: 700; }

.info-box { background: var(--color-bg-alt); border-radius: var(--radius); padding: 22px; position: sticky; top: 92px; }
.info-box h3 { margin-top: 0; }
.info-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.info-table th, .info-table td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; }
.info-table th { color: var(--color-text-light); font-weight: 500; width: 40%; }

/* ---------- Blog ---------- */
.page-hero-blog { background: linear-gradient(120deg, #eff6ff, #f5f3ff); }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.blog-card {
  display: flex; flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  box-shadow: var(--shadow-card);
  transition: transform .2s ease, box-shadow .2s ease;
}
.blog-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); text-decoration: none; }
.blog-card-cover { height: 170px; background-size: cover; background-position: center; background-color: var(--color-bg-alt); }
.blog-card-body { padding: 18px 20px 22px; }
.blog-card-date { font-size: 0.78rem; color: var(--color-text-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.blog-card-body h2 { font-size: 1.08rem; margin: 8px 0 8px; }
.blog-card-body p { font-size: 0.9rem; color: var(--color-text-light); margin: 0 0 10px; }
.blog-card-readmore { font-size: 0.85rem; font-weight: 700; color: var(--color-primary); }

.blog-post-page { max-width: 880px; }
.blog-post-header { text-align: center; margin-bottom: 26px; }
.blog-post-header h1 { font-size: 2.1rem; margin: 10px 0; }
.blog-post-meta { color: var(--color-text-light); font-size: 0.9rem; }
.blog-post-cover { height: 340px; background-size: cover; background-position: center; border-radius: var(--radius); box-shadow: var(--shadow-card); margin-bottom: 30px; }
.blog-post-grid { display: grid; grid-template-columns: 2.4fr 1fr; gap: 40px; }
.blog-post-content { font-size: 1.03rem; line-height: 1.8; }
.back-link { display: inline-block; margin-bottom: 14px; font-size: 0.9rem; font-weight: 600; }

/* ---------- Static pages ---------- */
.static-page { max-width: 760px; }
.static-page h1 { margin-bottom: 20px; }
.static-page h2 { margin-top: 28px; }

/* ---------- Footer ---------- */
.site-footer { background: #0f172a; color: #cbd5e1; margin-top: 70px; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  padding: 52px 0 26px;
}
.footer-col h4 { margin-bottom: 14px; color: #fff; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: #94a3b8; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding: 18px 0; font-size: 0.85rem; color: #64748b; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .app-content-grid, .blog-post-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { text-align: center; }
  .hero p { margin-left: auto; margin-right: auto; }
  .hero-search { margin: 0 auto; }
  .hero-visual { margin-top: 20px; min-height: 280px; }
}

@media (max-width: 640px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: var(--color-surface);
    flex-direction: column;
    align-items: stretch;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    gap: 14px;
    box-shadow: 0 12px 24px rgba(15,23,42,0.08);
  }
  .main-nav.open { display: flex; }
  .menu-toggle { display: block; }
  .nav-search { max-width: none; }
  .nav-search input { width: 100%; }
  .hero { padding: 60px 20px 80px; }
  .hero h1 { font-size: 1.9rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .app-hero { flex-direction: column; text-align: center; }
  .app-hero-meta { justify-content: center; }
  .screenshot-gallery img { height: 300px; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
}

/* --------------------------------------------------------------------
   Store layout (APK-store style homepage: main column + sidebar)
   -------------------------------------------------------------------- */
.store-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
  align-items: start;
}
.store-main { min-width: 0; }
.section-block { margin-bottom: 42px; }

/* ---------- Hero carousel ---------- */
.hero-carousel {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  aspect-ratio: 16 / 7;
  min-height: 220px;
  background: linear-gradient(120deg, var(--color-primary), var(--color-violet));
}
.hero-carousel-track { position: relative; width: 100%; height: 100%; }
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  transition: opacity .5s ease;
  background-size: cover;
  background-position: center;
  display: flex; align-items: flex-end;
}
.hero-slide.active { opacity: 1; pointer-events: auto; }
.hero-slide-inner {
  display: flex; align-items: center; gap: 18px;
  padding: 28px;
  width: 100%;
  background: linear-gradient(0deg, rgba(0,0,0,0.55), transparent 70%);
}
.hero-slide-icon { width: 76px; height: 76px; border-radius: 20px; box-shadow: 0 10px 24px rgba(0,0,0,0.35); flex-shrink: 0; }
.hero-slide-info { color: #fff; }
.hero-slide-tag {
  display: inline-block; background: rgba(255,255,255,0.22); padding: 3px 12px;
  border-radius: 999px; font-size: 0.72rem; font-weight: 700; margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: .04em;
}
.hero-slide-info h2 { font-size: 1.5rem; margin: 0 0 6px; font-family: var(--font-display); }
.hero-slide-info p { margin: 0 0 12px; font-size: 0.88rem; opacity: 0.9; }
.hero-carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.85); color: var(--color-text);
  font-size: 1.4rem; line-height: 1; cursor: pointer; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, transform .15s ease;
}
.hero-carousel-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.hero-arrow-prev { left: 14px; }
.hero-arrow-next { right: 14px; }
.hero-carousel-dots { position: absolute; bottom: 14px; right: 20px; display: flex; gap: 6px; z-index: 5; }
.hero-dot { width: 8px; height: 8px; border-radius: 50%; border: none; background: rgba(255,255,255,0.5); cursor: pointer; padding: 0; transition: all .2s ease; }
.hero-dot.active { background: #fff; width: 20px; border-radius: 4px; }

/* ---------- Icon row (Discover / Popular apps) ---------- */
.icon-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 16px;
}
.icon-item {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 6px; color: var(--color-text);
  transition: transform .15s ease;
}
.icon-item:hover { text-decoration: none; transform: translateY(-3px); }
.icon-item-img, .icon-item-emoji {
  width: 60px; height: 60px; border-radius: 18px;
  object-fit: cover; background: var(--color-bg-alt);
  box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.icon-item-name { font-size: 0.78rem; font-weight: 600; line-height: 1.25; }
.icon-item-meta { font-size: 0.7rem; color: var(--color-text-light); }

/* ---------- Latest update columns ---------- */
.update-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 24px;
}
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}
.list-row:hover { text-decoration: none; background: var(--color-bg-alt); border-radius: var(--radius-sm); padding-left: 6px; padding-right: 6px; margin-left: -6px; margin-right: -6px; }
.list-row-img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: var(--color-bg-alt); flex-shrink: 0; }
.list-row-body { min-width: 0; display: flex; flex-direction: column; }
.list-row-name { font-size: 0.88rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row-meta { font-size: 0.75rem; color: var(--color-text-light); }

/* ---------- Sidebar ---------- */
.store-sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.sidebar-widget-title { display: flex; align-items: center; justify-content: space-between; font-size: 1rem; margin: 0 0 14px; }
.sidebar-search { display: flex; margin-bottom: 14px; }
.sidebar-search input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--color-border);
  border-radius: 999px 0 0 999px; background: var(--color-bg-alt); color: var(--color-text);
}
.sidebar-search input:focus { outline: none; border-color: var(--color-primary); }
.sidebar-search button { border: none; background: var(--color-primary); color: #fff; padding: 0 16px; border-radius: 0 999px 999px 0; cursor: pointer; }
.sidebar-label { font-size: 0.78rem; font-weight: 700; color: var(--color-text-light); text-transform: uppercase; letter-spacing: .03em; margin: 0 0 10px; }
.sidebar-tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sidebar-tag { background: var(--color-bg-alt); border: 1px solid var(--color-border); padding: 6px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; color: var(--color-text); }
.sidebar-tag:hover { background: var(--color-primary); color: #fff; text-decoration: none; }
.sidebar-promo { background: linear-gradient(135deg, var(--color-primary), var(--color-violet)); color: #fff; border: none; }
.sidebar-promo h3 { margin: 0 0 6px; font-family: var(--font-display); }
.sidebar-promo p { margin: 0 0 14px; font-size: 0.88rem; opacity: 0.92; }
.sidebar-trust-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; font-weight: 600; }
.sidebar-app-list { display: flex; flex-direction: column; gap: 4px; }
.sidebar-app-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--color-text); border-radius: var(--radius-sm); }
.sidebar-app-row:hover { text-decoration: none; background: var(--color-bg-alt); }
.sidebar-app-icon { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: var(--color-bg-alt); flex-shrink: 0; }
.sidebar-app-info { display: flex; flex-direction: column; min-width: 0; }
.sidebar-app-name { font-size: 0.86rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-app-meta { font-size: 0.74rem; color: var(--color-text-light); }

@media (max-width: 960px) {
  .store-layout { grid-template-columns: 1fr; }
  .update-columns { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .update-columns { grid-template-columns: 1fr; }
  .icon-row { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .hero-carousel { aspect-ratio: 4 / 5; }
  .hero-slide-icon { width: 56px; height: 56px; }
  .hero-slide-info h2 { font-size: 1.15rem; }
}

/* --------------------------------------------------------------------
   Ad placement slots (site-wide + download-redirect page)
   Ad codes are injected via admin -> Settings -> Ad Placement.
   These wrappers just give consistent spacing/centering; they render
   nothing extra if the setting is empty (the PHP skips the whole block).
   -------------------------------------------------------------------- */
.ad-slot {
  max-width: 100%;
  margin: 24px auto;
  text-align: center;
  overflow: hidden;
}
.ad-slot::before {
  content: "Advertisement";
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-light);
  margin-bottom: 6px;
}
.ad-slot-header { margin: 0 0 8px; }
.ad-slot-footer { margin: 24px 0 0; }
.ad-slot-home-top { margin: 24px auto 0; }
.ad-slot-content { margin: 32px auto; }
.ad-slot-native { margin: 0 auto 32px; }
.ad-slot-sidebar { margin: 20px 0 0; }
.ad-slot-download { margin: 24px auto; }

/* Mobile sticky ad bar */
.ad-sticky-mobile {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -6px 20px rgba(15,23,42,0.08);
  z-index: 300;
  padding: 6px 34px 6px 10px;
  display: none;
}
.ad-sticky-mobile .ad-slot { margin: 0; }
.ad-sticky-mobile .ad-slot::before { display: none; }
.ad-sticky-close {
  position: absolute; top: 4px; right: 8px;
  border: none; background: var(--color-bg-alt);
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 0.9rem; line-height: 1; cursor: pointer;
  color: var(--color-text-light);
}
.ad-sticky-hidden { display: none !important; }
@media (max-width: 640px) {
  .ad-sticky-mobile { display: block; }
  body { padding-bottom: 62px; }
}

/* --------------------------------------------------------------------
   Download redirect (external / Google Drive link) page
   -------------------------------------------------------------------- */
.download-redirect-page { display: flex; justify-content: center; padding: 60px 20px; }
.download-redirect-box {
  max-width: 480px;
  width: 100%;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 44px 30px;
  box-shadow: var(--shadow-card);
  animation: fadeInUp .5s ease both;
}
.download-redirect-box .app-hero-icon { margin: 0 auto 16px; }
.download-redirect-box h1 { font-size: 1.4rem; margin-bottom: 8px; }
.download-redirect-box .btn-large { display: inline-block; margin: 20px 0 12px; }
.download-redirect-box .back-link { display: inline-block; margin-top: 18px; font-size: 0.9rem; }
.btn-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* =====================================================================
   SITEWIDE PROFESSIONAL PAGE POLISH
   Keeps the homepage visual language consistent across inner pages.
   ===================================================================== */
main > .section:not(.store-layout) {
  position: relative;
  animation: pageEnter .55s ease both;
}

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-title {
  font-size: clamp(1.8rem, 4vw, 2.35rem);
  font-weight: 800;
  line-height: 1.15;
  margin-top: 0;
  padding-bottom: 14px;
  position: relative;
}
.page-title::after {
  content: "";
  display: block;
  width: 54px;
  height: 4px;
  margin-top: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-violet));
  animation: expandLine .55s ease both;
}
@keyframes expandLine { from { width: 0; opacity: 0; } to { width: 54px; opacity: 1; } }

.static-page,
.blog-post-page {
  max-width: 920px;
}
.static-page {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  padding: 42px 46px;
  margin-top: 48px;
  margin-bottom: 48px;
}
.static-page p,
.static-page li,
.blog-post-content p,
.blog-post-content li {
  color: var(--color-text-light);
  line-height: 1.8;
}
.static-page h2,
.static-page h3,
.blog-post-content h2,
.blog-post-content h3 {
  margin-top: 30px;
  color: var(--color-text);
}

.filter-bar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: 12px;
  box-shadow: var(--shadow-card);
  align-items: center;
}
.filter-bar select {
  min-height: 42px;
  color: var(--color-text);
}

.app-grid .app-card,
.category-grid-large .category-card,
.blog-grid .blog-card,
.content-block,
.info-box,
.install-guide,
.notice,
.download-redirect-box {
  animation: cardEnter .55s ease both;
}
.app-grid .app-card:nth-child(2n),
.category-grid-large .category-card:nth-child(2n),
.blog-grid .blog-card:nth-child(2n) { animation-delay: .06s; }
.app-grid .app-card:nth-child(3n),
.category-grid-large .category-card:nth-child(3n),
.blog-grid .blog-card:nth-child(3n) { animation-delay: .12s; }
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.category-card {
  min-height: 155px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: linear-gradient(145deg, var(--color-surface), var(--color-bg-alt));
}
.category-card:hover::before { opacity: .06; }
.category-card::after {
  content: "→";
  position: absolute;
  right: 18px;
  bottom: 14px;
  font-size: 1.1rem;
  color: var(--color-primary);
  transition: transform .2s ease;
}
.category-card:hover::after { transform: translateX(5px); }

.blog-grid {
  gap: 22px;
}
.blog-card {
  border: 1px solid var(--color-border);
  border-radius: 20px;
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.blog-card:hover {
  transform: translateY(-7px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(37,99,235,.22);
}
.blog-card-cover {
  transition: transform .5s ease;
}
.blog-card:hover .blog-card-cover { transform: scale(1.045); }
.blog-card-body { padding: 20px; }

.app-page {
  max-width: 1120px;
}
.app-hero {
  background: linear-gradient(145deg, var(--color-surface), var(--color-bg-alt));
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 30px;
  box-shadow: var(--shadow-card);
}
.app-hero-icon {
  transition: transform .3s ease, box-shadow .3s ease;
}
.app-hero:hover .app-hero-icon {
  transform: translateY(-4px) rotate(-2deg) scale(1.03);
  box-shadow: var(--shadow-hover);
}
.app-content-grid {
  gap: 26px;
}
.content-block,
.info-box,
.install-guide,
.notice {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}
.content-block { padding: 24px; }
.info-box { padding: 20px; }
.install-guide { padding: 24px; }
.notice { padding: 16px 20px; }

.screenshot-gallery img {
  transition: transform .3s ease, box-shadow .3s ease;
}
.screenshot-gallery img:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: var(--shadow-hover);
}

.blog-post-page {
  max-width: 1120px;
}
.blog-post-header {
  background: linear-gradient(145deg, #eef2ff, #f5f3ff);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 36px;
  margin-bottom: 26px;
}
[data-theme="dark"] .blog-post-header {
  background: linear-gradient(145deg, #131b2e, #1b1436);
}
.blog-post-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.12;
  margin: 8px 0 14px;
}
.blog-post-cover {
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-hover);
}
.blog-post-grid {
  gap: 28px;
}
.blog-post-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 22px;
  padding: 32px;
  box-shadow: var(--shadow-card);
}

.search-results-header {
  background: linear-gradient(145deg, var(--color-bg-alt), var(--color-surface));
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 24px;
}

.download-redirect-page {
  min-height: 58vh;
  align-items: center;
}
.download-redirect-box {
  border-radius: 24px;
  box-shadow: var(--shadow-hover);
  background: linear-gradient(145deg, var(--color-surface), var(--color-bg-alt));
}

.site-footer {
  margin-top: 50px;
  background: linear-gradient(145deg, #0f172a, #172554);
  color: #dbeafe;
  border-top: none;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(96,165,250,.08);
  top: -150px;
  right: 8%;
  animation: floatSlow 8s ease-in-out infinite;
}
.site-footer a { color: #bfdbfe; transition: color .2s ease, transform .2s ease; }
.site-footer a:hover { color: #fff; }
.site-footer h4 { color: #fff; }

@media (max-width: 760px) {
  .static-page { padding: 28px 22px; margin-top: 28px; margin-bottom: 28px; border-radius: 18px; }
  .app-hero { padding: 22px; border-radius: 18px; }
  .blog-post-header { padding: 26px 20px; border-radius: 18px; }
  .blog-post-content { padding: 24px 20px; border-radius: 18px; }
  .filter-bar { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
