/* ============================================================
   AppsMacHub — Mac App Store inspired redesign
   Topbar nav · Discovery home · Chips filter · Site footer
   ============================================================ */

:root {
  /* Surfaces */
  --bg-app: #0f0f10;
  --bg-app-2: #18181b;
  --bg-elev-1: rgba(255, 255, 255, 0.04);
  --bg-elev-2: rgba(255, 255, 255, 0.06);
  --bg-glass: rgba(20, 20, 22, 0.65);
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-topbar: rgba(18, 18, 20, 0.72);

  /* Borders */
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.14);

  /* Text */
  --text-main: #f5f5f7;
  --text-secondary: rgba(235, 235, 245, 0.68);
  --text-tertiary: rgba(235, 235, 245, 0.5);
  --text-disabled: rgba(235, 235, 245, 0.28);

  /* Accents */
  --accent: #0a84ff;
  --accent-hover: #409cff;
  --accent-press: #0066cc;
  --accent-soft: rgba(10, 132, 255, 0.18);
  --accent-fg: #ffffff;

  --pink: #ff375f;
  --orange: #ff9f0a;
  --green: #30d158;
  --purple: #bf5af2;
  --teal: #64d2ff;
  --indigo: #5e5ce6;

  /* Compat aliases */
  --neon-blue: var(--accent);
  --neon-purple: var(--accent-hover);
  --neon-pink: var(--accent-hover);
  --neon-violet: var(--accent);
  --border-glow: var(--hairline);

  /* Gradients */
  --grad-accent: linear-gradient(135deg, #0a84ff 0%, #5e5ce6 100%);
  --grad-bg:
    radial-gradient(1400px 900px at 100% -10%, rgba(94, 92, 230, 0.16), transparent 55%),
    radial-gradient(1100px 700px at -10% 110%, rgba(10, 132, 255, 0.12), transparent 55%),
    linear-gradient(180deg, #0e0e10 0%, #08080a 100%);
  --grad-neon: var(--grad-accent);
  --grad-neon-soft: linear-gradient(135deg, rgba(10, 132, 255, 0.28), rgba(94, 92, 230, 0.22));

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 6px 22px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 24px 60px rgba(0, 0, 0, 0.6);
  --glow-blue: 0 8px 28px rgba(10, 132, 255, 0.35);
  --glow-purple: var(--glow-blue);
  --glow-pink: var(--glow-blue);

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Motion */
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-snap: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-fast: 0.18s;
  --dur-med: 0.28s;
  --dur-slow: 0.4s;

  /* Layout */
  --topbar-h: 56px;
  --content-max: 1240px;
  --content-pad: 32px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  overflow-x: hidden;
  width: 100%;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display',
    'Inter', system-ui, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-main);
  background: var(--grad-bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
  min-height: 100vh;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--accent-soft); color: var(--text-main); }

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.24); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.squircle { border-radius: 22.5%; overflow: hidden; }

/* ============================================================
   TOPBAR — Sticky horizontal navigation, App Store style
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: var(--bg-topbar);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  border-bottom: 0.5px solid var(--hairline);
}

.topbar-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--content-pad);
  display: flex;
  align-items: center;
  gap: 22px;
}

.topbar-brand {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: opacity var(--dur-fast) var(--ease-soft);
}
.topbar-brand:hover { opacity: 0.85; }
.topbar-brand img {
  height: 26px;
  width: auto;
  display: block;
}
.topbar-brand-name {
  color: var(--text-main);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .topbar-brand-name { display: none; }
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.topbar-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--r-pill);
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-soft), color var(--dur-fast) var(--ease-soft);
}

.topbar-nav-link svg,
.topbar-nav-link i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.85;
}

.topbar-nav-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.topbar-nav-link.active {
  background: var(--accent);
  color: #fff;
}
.topbar-nav-link.active svg,
.topbar-nav-link.active i { opacity: 1; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Compact search in topbar */
.topbar-search {
  position: relative;
  width: 260px;
}

.topbar-search .search-input {
  height: 34px;
  padding: 0 14px 0 34px !important;
  font-size: 13.5px;
  border-radius: var(--r-pill) !important;
  background: rgba(255, 255, 255, 0.08);
  border: 0.5px solid var(--hairline-strong);
  color: var(--text-main);
  width: 100%;
  outline: none;
  font-family: inherit;
  transition: background var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.topbar-search .search-input::placeholder { color: var(--text-tertiary); }
.topbar-search .search-input:hover { background: rgba(255, 255, 255, 0.1); }
.topbar-search .search-input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.topbar-search .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
  pointer-events: none;
}

/* Menu/more button (legal & FAQ collapse into here on desktop) */
.topbar-menu-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--r-pill);
  border: 0.5px solid var(--hairline-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--dur-fast);
}
.topbar-menu-btn:hover { background: rgba(255, 255, 255, 0.12); }
.topbar-menu-btn svg { width: 18px; height: 18px; }

