/* =========================================================
   Miatoll Family — style.css
   Glassmorphism · iOS typography · Gaming sidebar · Animations
   ========================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

button,
input {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
}

code {
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.12em 0.45em;
  word-break: break-all;
}

::selection {
  background: rgba(100, 210, 255, 0.35);
  color: inherit;
}

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------- Tokens ---------- */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --accent: #5e5ce6;
  --accent-2: #31c4f3;
  --accent-3: #64d2ff;
  --accent-pink: #ff375f;
  --grad: linear-gradient(120deg, #5e5ce6 0%, #31c4f3 55%, #64d2ff 100%);
  --grad-warm: linear-gradient(120deg, #ff375f, #ff9f0a);

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --sidebar-w: 264px;
  --rail-w: 80px;
  --topbar-h: 64px;
  --max-w: 1180px;

  --shadow-card: 0 10px 30px -12px rgba(28, 30, 60, 0.18);
  --shadow-float: 0 24px 60px -20px rgba(28, 30, 60, 0.28);
  --ease-out: cubic-bezier(0.22, 0.9, 0.28, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.44, 1);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef0f7;
  --bg-2: #f6f7fc;
  --text: #14151f;
  --text-2: rgba(20, 21, 31, 0.66);
  --text-3: rgba(20, 21, 31, 0.45);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-soft: rgba(255, 255, 255, 0.45);
  --border: rgba(255, 255, 255, 0.72);
  --border-2: rgba(20, 21, 40, 0.08);
  --chip-bg: rgba(20, 21, 40, 0.05);
  --code-bg: rgba(94, 92, 230, 0.08);
  --sidebar-bg: rgba(255, 255, 255, 0.55);
  --nav-active: linear-gradient(120deg, rgba(94, 92, 230, 0.16), rgba(49, 196, 243, 0.12));
  --nav-hover: rgba(255, 255, 255, 0.7);
  --glow: rgba(94, 92, 230, 0.25);
  --blob-opacity: 0.55;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090b13;
  --bg-2: #0d1020;
  --text: #f2f3fa;
  --text-2: rgba(242, 243, 250, 0.68);
  --text-3: rgba(242, 243, 250, 0.42);
  --glass: rgba(19, 23, 40, 0.58);
  --glass-strong: rgba(22, 27, 46, 0.82);
  --glass-soft: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.09);
  --border-2: rgba(255, 255, 255, 0.12);
  --chip-bg: rgba(255, 255, 255, 0.07);
  --code-bg: rgba(100, 210, 255, 0.1);
  --sidebar-bg: rgba(13, 16, 30, 0.6);
  --nav-active: linear-gradient(120deg, rgba(94, 92, 230, 0.28), rgba(49, 196, 243, 0.16));
  --nav-hover: rgba(255, 255, 255, 0.06);
  --glow: rgba(100, 210, 255, 0.22);
  --shadow-card: 0 14px 40px -14px rgba(0, 0, 0, 0.55);
  --shadow-float: 0 30px 70px -22px rgba(0, 0, 0, 0.7);
  --blob-opacity: 0.5;
}

/* ---------- Background FX ---------- */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: var(--blob-opacity);
  will-change: transform;
}

