:root {
  --bg: #0f1117;
  --bg-panel: #181b24;
  --bg-card: #1e2230;
  --bg-elevated: #252a3a;
  --ink: #eef0f6;
  --ink-soft: #9aa3b8;
  --accent: #ff6b4a;
  --accent-glow: rgba(255, 107, 74, 0.35);
  --violet: #8b5cf6;
  --violet-soft: rgba(139, 92, 246, 0.15);
  --border: #2e3548;
  --link: #ff8a70;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1240px;
  --header-h: 68px;
  --font: "Noto Sans SC", "IBM Plex Sans", sans-serif;
  --font-display: "Space Grotesk", "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.82;
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 50% at 10% -10%, var(--violet-soft), transparent),
    radial-gradient(ellipse 50% 40% at 90% 0%, rgba(255, 107, 74, 0.12), transparent),
    var(--bg);
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); text-decoration: underline; }
.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(15, 17, 23, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand img { border-radius: 10px; }
.brand b { color: var(--accent); font-weight: 700; }

.site-nav ul { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.site-nav a:hover,
.site-nav a.active {
  background: var(--violet-soft);
  color: var(--accent);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 10px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: 0.2s;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.ads-top-bar {
  padding: 0.5rem 0;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}
#ads {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  background: transparent;
  margin: 10px 0;
  gap: 0.5rem;
}
#ads > div,
#ads .ads-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 70px;
}
#ads img {
  width: 65px;
  height: 65px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 180ms ease;
}
#ads img:hover { transform: translateY(-4px) scale(1.04); }
#ads figcaption,
#ads .caption {
  height: 15px;
  font-size: 11px;
  color: var(--ink-soft);
  text-align: center;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 4px;
}
.applist-title { text-align: center; font-size: 0.88rem; color: var(--ink-soft); }

/* Hero mosaic shell */
.mosaic-hero {
  padding: 2.5rem 0 1.5rem;
}
.mosaic-hero-inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.5rem;
  align-items: center;
}
.hero-badge {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(255, 107, 74, 0.12);
  border: 1px solid rgba(255, 107, 74, 0.3);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  margin-bottom: 1rem;
}
.mosaic-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2.15rem);
  line-height: 1.35;
  margin: 0 0 1rem;
}
.mosaic-hero .lead { color: var(--ink-soft); margin: 0 0 1.25rem; }

.partner-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.25rem 0;
}
.partner-strip a {
  padding: 0.45rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  color: var(--ink);
}
.partner-strip a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.hero-visual {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hero-visual img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }

/* Unique Bento mosaic grid */
.mosaic-bento {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-auto-rows: minmax(100px, auto);
  gap: 0.85rem;
  margin: 2rem 0;
}
.mosaic-cell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s;
}
.mosaic-cell:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 107, 74, 0.45);
  box-shadow: 0 12px 36px var(--accent-glow);
}
.mosaic-cell a { display: block; color: inherit; height: 100%; }
.mosaic-cell a:hover { text-decoration: none; }
.mosaic-cell img { width: 100%; object-fit: cover; }
.mosaic-cell .cell-body { padding: 0.85rem 1rem 1rem; }
.mosaic-cell h3 {
  font-family: var(--font-display);
  font-size: 0.98rem;
  margin: 0 0 0.3rem;
  color: var(--ink);
}
.mosaic-cell p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.cell-hero { grid-column: span 4; grid-row: span 2; }
.cell-hero img { aspect-ratio: 4/3; min-height: 100%; }
.cell-tall { grid-column: span 2; grid-row: span 3; }
.cell-tall img { aspect-ratio: 3/4; min-height: 180px; }
.cell-wide { grid-column: span 4; grid-row: span 1; }
.cell-wide img { aspect-ratio: 21/9; }
.cell-square { grid-column: span 2; grid-row: span 2; }
.cell-square img { aspect-ratio: 1; }
.cell-text {
  grid-column: span 2;
  grid-row: span 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
  padding: 1rem 1.1rem;
}
.cell-text .stat {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.cell-text .label { font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.25rem; }

.jump-rail {
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 100;
  background: rgba(24, 27, 36, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0;
  margin-bottom: 1.5rem;
}
.jump-rail nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}
.jump-rail a {
  font-size: 0.82rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--ink-soft);
}
.jump-rail a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

.content-zone { padding: 0 0 3rem; }
.section-block { padding: 2rem 0; }
.section-block.alt { background: rgba(24, 27, 36, 0.55); border-block: 1px solid var(--border); }
.section-head { margin-bottom: 1.25rem; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
  color: var(--ink);
}
.section-head p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

.prose p { margin: 0 0 1rem; }
.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.4rem; }
.prose li { margin-bottom: 0.35rem; }

.callout {
  border-left: 4px solid var(--accent);
  background: rgba(255, 107, 74, 0.08);
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}
.tag-cloud span {
  font-size: 0.78rem;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  background: var(--violet-soft);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.faq-grid {
  display: grid;
  gap: 0.85rem;
}
.faq-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
}
.faq-card h3 { font-size: 0.95rem; margin: 0 0 0.45rem; color: var(--accent); }
.faq-card p { margin: 0; font-size: 0.9rem; color: var(--ink-soft); }

.page-hero {
  padding: 2rem 0 1rem;
  background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0;
}
.breadcrumb { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.75rem; }
.breadcrumb a { color: var(--ink-soft); }

.site-footer {
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.75rem; }
.footer-links a { color: var(--ink-soft); }

.error-wrap { text-align: center; padding: 4rem 1rem; }
.error-wrap .code {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
  line-height: 1;
}
.error-wrap h1 { font-size: 1.35rem; margin: 0.5rem 0; }

@media (max-width: 960px) {
  .mosaic-hero-inner { grid-template-columns: 1fr; }
  .mosaic-bento { grid-template-columns: repeat(4, 1fr); }
  .cell-hero, .cell-wide { grid-column: span 4; }
  .cell-tall, .cell-square { grid-column: span 2; grid-row: span 2; }
  .cell-text { grid-column: span 2; }
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem;
    transform: translateY(-120%);
    opacity: 0;
    transition: 0.25s;
    pointer-events: none;
    z-index: 400;
  }
  .site-nav.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .site-nav ul { flex-direction: column; }
  .mosaic-bento { grid-template-columns: 1fr 1fr; }
  .cell-hero, .cell-wide, .cell-tall, .cell-square, .cell-text { grid-column: span 2; grid-row: span 1; }
  .ads-top-bar .container { width: 100%; padding-inline: 0.75rem; }
  #ads {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    justify-content: flex-start;
  }
  #ads::-webkit-scrollbar { display: none; }
  #ads > div, #ads .ads-item { width: 84px; flex-shrink: 0; scroll-snap-align: center; }
}