.topbar-menu-panel {
  position: absolute;
  top: calc(var(--topbar-h) - 6px);
  right: var(--content-pad);
  width: 240px;
  background: rgba(28, 28, 30, 0.92);
  backdrop-filter: saturate(180%) blur(40px);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  border: 0.5px solid var(--hairline-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  padding: 6px;
  display: none;
  z-index: 101;
}
.topbar-menu-panel.show {
  display: block;
  animation: dropdownIn var(--dur-fast) var(--ease-soft);
}

.topbar-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-main);
  text-decoration: none;
  border-radius: 8px;
  transition: background var(--dur-fast);
}
.topbar-menu-item:hover { background: var(--accent); color: #fff; }
.topbar-menu-item svg { width: 16px; height: 16px; opacity: 0.8; }
.topbar-menu-item:hover svg { opacity: 1; }
.topbar-menu-sep { height: 0.5px; background: var(--hairline); margin: 4px 8px; }

/* Mobile burger */
.topbar-burger {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast);
}
.topbar-burger:hover { background: rgba(255, 255, 255, 0.08); }
.topbar-burger:active { background: rgba(255, 255, 255, 0.14); transform: scale(0.95); transition: transform var(--dur-fast); }
.topbar-burger svg { width: 22px; height: 22px; }

/* Mobile drawer */
.topbar-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(86vw, 340px);
  background: rgba(18, 18, 20, 0.96);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  border-left: 0.5px solid var(--hairline);
  transform: translateX(100%);
  transition: transform var(--dur-med) var(--ease-snap);
  z-index: 102;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 14px) 18px 18px;
}
.topbar-drawer.open { transform: translateX(0); }

.topbar-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.topbar-drawer-close {
  width: 34px;
  height: 34px;
  border-radius: var(--r-pill);
  border: 0.5px solid var(--hairline-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.topbar-drawer-close svg { width: 16px; height: 16px; }

.topbar-drawer-search { margin-bottom: 16px; position: relative; }
.topbar-drawer-search .search-input {
  height: 40px;
  padding: 0 14px 0 38px !important;
  font-size: 15px;
  border-radius: var(--r-md) !important;
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid var(--hairline-strong);
  color: var(--text-main);
  width: 100%;
  font-family: inherit;
  outline: none;
}
.topbar-drawer-search .search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.drawer-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 10px 8px 4px;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  text-decoration: none;
  border-radius: 10px;
  transition: background var(--dur-fast);
}
.drawer-link:hover, .drawer-link.active { background: rgba(255, 255, 255, 0.06); }
.drawer-link:active { background: var(--accent-soft); transition: background var(--dur-fast); }
.drawer-link.active { color: var(--accent); }
.drawer-link svg, .drawer-link i { width: 18px; height: 18px; opacity: 0.85; flex-shrink: 0; }
.drawer-link .count {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid var(--hairline);
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.drawer-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 0.5px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.drawer-foot .drawer-link {
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 101;
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease-soft);
}
.drawer-overlay.show { display: block; opacity: 1; }

/* ============================================================
   PAGE SHELL
   ============================================================ */
.page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 32px var(--content-pad) 80px;
}

.page-narrow {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px var(--content-pad) 80px;
}

/* ============================================================
   HERO — Mac App Store-style featured banner
   ============================================================ */
.hero {
  position: relative;
  border-radius: var(--r-xl);
  padding: clamp(28px, 5vw, 56px) clamp(24px, 5vw, 56px);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.22) 0%, rgba(94, 92, 230, 0.16) 100%),
              rgba(255, 255, 255, 0.05);
  border: 0.5px solid var(--hairline-strong);
  box-shadow: var(--shadow-lg), 0 0 80px rgba(10, 132, 255, 0.18);
  margin-bottom: 40px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  isolation: isolate;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(800px 500px at 90% 20%, rgba(10, 132, 255, 0.35), transparent 60%),
    radial-gradient(700px 600px at 10% 100%, rgba(94, 92, 230, 0.3), transparent 60%);
  z-index: -1;
}