.blob-a {
  width: 560px;
  height: 560px;
  top: -160px;
  right: -120px;
  background: radial-gradient(circle at 30% 30%, #7c6cff, #31c4f3 60%, transparent 75%);
  animation: float-a 26s ease-in-out infinite alternate;
}

.blob-b {
  width: 480px;
  height: 480px;
  bottom: -140px;
  left: -120px;
  background: radial-gradient(circle at 60% 40%, #ff6b9d, #b45ce6 55%, transparent 75%);
  animation: float-b 30s ease-in-out infinite alternate;
}

.blob-c {
  width: 380px;
  height: 380px;
  top: 42%;
  left: 38%;
  background: radial-gradient(circle, #64d2ff, #5e5ce6 60%, transparent 78%);
  opacity: calc(var(--blob-opacity) * 0.55);
  animation: float-c 34s ease-in-out infinite alternate;
}

/* ---------- Glass ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* ---------- Sidebar state (desktop) ---------- */
html[data-sidebar="rail"] {
  --sb-current: var(--rail-w);
}

html[data-sidebar="open"] {
  --sb-current: var(--sidebar-w);
}

html[data-sidebar="hidden"] {
  --sb-current: 0px;
}

/* ---------- Shell layout ---------- */
.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(var(--topbar-h) + 26px) 30px 60px;
  display: flex;
  flex-direction: column;
  gap: 34px;
}

/* ---------- Sidebar (gaming launcher · Cloudflare-style rail) ---------- */
.sidebar {
  position: fixed;
  z-index: 60;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  padding: 14px 8px 14px 8px;
  display: flex;
  flex-direction: column;
}

.sidebar-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 10px 12px;
  background: var(--sidebar-bg);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition: width 0.42s var(--ease-spring), box-shadow 0.35s ease;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

/* ---- Desktop: rail → hover expand → pinned → hidden ---- */
@media (min-width: 961px) {
  .sidebar {
    width: var(--rail-w);
    padding: 14px 0;
    transition: width 0.42s var(--ease-spring), transform 0.45s var(--ease-out), opacity 0.35s ease;
  }

  .sidebar-inner {
    width: var(--rail-w);
  }

  /* hover / keyboard focus → expand overlay (Cloudflare-style) */
  html[data-sidebar="rail"] .sidebar:hover .sidebar-inner,
  html[data-sidebar="rail"] .sidebar:focus-within .sidebar-inner {
    width: var(--sidebar-w);
    box-shadow: var(--shadow-float);
  }

  /* pinned open → push content */
  html[data-sidebar="open"] .sidebar {
    width: var(--sidebar-w);
  }

  html[data-sidebar="open"] .sidebar-inner {
    width: var(--sidebar-w);
  }

  /* fully hidden */
  html[data-sidebar="hidden"] .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w) - 40px));
    opacity: 0;
    pointer-events: none;
  }

  /* content offset per state (fix: sidebar menimpa konten) */
  .shell {
    padding-left: var(--sb-current, var(--rail-w));
    transition: padding-left 0.42s var(--ease-out);
  }

  .topbar {
    padding-left: calc(var(--sb-current, var(--rail-w)) + 14px);
  }
}

/* labels: hidden di rail, muncul bertahap saat expand */
.s-hide-rail {
  white-space: nowrap;
}

@media (min-width: 961px) {
  .s-hide-rail {
    transition: opacity 0.3s ease, transform 0.38s var(--ease-out);
    transition-delay: var(--d, 0ms);
  }

  html[data-sidebar="rail"] .s-hide-rail {
    opacity: 0;
    transform: translateX(-8px);
    pointer-events: none;
    transition-delay: 0ms;
  }

  html[data-sidebar="rail"] .sidebar:hover .s-hide-rail,
  html[data-sidebar="rail"] .sidebar:focus-within .s-hide-rail {
    opacity: 1;
    transform: none;
    transition-delay: calc(var(--d, 0ms) + 50ms);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 8px;
  color: var(--text);
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--glass-soft);
  border: 1px solid var(--border);
  box-shadow: 0 0 24px -6px var(--glow);
}

.brand-mark svg {
  width: 26px;
  height: 26px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-text small {
  font-size: 11.5px;
  color: var(--accent-3);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
}

.nav-section-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 12px 6px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 550;
  letter-spacing: -0.01em;
  transition: color 0.25s var(--ease-out), background 0.25s var(--ease-out),
    transform 0.25s var(--ease-out), box-shadow 0.3s var(--ease-out);
  overflow: hidden;
}

.nav-item .ico {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  transition: transform 0.35s var(--ease-spring), filter 0.3s;
}

.nav-item:hover {
  color: var(--text);
  background: var(--nav-hover);
  transform: translateX(3px);
}

.nav-item:hover .ico {
  transform: scale(1.12);
  filter: drop-shadow(0 0 8px var(--glow));
}

.nav-item.is-active {
  color: var(--text);
  background: var(--nav-active);
  border-color: var(--border);
  box-shadow: inset 0 0 0 1px var(--border), 0 8px 26px -14px var(--glow);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background: var(--grad);
  box-shadow: 0 0 14px var(--glow);
  animation: indicator-in 0.4s var(--ease-spring);
}

.nav-item.is-active .ico {
  color: var(--accent-3);
  filter: drop-shadow(0 0 10px var(--glow));
}