.hero-bg-img {
  position: absolute;
  inset: 0 0 0 auto;
  height: 100%;
  width: 56%;
  object-fit: cover;
  z-index: -1;
  pointer-events: none;
  opacity: 0.95;
  -webkit-mask-image: linear-gradient(to left, #000 25%, transparent 100%);
  mask-image: linear-gradient(to left, #000 25%, transparent 100%);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(10, 132, 255, 0.8);
}

.hero h1,
.hero-title {
  font-size: clamp(28px, 4.2vw, 48px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text-main);
  max-width: 620px;
  margin-bottom: 14px;
}

.hero-sub {
  font-size: clamp(15px, 1.4vw, 17px);
  color: var(--text-secondary);
  max-width: 540px;
  margin-bottom: 28px;
  line-height: 1.55;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 26px;
  border-radius: var(--r-pill);
  text-decoration: none;
  letter-spacing: -0.01em;
  width: fit-content;
  box-shadow: 0 8px 24px rgba(10, 132, 255, 0.4);
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.hero-cta:hover { background: var(--accent-hover); transform: translateY(-1px); }
.hero-cta:active { background: var(--accent-press); transform: translateY(0); }
.hero-cta svg { width: 16px; height: 16px; }

/* ============================================================
   CATEGORY TILES (quick access row)
   ============================================================ */
.tiles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 48px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 130px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  background: var(--bg-card);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 0.5px solid var(--hairline);
  text-decoration: none;
  color: var(--text-main);
  overflow: hidden;
  transition: transform var(--dur-med) var(--ease-soft),
              box-shadow var(--dur-med) var(--ease-soft),
              border-color var(--dur-med) var(--ease-soft);
  isolation: isolate;
}
.tile::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -30%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--tile-accent, var(--accent));
  filter: blur(40px);
  opacity: 0.35;
  z-index: -1;
  transition: opacity var(--dur-med) var(--ease-soft);
}
.tile:hover {
  transform: translateY(-4px) scale(1.015);
  border-color: var(--hairline-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42);
}
.tile:hover::before { opacity: 0.65; }
.tile:active { transform: translateY(-1px) scale(0.998); transition: transform var(--dur-fast) var(--ease-soft); }

.tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  margin-bottom: 12px;
}
.tile-icon svg { width: 18px; height: 18px; }
.tile-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.tile-count {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.tile.tile-blue   { --tile-accent: #0a84ff; }
.tile.tile-purple { --tile-accent: #bf5af2; }
.tile.tile-pink   { --tile-accent: #ff375f; }
.tile.tile-orange { --tile-accent: #ff9f0a; }
.tile.tile-teal   { --tile-accent: #64d2ff; }

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section {
  margin-bottom: 56px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  gap: 16px;
}

/* legacy class - compatibility */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  gap: 16px;
}

.section-title {
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.see-all {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color var(--dur-fast);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.see-all:hover { color: var(--accent-hover); }
.see-all::after {
  content: '›';
  font-size: 18px;
  line-height: 1;
  margin-left: 2px;
  transition: transform var(--dur-fast);
}
.see-all:hover::after { transform: translateX(3px); }

.section-divider {
  border: none;
  height: 0.5px;
  background: var(--hairline-strong);
  margin: 40px 0;
}

/* ============================================================
   HORIZONTAL RAIL (scroll-snap, used on home)
   ============================================================ */
.rail {
  position: relative;
  margin: 0 calc(var(--content-pad) * -1);
  padding: 0 var(--content-pad);
}

.rail-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 240px);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--content-pad);
  scrollbar-width: none;
  padding-bottom: 8px;
}
.rail-track::-webkit-scrollbar { display: none; }
.rail-track > * { scroll-snap-align: start; }

/* ============================================================
   GRIDS (catalog pages)
   ============================================================ */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: clamp(14px, 1.6vw, 20px);
  align-items: start;
}

.os-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: clamp(14px, 1.6vw, 20px);
}

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

/* ============================================================
   CARDS
   ============================================================ */
.card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 0.5px solid var(--hairline);
  border-radius: var(--r-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform var(--dur-med) var(--ease-soft),
              box-shadow var(--dur-med) var(--ease-soft),
              border-color var(--dur-med) var(--ease-soft),
              background var(--dur-med) var(--ease-soft);
}
.card:hover {
  transform: translateY(-4px) scale(1.005);
  background: var(--bg-card-hover);
  border-color: var(--hairline-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42);
}
.card:active { transform: translateY(0) scale(1); transition: transform var(--dur-fast) var(--ease-soft); }

.card-program {
  padding: 16px 16px 14px;
}
.card-program-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.card-program-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 0.5px rgba(0, 0, 0, 0.45);
}
.card-program-icon img {
  width: 100%;
  object-fit: contain;
}
.card-program-name {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-program-cat {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-program-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-program-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-soft);
}
.card:hover .card-cover img { transform: scale(1.04); }

.card-game-cover { aspect-ratio: 16/10; }
.card-ext-cover {
  aspect-ratio: 16/10;
}
.card-ext-cover img {
  object-fit: contain;
  padding: 16%;
}

.card-body { padding: 14px 16px 16px; }
.card-body-name {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-main);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-body-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-body-cat { font-size: 12px; color: var(--text-tertiary); }

.card-game-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.45) 55%, transparent 100%);
  display: flex;
  align-items: flex-end;
  padding: 14px;
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease-soft);
  z-index: 2;
}
.card:hover .card-game-overlay { opacity: 1; }
.card-game-overlay p {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* OS card */
.os-card {
  background: var(--bg-card);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 0.5px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 18px 14px 16px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform var(--dur-med) var(--ease-soft),
              box-shadow var(--dur-med) var(--ease-soft),
              border-color var(--dur-med) var(--ease-soft),
              background var(--dur-med) var(--ease-soft);
}
.os-card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  border-color: var(--hairline-strong);
  box-shadow: var(--shadow-md);
}
.os-card-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 0.5px rgba(0, 0, 0, 0.45);
}
.os-card-icon img { width: 100%; object-fit: contain; }
.os-card-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-main);
}
.os-card-version {
  background: rgba(255, 255, 255, 0.05);
  border: 0.5px solid var(--hairline);
  border-radius: 6px;
  color: var(--text-secondary);
  display: inline-block;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-top: 8px;
  padding: 3px 8px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.get-btn {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: var(--r-pill);
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  letter-spacing: -0.01em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.get-btn:hover { background: var(--accent-hover); transform: scale(1.02); box-shadow: 0 6px 18px rgba(10, 132, 255, 0.42); }
.get-btn:active { background: var(--accent-press); transform: scale(0.96); }

/* ============================================================
   CATEGORY (catalog) HEADER
   ============================================================ */
.cat-head {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  padding: 12px 0 28px;
  border-bottom: 0.5px solid var(--hairline);
  margin-bottom: 22px;
}

.cat-head-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  background: var(--cat-color, var(--accent));
}
.cat-head-icon svg { width: 28px; height: 28px; }

.cat-head-meta {
  flex: 1;
  min-width: 0;
}
.cat-head-eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}
.cat-head-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.cat-head-title h1 {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.1;
}
.cat-head-count {
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 500;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.cat-head-desc {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 640px;
}

/* legacy compat */
.cat-page-header { margin-bottom: 28px; }
.cat-page-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft);
  border: 0.5px solid rgba(10, 132, 255, 0.35);
  color: var(--accent);
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 12px; border-radius: var(--r-pill);
  margin-bottom: 14px;
}
.cat-page-badge svg { width: 12px; height: 12px; }
.cat-page-title {
  font-size: clamp(28px, 3.6vw, 38px);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 8px;
  color: var(--text-main);
}
.cat-title-text { color: var(--text-main); }
.cat-page-count {
  font-size: clamp(20px, 2.4vw, 26px); font-weight: 500;
  color: var(--text-tertiary); font-variant-numeric: tabular-nums;
}
.cat-page-desc {
  font-size: 15px; color: var(--text-secondary); line-height: 1.6;
  max-width: 620px; margin-top: 6px;
}

/* ============================================================
   CHIPS BAR (replaces filter dropdown)
   ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: sticky;
  top: var(--topbar-h);
  z-index: 30;
  padding: 12px 0;
  background: linear-gradient(180deg, rgba(15, 15, 16, 0.92) 0%, rgba(15, 15, 16, 0.85) 80%, transparent 100%);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  margin-bottom: 22px;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  scrollbar-width: none;
  padding: 2px 0;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  border: 0.5px solid var(--hairline-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: all var(--dur-fast) var(--ease-soft);
}
.chip:hover { background: rgba(255, 255, 255, 0.12); }
.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.sort-wrap { position: relative; flex-shrink: 0; }
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid var(--hairline-strong);
  border-radius: var(--r-pill);
  color: var(--text-main);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--dur-fast);
}
.sort-btn:hover { background: rgba(255, 255, 255, 0.12); }
.sort-btn.open { border-color: var(--accent); }
.sort-btn svg { width: 14px; height: 14px; }

.sort-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 200px;
  background: rgba(28, 28, 30, 0.92);
  backdrop-filter: saturate(180%) blur(40px);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  border: 0.5px solid var(--hairline-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  padding: 6px;
  display: none;
  z-index: 50;
}
.sort-menu.show { display: block; animation: dropdownIn var(--dur-fast) var(--ease-soft); }

.sort-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-main);
  cursor: pointer;
  transition: background var(--dur-fast);
}
.sort-option:hover { background: rgba(255, 255, 255, 0.08); }
.sort-option.selected { color: var(--accent); }
.sort-option .check { width: 14px; height: 14px; flex-shrink: 0; opacity: 0; }
.sort-option.selected .check { opacity: 1; }

/* Hidden legacy filter elements — still in DOM for compat, just not shown */
.filter-bar,
.filter-trigger,
.filter-panel { display: none !important; }

/* ============================================================
   SEARCH DROPDOWN (shared by topbar + drawer)
   ============================================================ */