.nav-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(140px 60px at var(--mx, 50%) var(--my, 50%), rgba(100, 210, 255, 0.14), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.nav-item:hover .nav-glow {
  opacity: 1;
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 4px 0;
}

.status-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--glass-soft);
  border: 1px solid var(--border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 10px rgba(48, 209, 88, 0.8);
  animation: pulse-dot 2.2s ease-in-out infinite;
}

.side-cta {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 13px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--glass-soft);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.3s, color 0.25s;
}

.side-cta .ico {
  width: 17px;
  height: 17px;
}

.side-cta:hover {
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -12px var(--glow);
}

/* ---------- Topbar ---------- */
.topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  padding-left: calc(var(--sb-current, var(--rail-w)) + 14px);
  background: linear-gradient(to bottom, var(--bg-2), transparent);
  -webkit-backdrop-filter: blur(0px);
  backdrop-filter: blur(0px);
  transition: background 0.35s, -webkit-backdrop-filter 0.35s, backdrop-filter 0.35s,
    box-shadow 0.35s;
}

.topbar.is-scrolled {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  box-shadow: 0 1px 0 var(--border);
}

.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  min-width: 0;
}

.crumb-root {
  color: var(--text-3);
}

.crumb-sep {
  color: var(--text-3);
}

.crumb-current {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--text-2);
  background: var(--glass);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring), color 0.25s, box-shadow 0.3s;
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
}

.icon-btn .ico {
  width: 19px;
  height: 19px;
}

.icon-btn:hover {
  color: var(--text);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 24px -12px var(--glow);
}

.menu-btn {
  display: none;
}

/* sidebar state toggle (desktop) — rail ↔ pinned ↔ hidden */
.sb-toggle {
  display: none;
  position: relative;
}

@media (min-width: 961px) {
  .sb-toggle {
    display: grid;
  }
}

.sb-ico {
  position: absolute;
  display: grid;
  place-items: center;
  transition: transform 0.45s var(--ease-spring), opacity 0.3s ease;
}

/* rail / open → sidebar terlihat → tampilkan « (sembunyikan) */
html[data-sidebar="rail"] .sb-ico-close,
html[data-sidebar="open"] .sb-ico-close {
  transform: rotate(0) scale(1);
  opacity: 1;
}

html[data-sidebar="rail"] .sb-ico-open,
html[data-sidebar="open"] .sb-ico-open {
  transform: rotate(90deg) scale(0.4);
  opacity: 0;
}

/* hidden → tampilkan » (kembalikan) */
html[data-sidebar="hidden"] .sb-ico-open {
  transform: rotate(0) scale(1);
  opacity: 1;
  color: var(--accent-3);
}

html[data-sidebar="hidden"] .sb-ico-close {
  transform: rotate(-90deg) scale(0.4);
  opacity: 0;
}

/* tombol sembunyikan di dalam sidebar */
.sb-collapse {
  width: 100%;
  cursor: pointer;
  color: var(--text-3);
  transition: color 0.25s, transform 0.25s var(--ease-out), box-shadow 0.3s;
}

.sb-collapse:hover {
  color: var(--text);
  transform: translateX(2px);
}

/* theme toggle icons */
.theme-btn .theme-ico {
  position: absolute;
  display: grid;
  place-items: center;
  transition: transform 0.5s var(--ease-spring), opacity 0.3s;
}

html[data-theme="light"] .theme-ico-sun {
  transform: rotate(0) scale(1);
  opacity: 1;
}

html[data-theme="light"] .theme-ico-moon {
  transform: rotate(90deg) scale(0.4);
  opacity: 0;
}

html[data-theme="dark"] .theme-ico-sun {
  transform: rotate(-90deg) scale(0.4);
  opacity: 0;
}

html[data-theme="dark"] .theme-ico-moon {
  transform: rotate(0) scale(1);
  opacity: 1;
  color: var(--accent-3);
}