.search-wrap { position: relative; }
.search-wrap .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-input { font-family: inherit; }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(28, 28, 30, 0.92);
  backdrop-filter: saturate(180%) blur(40px);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  border: 0.5px solid var(--hairline-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  max-height: 460px;
  overflow-y: auto;
  z-index: 110;
  display: none;
  padding: 6px;
  min-width: 320px;
}
.search-dropdown.show { display: block; animation: dropdownIn var(--dur-fast) var(--ease-soft); }

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); filter: blur(2px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-main);
  transition: background var(--dur-fast);
  cursor: pointer;
}
.search-item + .search-item { margin-top: 2px; }
.search-item:hover { background: var(--accent); color: #fff; }
.search-item:hover .search-item-cat { color: rgba(255, 255, 255, 0.85); }
.search-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 22.5%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.search-item-name {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-item-cat {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.page-btn, .page-arrow {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  border: 0.5px solid var(--hairline-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast);
  font-variant-numeric: tabular-nums;
}
.page-btn:hover, .page-arrow:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.page-btn:disabled, .page-arrow:disabled { opacity: 0.35; cursor: default; }

/* ============================================================
   GRID LOADER / SKELETON
   ============================================================ */
.grid-loader {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
}
.grid-loader.show { display: flex; }
.grid-loader-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: gridSpin 0.8s linear infinite;
}
@keyframes gridSpin { to { transform: rotate(360deg); } }

.skeleton-card {
  background: var(--bg-card);
  border: 0.5px solid var(--hairline);
  border-radius: var(--r-md);
  overflow: hidden;
}
.skeleton-cover {
  aspect-ratio: 16/10;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-body { padding: 14px 16px; }
.skeleton-line {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  margin-bottom: 8px;
}
.skeleton-line:last-child { width: 50%; margin-bottom: 0; }
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   ARTICLES
   ============================================================ */
.article-card {
  background: var(--bg-card) !important;
  backdrop-filter: saturate(180%) blur(18px) !important;
  -webkit-backdrop-filter: saturate(180%) blur(18px) !important;
  border: 0.5px solid var(--hairline) !important;
  border-radius: var(--r-md) !important;
  overflow: hidden !important;
  text-decoration: none !important;
  color: inherit !important;
  display: block !important;
  transition: transform var(--dur-med) var(--ease-soft),
              box-shadow var(--dur-med) var(--ease-soft),
              border-color var(--dur-med) var(--ease-soft) !important;
}
.article-card:hover {
  transform: translateY(-3px) !important;
  border-color: var(--hairline-strong) !important;
  box-shadow: var(--shadow-md) !important;
}
.article-card-img {
  aspect-ratio: 16/9 !important;
  position: relative !important;
  overflow: hidden !important;
  background: var(--bg-elev-2);
}
.article-card-img img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  transition: transform var(--dur-slow) var(--ease-soft);
}
.article-card:hover .article-card-img img { transform: scale(1.04); }
.article-card-tag {
  position: absolute !important;
  top: 12px !important; left: 12px !important;
  background: rgba(0, 0, 0, 0.6) !important;
  color: #fff !important;
  font-size: 10.5px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  padding: 4px 10px !important;
  border-radius: var(--r-pill) !important;
  backdrop-filter: blur(12px) !important;
  border: 0.5px solid rgba(255, 255, 255, 0.15) !important;
  z-index: 2;
}
.article-card-body { padding: 16px 18px 20px !important; }
.article-card-title {
  font-size: 15.5px !important;
  font-weight: 600 !important;
  letter-spacing: -0.015em;
  color: var(--text-main) !important;
  line-height: 1.35 !important;
  margin-bottom: 6px !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-desc {
  font-size: 13px !important;
  color: var(--text-secondary) !important;
  line-height: 1.5 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

/* ============================================================
   DETAIL PAGE
   ============================================================ */
.detail-page-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--dur-fast);
}
.breadcrumb a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }

.cat-tag { color: var(--accent); text-decoration: none; font-size: 14px; transition: color var(--dur-fast); }
.cat-tag:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }

/* Hero section on detail */
.hero-section,
.hero-flex {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 18px 0 28px;
}
.hero-section h1,
.hero-flex h1 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-main);
  line-height: 1.15;
  margin-bottom: 6px;
}
.hero-section .squircle,
.hero-flex .squircle {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), 0 0 0 0.5px rgba(0, 0, 0, 0.5);
}
.hero-section .squircle img,
.hero-flex .squircle img { width: 100%; }

/* Detail bg helper — disabled */
.detail-bg-icon { display: none; }
.floating-particles, .banner-particles { display: none !important; }

/* Carousel */
.carousel-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--bg-elev-1);
  border: 0.5px solid var(--hairline);
  box-shadow: var(--shadow-md);
}
.carousel-track { display: flex; transition: transform var(--dur-slow) var(--ease-snap); }
.carousel-slide {
  flex-shrink: 0;
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-elev-1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
}
.carousel-slide .carousel-slide-bg {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center;
  filter: blur(30px) brightness(0.4) saturate(1.2);
  z-index: 0;
}
.carousel-slide img {
  width: 100%; height: 100%; object-fit: contain;
  position: relative; z-index: 1;
}
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(28, 28, 30, 0.75);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 0.5px solid var(--hairline-strong);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  z-index: 5; color: var(--text-main);
  box-shadow: var(--shadow-md);
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.carousel-btn:hover { background: rgba(58, 58, 60, 0.95); transform: translateY(-50%) scale(1.06); box-shadow: 0 6px 20px rgba(10, 132, 255, 0.28), var(--shadow-md); }
.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }
.carousel-dots { display: flex; justify-content: center; gap: 6px; padding: 14px 0; }
.carousel-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: none; cursor: pointer; padding: 0;
  transition: all var(--dur-fast);
}
.carousel-dot.active { background: var(--accent); width: 22px; border-radius: 999px; }

/* Info card */
.info-card {
  background: var(--bg-card);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 0.5px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-md);
}
.info-row {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--hairline);
}
.info-row:first-child { padding-top: 0; }
.info-row:last-child { border-bottom: none; }
.info-label {
  color: var(--text-tertiary);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  font-weight: 600;
}
.info-value {
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
}
.lang-more-btn {
  background: none; border: none;
  color: var(--accent);
  font-size: 13px; font-weight: 500;
  cursor: pointer; padding: 0;
}
.lang-more-btn:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }

.download-btn {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 28px;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: block;
  text-align: center;
  width: 100%;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.35);
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.download-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.download-btn:active { background: var(--accent-press); transform: translateY(0); }

/* Desc card */
.desc-card {
  background: var(--bg-card);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 0.5px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 32px 36px;
  box-shadow: var(--shadow-md);
}
.desc-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  letter-spacing: -0.025em;
}
.desc-underline {
  width: 36px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin-bottom: 20px;
}
.desc-card .desc-text {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.65;
  max-width: 720px;
}
.desc-card .desc-text p { margin-bottom: 14px; }
.desc-card .desc-text p:last-child { margin-bottom: 0; }
.desc-card .desc-text strong, .desc-card .desc-text b { color: var(--text-main); font-weight: 600; }
.desc-card .desc-text .desc-features-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
  margin-top: 18px;
  letter-spacing: -0.015em;
}
.desc-card .desc-text .desc-feature { position: relative; padding-left: 22px; margin-bottom: 8px; }
.desc-card .desc-text .desc-feature::before {
  content: ''; position: absolute; left: 4px; top: 10px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}

/* FAQ */
.faq-card {
  background: var(--bg-card);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 0.5px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 0 20px;
  box-shadow: var(--shadow-md);
}
.faq-item { border-bottom: 0.5px solid var(--hairline); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  padding: 16px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  letter-spacing: -0.01em;
  transition: color var(--dur-fast);
}
.faq-q:hover { color: var(--accent); }
.faq-a {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding-bottom: 0;
  transition: max-height var(--dur-med) var(--ease-snap),
              padding var(--dur-med) var(--ease-snap),
              opacity var(--dur-fast) var(--ease-soft);
}
.faq-item.open .faq-a { max-height: 500px; opacity: 1; padding-bottom: 18px; }
.faq-item.open .faq-chevron { transform: rotate(180deg); color: var(--accent); }
.faq-chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), color var(--dur-fast);
}
.faq-q:hover .faq-chevron { color: var(--accent); }

/* Related */
.related-card {
  background: var(--bg-card);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 0.5px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 18px 12px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  transition: transform var(--dur-med) var(--ease-soft),
              box-shadow var(--dur-med) var(--ease-soft),
              border-color var(--dur-med) var(--ease-soft);
}
.related-card img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
}
.related-card .name {
  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 18px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.related-card .cat {
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 16px;
}
.related-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--hairline-strong);
}