/* ---------- Typography / hero ---------- */
.hero {
  padding: clamp(30px, 5vw, 52px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.hero-title {
  font-size: clamp(1.95rem, 4.6vw, 3rem);
  font-weight: 750;
  letter-spacing: -0.032em;
  line-height: 1.12;
}

.gradient-text {
  background: linear-gradient(115deg, var(--text) 0%, var(--accent) 48%, var(--accent-2) 78%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.animated-gradient {
  background-size: 220% 100%;
  animation: gradient-pan 8s ease-in-out infinite alternate;
}

.hero-sub {
  max-width: 640px;
  color: var(--text-2);
  font-size: clamp(15px, 1.8vw, 17.5px);
  line-height: 1.6;
}

.hero-sub strong {
  color: var(--text);
  font-weight: 650;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}

/* Home hero */
.home-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 30px;
  align-items: center;
}

.home-hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.home-hero-copy .hero-title {
  font-size: clamp(2.6rem, 6vw, 4.3rem);
  letter-spacing: -0.04em;
}

.home-sub {
  max-width: 560px;
  font-size: clamp(15.5px, 1.7vw, 17.5px);
}

.device-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.device-mini {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 16px;
  border-radius: 16px;
  min-width: 138px;
  color: var(--text);
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
}

.device-mini:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-float);
}

.device-mini-code {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.device-mini strong {
  font-size: 14px;
  letter-spacing: -0.01em;
}

.device-mini small {
  font-size: 11.5px;
  color: var(--text-3);
}

/* Animated "console" panel */
.home-hero-panel {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-xl);
  transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
  transition: transform 0.6s var(--ease-out), box-shadow 0.5s;
}

.home-hero-panel:hover {
  transform: perspective(1200px) rotateY(-1.5deg) rotateX(1deg) translateY(-4px);
  box-shadow: var(--shadow-float);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--glass-soft);
}

.panel-dots {
  display: flex;
  gap: 6px;
}

.panel-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-2);
}

.panel-dots i:nth-child(1) { background: #ff5f57; }
.panel-dots i:nth-child(2) { background: #febc2e; }
.panel-dots i:nth-child(3) { background: #28c840; }

.panel-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.panel-rows {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--glass-soft);
  border: 1px solid var(--border);
  animation: row-in 0.7s var(--ease-out) both;
  animation-delay: calc(0.25s + var(--row-i) * 0.12s);
}

.pr-ico {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--chip-bg);
}

.pr-ico .ico {
  width: 17px;
  height: 17px;
}

.pr-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.pr-main strong {
  font-size: 13.5px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pr-main small {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

.pr-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #30d158;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(48, 209, 88, 0.12);
  border: 1px solid rgba(48, 209, 88, 0.28);
}

.panel-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--text-3);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.28s var(--ease-spring), box-shadow 0.3s, background 0.3s,
    border-color 0.3s;
  white-space: nowrap;
}

.btn .ico {
  width: 17px;
  height: 17px;
}

.btn-lg {
  padding: 14px 26px;
  font-size: 15.5px;
}

.btn-sm {
  padding: 8px 15px;
  font-size: 13px;
  border-radius: 999px;
}

.btn-sm .ico {
  width: 14px;
  height: 14px;
}

.btn-gradient {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 12px 28px -12px rgba(94, 92, 230, 0.75);
  position: relative;
  overflow: hidden;
}

.btn-gradient::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.7s var(--ease-out);
}

.btn-gradient:hover::after {
  transform: translateX(100%);
}

.btn-gradient:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 18px 36px -14px rgba(94, 92, 230, 0.85);
}

.btn-glass {
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
}

.btn-glass:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-card);
}

/* ---------- Pills / badges / chips / tags ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--chip-bg);
  border: 1px solid var(--border-2);
  letter-spacing: -0.005em;
}

.pill .ico {
  width: 13px;
  height: 13px;
}

.pill-android {
  color: var(--accent);
  border-color: rgba(94, 92, 230, 0.3);
  background: rgba(94, 92, 230, 0.08);
  font-weight: 650;
}

html[data-theme="dark"] .pill-android {
  color: var(--accent-3);
  border-color: rgba(100, 210, 255, 0.28);
  background: rgba(100, 210, 255, 0.08);
}

.pill-date {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
}

.pill-hero {
  background: linear-gradient(120deg, rgba(94, 92, 230, 0.14), rgba(49, 196, 243, 0.12));
  border-color: rgba(94, 92, 230, 0.3);
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 7px 14px;
}

html[data-theme="dark"] .pill-hero {
  color: var(--accent-3);
}

.badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
}

.badge-gradient {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 18px -8px rgba(94, 92, 230, 0.9);
}

.tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--chip-bg);
  border: 1px solid var(--border-2);
}

.chip-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.chip-group-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin-right: 2px;
}

.chip {
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--chip-bg);
  border: 1px solid var(--border-2);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}

.chip:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.chip.is-active {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px -10px rgba(94, 92, 230, 0.9);
}

.chip-reset {
  color: var(--accent);
  border-color: rgba(94, 92, 230, 0.35);
}

/* ---------- Sections ---------- */
.section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-tight {
  gap: 14px;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 640px;
}