/* Comments */
.comment-card {
  background: var(--bg-card);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 0.5px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-bottom: 10px;
}
.comment-input {
  background: rgba(255, 255, 255, 0.05);
  border: 0.5px solid var(--hairline-strong);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 14px;
  width: 100%;
  outline: none;
  font-family: inherit;
  color: var(--text-main);
  transition: background var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.comment-input::placeholder { color: var(--text-tertiary); }
.comment-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.comment-btn {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.comment-btn:hover { background: var(--accent-hover); }
.comment-btn:active { background: var(--accent-press); transform: scale(0.97); }

/* Lightbox */
.lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.88);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  backdrop-filter: blur(8px) saturate(140%);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur-med), visibility var(--dur-med);
  cursor: zoom-out;
}
.lightbox-overlay.open { opacity: 1; visibility: visible; }
.lightbox-overlay img {
  max-width: 92vw; max-height: 92vh;
  object-fit: contain; border-radius: 8px;
  transform: scale(0.9); opacity: 0;
  transition: transform var(--dur-med) var(--ease-snap), opacity var(--dur-med);
}
.lightbox-overlay.open img { transform: scale(1); opacity: 1; }
.lightbox-close, .lightbox-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: 0.5px solid var(--hairline-strong);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(20px);
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.lightbox-close { top: 20px; right: 24px; width: 40px; height: 40px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; }
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox-nav:hover { transform: translateY(-50%) scale(1.06); }
.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }
.lightbox-counter {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   LEGAL CONTENT (Privacy/DMCA)
   ============================================================ */
.legal-content {
  background: var(--bg-card);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 0.5px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow-md);
}
.legal-content h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  margin: 28px 0 10px;
  letter-spacing: -0.02em;
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content p {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 12px;
}
.legal-content ul { padding-left: 24px; margin-bottom: 14px; }
.legal-content li {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 6px;
}
.legal-content li strong { color: var(--text-main); font-weight: 600; }
.legal-content a { color: var(--accent); text-decoration: none; }
.legal-content a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }

/* ============================================================
   COMING SOON
   ============================================================ */
.coming-soon-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px 80px;
  text-align: center;
}
.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  border: 0.5px solid rgba(10, 132, 255, 0.35);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  margin-bottom: 24px;
}
.coming-soon-icon {
  width: 96px; height: 96px;
  margin: 0 auto 28px;
  border-radius: 28%;
  background: linear-gradient(135deg, var(--accent) 0%, #5e5ce6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 24px 60px rgba(10, 132, 255, 0.32), 0 0 0 0.5px rgba(255, 255, 255, 0.08) inset;
  animation: csPulse 2.8s ease-in-out infinite;
}
@keyframes csPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-4px) scale(1.02); }
}
.coming-soon-icon svg { width: 44px; height: 44px; color: #fff; }
.coming-soon-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 16px;
}
.coming-soon-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto 36px;
}
.coming-soon-card {
  background: var(--bg-card);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 0.5px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 22px 26px;
  margin-bottom: 18px;
  text-align: left;
}
.coming-soon-card h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
.coming-soon-card h2 svg { width: 16px; height: 16px; color: var(--accent); }
.coming-soon-card ul { list-style: none; padding: 0; }
.coming-soon-card li {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 18px;
  position: relative;
  margin-bottom: 6px;
}
.coming-soon-card li::before {
  content: ''; position: absolute; left: 4px; top: 9px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.coming-soon-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
.cs-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  text-decoration: none;
  cursor: pointer;
  border: 0.5px solid transparent;
  font-family: inherit;
  letter-spacing: -0.01em;
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.cs-btn-primary { background: var(--accent); color: #fff; }
.cs-btn-primary:hover { background: var(--accent-hover); }
.cs-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--hairline-strong);
  color: var(--text-main);
}
.cs-btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }
.cs-btn svg { width: 15px; height: 15px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  margin-top: 60px;
  padding: 40px var(--content-pad) 32px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 0.5px solid var(--hairline);
}
.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}
.footer-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 32px;
}
.footer-col h4 {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}
.footer-brand img {
  height: 28px;
}
.footer-brand {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.footer-brand-name {
  color: var(--text-main);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.footer-tagline {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 280px;
}
.footer-link {
  display: block;
  font-size: 13.5px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 0;
  transition: color var(--dur-fast);
}
.footer-link:hover { color: var(--text-main); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 18px;
  border-top: 0.5px solid var(--hairline);
  font-size: 12.5px;
  color: var(--text-tertiary);
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-soft), transform var(--dur-slow) var(--ease-soft);
  will-change: opacity, transform;
}
.reveal.revealed { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Compatibility helpers for any leftover inline styles */
.main-content {
  position: relative;
  background: transparent;
}
.main-content > div[style*="background-image"][style*="bg.jpg"],
.main-content > div[style*="background-image"][style*="app-background"],
.page-bg {
  display: none !important;
}

/* Inline color overrides for hardcoded #e0e0e6 etc. inside JS templates / sub-page templates */
.card p[style*="#e0e0e6"],
.os-card p[style*="#e0e0e6"],
h1[style*="#e0e0e6"],
h2[style*="#e0e0e6"],
p[style*="#e0e0e6"],
span[style*="#e0e0e6"],
div[style*="#e0e0e6"] { color: var(--text-main) !important; }

.card p[style*="#6a6a7a"],
.os-card p[style*="#6a6a7a"],
.search-item div[style*="#6a6a7a"],
p[style*="#6a6a7a"],
p[style*="#b0b0be"],
p[style*="#a0a0b0"] { color: var(--text-secondary) !important; }

p[style*="color:#555"],
p[style*="color: #555"] { color: var(--text-tertiary) !important; }

a[style*="#4f8cff"],
p[style*="color: #4f8cff"],
p[style*="color:#4f8cff"] { color: var(--accent) !important; }

/* ============================================================
   Detail page two-column layout
   ============================================================ */
.two-col{align-items:start;display:grid;gap:28px;grid-template-columns:1fr 300px}
.two-col aside{position:sticky;top:calc(var(--topbar-h, 60px) + 20px)}

/* FAQ keyboard a11y */
.faq-item{cursor:pointer}
.faq-item:focus{outline:none}
.faq-item:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:8px}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .footer-cols { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer-cols > .footer-col:last-child { grid-column: 1 / -1; }
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --content-pad: 18px;
    --topbar-h: 54px;
  }

  body { font-size: 15px; }

  .topbar-nav,
  .topbar-search,
  .topbar-menu-btn { display: none; }

  .topbar-burger { display: inline-flex; }
  .topbar-inner { gap: 14px; }
  .topbar-right { gap: 6px; }

  .hero {
    padding: 28px 22px;
    min-height: 240px;
    border-radius: var(--r-lg);
  }
  .hero-bg-img { display: none; }

  .tiles {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .tile { min-height: 100px; padding: 14px 14px; }
  .tile-icon { width: 30px; height: 30px; margin-bottom: 8px; }
  .tile-name { font-size: 14.5px; }

  .rail {
    margin: 0 calc(var(--content-pad) * -1);
    padding: 0 var(--content-pad);
  }
  .rail-track { grid-auto-columns: 78%; }

  .cat-head { gap: 14px; padding: 6px 0 18px; }
  .cat-head-icon { width: 48px; height: 48px; border-radius: 14px; }
  .cat-head-icon svg { width: 22px; height: 22px; }
  .cat-head-title h1 { font-size: 24px; }

  .toolbar { padding: 10px 0; gap: 10px; }
  .chip { padding: 10px 14px; font-size: 13px; min-height: 38px; }
  .sort-btn { padding: 7px 12px; font-size: 12.5px; }
  .sort-menu { right: 0; left: auto; }

  .app-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
  }
  .os-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr));
  }
  .articles-grid { grid-template-columns: 1fr; }

  .footer-cols {
    grid-template-columns: 1fr 1fr;
    gap: 22px;
  }
  .footer-brand-col { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .desc-card { padding: 22px 18px; border-radius: var(--r-md); }
  .legal-content { padding: 22px 20px; border-radius: var(--r-md); }
  .info-card { padding: 18px 18px; }
  .faq-card { padding: 0 16px; }

  .hero-section, .hero-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    text-align: left;
  }
  .hero-section .squircle, .hero-flex .squircle {
    width: 76px; height: 76px;
  }
  .hero-section h1, .hero-flex h1 { font-size: 24px; }

  /* touch-friendly tap targets */
  .search-input { font-size: 16px; }
  .topbar-search .search-input { font-size: 16px; }
  .comment-input { font-size: 16px; }
  .page-btn, .page-arrow { min-width: 40px; height: 40px; }
  .get-btn { padding: 8px 18px; font-size: 13.5px; }

  /* Detail page: collapse two-column layout */
  .two-col { grid-template-columns: 1fr !important; gap: 16px !important; }
  .two-col aside { position: static !important; }

  /* Carousel touch target */
  .carousel-btn { width: 44px; height: 44px; }
  .carousel-dot { width: 8px; height: 8px; }

  /* Footer link spacing */
  .footer-cols { gap: 18px; }
}

/* Intermediate tablet breakpoint (iPad portrait) */
@media (max-width: 900px) and (min-width: 769px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 22px; }
  .footer-brand-col { grid-column: 1 / -1; }
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .rail-track { grid-auto-columns: 60%; }
  .hero-section .squircle, .hero-flex .squircle { width: 80px; height: 80px; }
  .two-col { grid-template-columns: 1fr !important; gap: 20px !important; }
  .two-col aside { position: static !important; }
}

/* Lightbox safe-area on notched devices */
.lightbox-close {
  top: max(20px, env(safe-area-inset-top));
  right: max(24px, env(safe-area-inset-right));
}

/* Body scroll lock when modal/drawer open */
body.modal-open,
body.drawer-open { overflow: hidden; }

/* Universal min touch-target for primary interactive controls */
.carousel-btn,
.lightbox-close,
.lightbox-nav,
.page-btn,
.page-arrow { min-width: 40px; min-height: 40px; }

@media print {
  .topbar, .topbar-drawer, .drawer-overlay,
  .toolbar, .pagination,
  .download-btn, .comment-input, .comment-btn,
  .site-footer {
    display: none !important;
  }
  body { background: #fff; color: #000; }
}