.section-head h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.75rem);
  font-weight: 720;
  letter-spacing: -0.028em;
}

.section-head p {
  color: var(--text-2);
  font-size: 15px;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat {
  position: relative;
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.stat-ico {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--accent-3);
  opacity: 0.7;
}

.stat-ico .ico {
  width: 20px;
  height: 20px;
}

.stat-num {
  font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  font-weight: 780;
  letter-spacing: -0.03em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline;
}

.stat-suffix {
  display: inline;
  font-size: 1.5rem;
  font-weight: 750;
  color: var(--accent-2);
}

.stat small {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 550;
  margin-top: 4px;
}

/* ---------- Category grid ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.cat-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px 16px;
  color: var(--text);
  overflow: hidden;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s, border-color 0.3s;
}

.cat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-float);
  border-color: rgba(94, 92, 230, 0.4);
}

.cat-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.3s;
}

.cat-card:hover .cat-icon,
.tip:hover .cat-icon,
.feature:hover .cat-icon {
  transform: scale(1.1) rotate(-4deg);
  box-shadow: 0 10px 26px -10px var(--glow);
}

.cat-icon .ico {
  width: 21px;
  height: 21px;
}

.cat-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.cat-body strong {
  font-size: 15px;
  font-weight: 680;
  letter-spacing: -0.015em;
}

.cat-body small {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.4;
}

.cat-arrow {
  color: var(--text-3);
  transition: transform 0.3s var(--ease-out), color 0.3s;
}

.cat-arrow .ico {
  width: 17px;
  height: 17px;
}

.cat-card:hover .cat-arrow {
  transform: translateX(4px);
  color: var(--accent-3);
}

/* shine sweep */
.shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.22) 50%, transparent 65%);
  transform: translateX(-120%);
  pointer-events: none;
}

.cat-card:hover .shine,
.dl-card:hover .shine {
  animation: shine-sweep 1s var(--ease-out);
}

/* tone colors */
.tone-indigo { background: rgba(94, 92, 230, 0.16); color: #5e5ce6; }
.tone-violet { background: rgba(175, 82, 222, 0.16); color: #bf5af2; }
.tone-cyan   { background: rgba(49, 196, 243, 0.16); color: #2aa8d8; }
.tone-blue   { background: rgba(10, 132, 255, 0.16); color: #0a84ff; }
.tone-green  { background: rgba(48, 209, 88, 0.16); color: #28a745; }
.tone-orange { background: rgba(255, 159, 10, 0.16); color: #e68a00; }
.tone-red    { background: rgba(255, 55, 95, 0.14); color: #ff375f; }
.tone-pink   { background: rgba(255, 55, 178, 0.15); color: #f5488f; }
.tone-teal   { background: rgba(90, 200, 200, 0.18); color: #30a8a8; }
.tone-amber  { background: rgba(255, 195, 0, 0.16); color: #c78f00; }

html[data-theme="dark"] .tone-indigo { color: #8b89ff; }
html[data-theme="dark"] .tone-violet { color: #d28bf5; }
html[data-theme="dark"] .tone-cyan   { color: #64d2ff; }
html[data-theme="dark"] .tone-blue   { color: #5eb0ff; }
html[data-theme="dark"] .tone-green  { color: #4cd964; }
html[data-theme="dark"] .tone-orange { color: #ffb340; }
html[data-theme="dark"] .tone-teal   { color: #5ed6d6; }
html[data-theme="dark"] .tone-amber  { color: #ffd60a; }

/* ---------- Feature cards (home) ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 20px;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s, border-color 0.3s;
}

.feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-float);
  border-color: rgba(94, 92, 230, 0.35);
}

.feature h3 {
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -0.016em;
}

.feature p {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.55;
}

/* ---------- Download cards ---------- */
.dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.dl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 18px 16px;
  overflow: hidden;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s, border-color 0.3s;
}

.dl-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-float);
  border-color: rgba(49, 196, 243, 0.35);
}

.dl-card h3 {
  font-size: 15.5px;
  font-weight: 680;
  letter-spacing: -0.018em;
  line-height: 1.35;
  padding-right: 64px;
}

.dl-version code {
  color: var(--accent);
  font-weight: 600;
}

html[data-theme="dark"] .dl-version code {
  color: var(--accent-3);
}

.dl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dl-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-2);
}

.dl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.dl-card.is-hidden {
  display: none;
}

/* ---------- Toolbar / filter ---------- */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 16px;
}

.toolbar-search {
  position: relative;
  display: flex;
  align-items: center;
}

.toolbar-search-ico {
  position: absolute;
  left: 15px;
  color: var(--text-3);
  pointer-events: none;
}

.toolbar-search-ico .ico {
  width: 18px;
  height: 18px;
}

.toolbar-input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  border-radius: 15px;
  background: var(--chip-bg);
  border: 1px solid var(--border-2);
  font-size: 15px;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.toolbar-input::placeholder {
  color: var(--text-3);
}

.toolbar-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(94, 92, 230, 0.15);
}

.toolbar-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toolbar-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
}

.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-2);
  font-size: 15px;
}

/* ---------- Devices ---------- */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.device-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 20px;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s;
}

.device-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-float);
}

.device-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.device-code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--chip-bg);
  border: 1px solid var(--border-2);
}

.device-card h2 {
  font-size: 21px;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.device-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}

.device-chip > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--chip-bg);
}

.device-chip .ico {
  width: 16px;
  height: 16px;
}

.device-specs {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 0;
  border-top: 1px solid var(--border-2);
  border-bottom: 1px solid var(--border-2);
}

.device-specs li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.device-specs span {
  color: var(--text-3);
}

.device-specs strong {
  font-weight: 620;
  text-align: right;
}

.device-markets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.device-warning {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--text-2);
  background: rgba(255, 159, 10, 0.1);
  border: 1px solid rgba(255, 159, 10, 0.3);
  padding: 10px 12px;
  border-radius: 13px;
  line-height: 1.45;
}

.device-warning .ico {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 1px;
  color: #e68a00;
}

.device-actions {
  display: flex;
  gap: 9px;
  margin-top: auto;
}

/* ---------- Tips ---------- */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.tip {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 20px;
  scroll-margin-top: 90px;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s;
}

.tip:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-float);
}

.tip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tip-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tip h2 {
  font-size: 18.5px;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.3;
}

.tip-excerpt {
  color: var(--text-2);
  font-size: 14.5px;
}

.tip-steps {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-2);
  font-size: 14.5px;
}

.tip-steps li::marker {
  color: var(--accent);
  font-weight: 700;
}

.tip-steps strong {
  color: var(--text);
  font-weight: 640;
}

.tip-warning {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: rgba(255, 55, 95, 0.09);
  border: 1px solid rgba(255, 55, 95, 0.3);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

.tip-warning .ico {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin-top: 1px;
  color: var(--accent-pink);
}

/* ---------- FAQ ---------- */
.faq-list {
  padding: 6px 8px;
}

.faq-item {
  border-bottom: 1px solid var(--border-2);
}

.faq-item:last-child {
  border-bottom: 0;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 14px;
  font-size: 15.5px;
  font-weight: 640;
  letter-spacing: -0.012em;
  border-radius: 13px;
  transition: background 0.25s;
}

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

.faq-item summary:hover {
  background: var(--glass-soft);
}

.faq-ico {
  color: var(--text-3);
  transition: transform 0.35s var(--ease-spring);
}

.faq-ico .ico {
  width: 16px;
  height: 16px;
}

.faq-item[open] .faq-ico {
  transform: rotate(90deg);
  color: var(--accent);
}

.faq-body {
  padding: 0 14px 16px;
  color: var(--text-2);
  font-size: 14.5px;
  animation: faq-open 0.35s var(--ease-out);
}

/* ---------- Note ---------- */
.note {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(94, 92, 230, 0.1), rgba(49, 196, 243, 0.07));
  border: 1px solid rgba(94, 92, 230, 0.28);
  box-shadow: none;
}

.note-ico {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--chip-bg);
  color: var(--accent);
}

.note-ico .ico {
  width: 19px;
  height: 19px;
}

.note strong {
  font-size: 14.5px;
  letter-spacing: -0.01em;
  display: block;
  margin-bottom: 3px;
}

.note p {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.55;
}

/* ---------- CTA ---------- */
.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: clamp(26px, 4vw, 40px);
  background: linear-gradient(120deg, rgba(94, 92, 230, 0.16), rgba(49, 196, 243, 0.1) 60%, rgba(255, 55, 95, 0.08));
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: "";
  position: absolute;
  inset: -40% auto auto 40%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(100, 210, 255, 0.25), transparent 65%);
  pointer-events: none;
  animation: float-c 18s ease-in-out infinite alternate;
}

.cta-copy {
  position: relative;
}

.cta h2 {
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  font-weight: 740;
  letter-spacing: -0.028em;
  margin-bottom: 4px;
}

.cta p {
  color: var(--text-2);
  font-size: 15px;
  max-width: 420px;
}

.cta .hero-actions {
  margin: 0;
  position: relative;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 10px;
  padding: clamp(26px, 4vw, 40px) clamp(22px, 3vw, 36px) 22px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 26px;
}

.footer-logo {
  padding: 0;
  margin-bottom: 10px;
}

.footer-brand p {
  font-size: 13.5px;
  color: var(--text-2);
  max-width: 300px;
  line-height: 1.55;
}

.footer h3 {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}

.footer ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer ul a {
  font-size: 13.5px;
  color: var(--text-2);
  transition: color 0.2s, transform 0.2s;
  display: inline-block;
}

.footer ul a:hover {
  color: var(--accent);
  transform: translateX(3px);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border-2);
  font-size: 12px;
  color: var(--text-3);
}

.footer-note {
  color: var(--text-3);
  font-weight: 600;
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  z-index: 40;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px) scale(0.85);
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s var(--ease-spring), box-shadow 0.3s;
}

.to-top .ico {
  width: 19px;
  height: 19px;
}

.to-top.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.to-top:hover {
  box-shadow: var(--shadow-float);
  transform: translateY(-3px) scale(1.05);
}

/* ---------- Reveal on scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Keyframes ---------- */
@keyframes float-a {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-60px, 50px) scale(1.12); }
}

@keyframes float-b {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(70px, -40px) scale(1.08); }
}

@keyframes float-c {
  from { transform: translate(0, 0); }
  to { transform: translate(50px, -60px); }
}

@keyframes gradient-pan {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

@keyframes shine-sweep {
  from { transform: translateX(-120%); }
  to { transform: translateX(120%); }
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.55); }
  50% { box-shadow: 0 0 0 7px rgba(48, 209, 88, 0); }
}

@keyframes row-in {
  from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes indicator-in {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

@keyframes faq-open {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(8, 10, 20, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade-in 0.3s var(--ease-out);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 1100px) {
  .home-hero {
    grid-template-columns: 1fr;
  }

  .home-hero-panel {
    transform: none;
    max-width: 560px;
  }

  .home-hero-panel:hover {
    transform: translateY(-4px);
  }

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

@media (max-width: 960px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w) - 24px));
    transition: transform 0.42s var(--ease-out);
    padding: 12px;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sb-collapse {
    display: none;
  }

  .topbar {
    padding-left: 18px;
  }

  .menu-btn {
    display: grid;
  }

  .main {
    padding-left: 20px;
    padding-right: 20px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .main {
    padding: calc(var(--topbar-h) + 18px) 14px 44px;
    gap: 24px;
  }

  .hide-mobile {
    display: none;
  }

  .hero {
    padding: 26px 18px;
  }

  .home-hero-copy {
    align-items: stretch;
  }

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

  .device-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .device-mini {
    min-width: 0;
  }

  .stats {
    gap: 10px;
  }

  .stat {
    padding: 16px 14px;
  }

  .cat-grid,
  .dl-grid,
  .device-grid,
  .tips-grid {
    grid-template-columns: 1fr;
  }

  .cta {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .cta .hero-actions {
    justify-content: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

  .toolbar-filters .chip-group {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .toolbar-filters .chip-group::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex: 0 0 auto;
  }

  .to-top {
    right: 14px;
    bottom: 14px;
  }
}

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

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
