/* ==========================================================================
   CATui Frontend & Docs — Custom Design System with CATui Brand Colors
   Lime Green, Gold & Emerald Theme with Clean Seamless Grid Documentation Layout
   ========================================================================== */

/* Dark Theme Variables (Default) */
:root, html.dark {
  --bg-main: #08080c;
  --bg-topbar: rgba(14, 14, 20, 0.85);
  --bg-card: rgba(18, 18, 26, 0.88);
  --bg-card-hover: rgba(26, 26, 36, 0.95);
  --bg-sidebar: #0a0a0f;
  --bg-code: #0d0d14;
  --bg-code-header: #0b0b10;
  --bg-dropdown: #12121a;
  --bg-btn: rgba(255, 255, 255, 0.08);
  --bg-btn-hover: rgba(255, 255, 255, 0.14);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);

  --text-main: #94a3b8;
  --text-heading: #ffffff;
  --text-muted: #64748b;
  
  /* CATui Official Brand Colors */
  --catui-lime: #a3e635;
  --catui-lime-dark: #65a30d;
  --catui-gold: #facc15;
  --catui-emerald: #22c55e;
  --catui-cyan: #06b6d4;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', Consolas, Monaco, monospace;

  --topbar-height: 64px;

  --shadow-topbar: 0 20px 45px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 24px 60px rgba(0, 0, 0, 0.5);
}

/* Light Theme Variables */
html.light {
  --bg-main: #f8fafc;
  --bg-topbar: rgba(255, 255, 255, 0.9);
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-code: #f1f5f9;
  --bg-code-header: #e2e8f0;
  --bg-dropdown: #ffffff;
  --bg-btn: #f1f5f9;
  --bg-btn-hover: #e2e8f0;

  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.18);

  --text-main: #475569;
  --text-heading: #0f172a;
  --text-muted: #64748b;

  --catui-lime: #65a30d;
  --catui-lime-dark: #4d7c0f;
  --catui-gold: #d97706;
  --catui-emerald: #16a34a;
  --catui-cyan: #0891b2;

  --shadow-topbar: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-card: 0 12px 30px rgba(0, 0, 0, 0.08);
}

/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: scroll;
  position: relative;
}

/* Multi-layered Ambient Orbs & Dot Grid */
.bg-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.65;
  z-index: 0;
}

html.light .bg-pattern {
  background-image: radial-gradient(rgba(0, 0, 0, 0.08) 1px, transparent 1px);
}

.glow-orb {
  position: fixed;
  width: 650px;
  height: 650px;
  border-radius: 50%;
  filter: blur(160px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.26;
  will-change: transform;
  transform: translateZ(0);
}

.glow-lime {
  top: -140px;
  left: -140px;
  background: radial-gradient(circle, rgba(163, 230, 53, 0.35) 0%, rgba(101, 163, 13, 0.15) 50%, transparent 70%);
}

.glow-gold {
  top: 60px;
  right: -140px;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.28) 0%, rgba(163, 230, 53, 0.1) 60%, transparent 70%);
}

.glow-emerald {
  bottom: -220px;
  left: 30%;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.28) 0%, rgba(163, 230, 53, 0.1) 60%, transparent 70%);
}

/* Floating Capsule Topbar Navbar */
.topbar-wrapper {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  width: calc(100% - 36px);
  max-width: 1020px;
  will-change: transform;
}

.topbar-pill {
  height: var(--topbar-height);
  background: var(--bg-topbar);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0 12px 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-topbar);
  transition: all 0.2s ease;
}

.topbar-brand {
  display: flex;
  align-items: center;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.topbar-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.logo-desktop {
  display: block;
}

.logo-mobile {
  display: none;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.96rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--text-heading);
}

.nav-link.active {
  color: var(--catui-lime);
  font-weight: 800;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Modern Flat Theme, Discord & Git Icon Buttons */
.theme-toggle-flat {
  background: var(--bg-btn);
  border: 1px solid var(--border-color);
  color: var(--text-heading);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.git-toggle-flat,
.discord-toggle-flat {
  text-decoration: none;
  display: inline-flex;
}

.discord-toggle-flat:hover {
  color: #5865f2;
}

.theme-toggle-flat:hover {
  background: var(--bg-btn-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.theme-icon {
  display: none;
}

html.dark .moon-icon {
  display: block;
  color: var(--catui-gold);
}

html.light .sun-icon {
  display: block;
  color: #f59e0b;
}

/* Language Dropdown Selector — Centered Relative to Button */
.lang-dropdown {
  position: relative;
}

.lang-dropdown-btn {
  background: var(--bg-btn);
  border: 1px solid var(--border-color);
  color: var(--text-heading);
  min-width: 140px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.15s ease;
}

.lang-dropdown-btn:hover {
  background: var(--bg-btn-hover);
  border-color: var(--border-hover);
}

/* Dropdown Menu - Perfectly Centered Relative to Button */
.lang-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-dropdown);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-topbar);
  width: max-content;
  min-width: 175px;
  z-index: 600;
  padding: 8px;
  flex-direction: column;
  gap: 4px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.lang-dropdown-menu.show {
  display: flex;
}

.lang-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: none;
  border: 1px solid transparent;
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.15s ease;
}

.lang-option:hover {
  background: var(--bg-btn-hover);
  color: var(--text-heading);
}

.lang-option.active {
  color: var(--catui-lime);
  font-weight: 700;
  background: rgba(163, 230, 53, 0.12);
}

.lang-tag {
  font-size: 0.72rem;
  color: var(--catui-gold);
  font-family: var(--font-mono);
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Hamburger Menu Button (hidden on desktop) */
.hamburger-btn {
  display: none;
}

.hamburger-icon,
.hamburger-close-icon {
  display: none;
}

.hamburger-btn .hamburger-icon {
  display: block;
}

.hamburger-btn.open .hamburger-icon {
  display: none;
}

.hamburger-btn.open .hamburger-close-icon {
  display: block;
}

/* Mobile Menu Overlay */
.mobile-menu {
  display: none;
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 499;
  width: calc(100% - 36px);
  max-width: 400px;
}

.mobile-menu.open {
  display: block;
}

.mobile-menu-card {
  background: var(--bg-dropdown);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 16px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-topbar);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
}

.mobile-menu-link:hover {
  background: var(--bg-btn-hover);
  color: var(--text-heading);
}

.mobile-menu-link.active {
  color: var(--catui-lime);
  background: rgba(163, 230, 53, 0.12);
  font-weight: 800;
}

.mobile-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 6px 12px;
}

.mobile-menu-social {
  font-size: 0.92rem;
  font-weight: 500;
}

/* View Containers Router */
.view-container {
  display: none;
  position: relative;
  z-index: 10;
}

.view-container.active {
  display: block;
}

/* Home Landing Page View */
#homeView {
  padding-top: 125px;
  padding-bottom: 80px;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Hero Showcase Section */
.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 72px;
}

/* Big White Image Placeholder Frame */
.hero-display-card {
  width: 100%;
  max-width: 1040px;
  height: 560px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 28px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.65), 0 0 60px rgba(168, 85, 247, 0.15);
  overflow: hidden;
  margin-bottom: 32px;
  position: relative;
  transition: all 0.25s ease;
}

.hero-display-card:hover {
  box-shadow: 0 38px 90px rgba(0, 0, 0, 0.75), 0 0 70px rgba(163, 230, 53, 0.25);
  transform: translateY(-2px);
}

.display-img-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 28px;
  display: block;
}

/* Hero Tagline — Centered Glass Pill */
.hero-tagline {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  border-radius: 999px;
  padding: 16px 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 620px;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.hero-tagline span {
  font-size: 1.05rem;
  color: var(--text-heading);
  font-weight: 600;
  line-height: 1.5;
}

/* Vibrant CATui Brand Text Gradient */
.text-gradient {
  background: linear-gradient(135deg, #a3e635 0%, #facc15 50%, #22c55e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

/* Section Containers */
.section-container {
  margin-bottom: 96px;
}

.section-header {
  margin-bottom: 44px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* Minimalist & Open Feature Showcase (No Heavy Dark Panels) */
.feature-showcase-section {
  width: 100%;
}

.clean-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 64px 48px;
}

.clean-showcase-item {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.clean-showcase-item.full-width {
  grid-column: span 2;
}

.item-header .faq-gradient-title {
  font-size: 2.2rem;
  margin-bottom: 8px;
  line-height: 1.25;
}

.item-sub {
  font-size: 1.05rem;
  color: var(--text-main);
  line-height: 1.6;
}

/* Pure White Display Frames Standing Cleanly on Ambient Background */
.white-display-frame {
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 24px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  position: relative;
}

.social-frame {
  height: 340px;
}

.ramp-wide-frame {
  height: 520px;
}

.frame-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
  display: block;
}

/* RetroAchievements Grid of Small White Rounded Squares */
.achievements-white-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

.achievement-white-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.achievement-white-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

/* FAQ Section */
.faq-section {
  width: 100%;
}

.faq-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: start;
}

.faq-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.faq-gradient-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #a3e635 0%, #facc15 60%, #22c55e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.faq-accordion-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 16px 28px;
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

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

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

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  background: none;
  border: none;
  color: var(--text-heading);
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: color 0.15s ease;
}

.faq-question:hover {
  color: var(--catui-lime);
}

.faq-toggle-icon {
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.faq-item.open .faq-toggle-icon {
  transform: rotate(45deg);
  color: var(--catui-lime);
}

.faq-answer {
  display: none;
  padding-bottom: 20px;
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  display: block;
}

/* Clean & Responsive Footer Floating Card Section */
.footer-card-container {
  margin-top: 80px;
  margin-bottom: 40px;
}

.footer-glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 40px 48px;
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow-card);
}

.footer-main-row {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 48px;
}

.footer-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.footer-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 12px;
  margin-bottom: 16px;
}

.footer-godot-banner {
  height: 52px;
  width: auto;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

.footer-godot-banner:hover {
  opacity: 1;
}

.footer-links-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.footer-col-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 14px;
}

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

.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: var(--catui-lime);
}

/* Download View — Platform Cards + GitHub */
#downloadView {
  padding-top: 140px;
  padding-bottom: 80px;
  max-width: 760px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.download-hero-section {
  min-height: calc(100vh - 220px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.download-main-title {
  font-size: 4rem;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.8px;
  margin-bottom: 6px;
}

.platform-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

.platform-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 36px 20px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
  opacity: 0.38;
  cursor: default;
  user-select: none;
}

.platform-card:hover {
  border-color: var(--border-color);
}

.platform-available {
  opacity: 1;
  cursor: pointer;
  user-select: auto;
}

.platform-icon-wrap {
  color: var(--catui-lime);
}

.platform-icon-wrap img,
.platform-icon-wrap svg {
  width: 46px;
  height: 46px;
}

.platform-name {
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text-heading);
}

.platform-soon {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.7;
  letter-spacing: 0.3px;
  backdrop-filter: blur(4px);
}

.platform-dl-btn {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0a0a0f;
  background: var(--catui-lime);
  padding: 9px 26px;
  border-radius: 999px;
  text-decoration: none;
}

.download-security-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 420px;
  line-height: 1.55;
  margin: 0 auto 48px;
}

.download-github-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.download-github-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--bg-btn);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.download-github-link:hover {
  background: var(--bg-btn-hover);
  border-color: var(--border-hover);
  color: var(--text-heading);
}

/* Home View — White Display Frames */

/* ==========================================================================
   Docs View Page — Clean, Seamless Grid Layout (High Performance & Beautiful)
   ========================================================================== */
#docsView {
  padding-top: 115px;
  padding-bottom: 80px;
  min-height: 100vh;
}

.doc-container {
  display: grid;
  grid-template-columns: 260px 1fr 220px;
  gap: 48px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  align-items: start;
}

/* Left Navigation Sidebar */
.sidebar {
  width: 100%;
  background: transparent;
  padding-right: 20px;
  border-right: 1px solid var(--border-color);
  position: sticky;
  top: 115px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

/* Sidebar Search Filter Component — Cohesive with Category Item Buttons */
.sidebar-search-wrap {
  margin-bottom: 20px;
  width: 100%;
}

.sidebar-search-box {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.15s ease;
}

.sidebar-search-box:focus-within {
  border-color: rgba(163, 230, 53, 0.35);
  background: rgba(163, 230, 53, 0.08);
  box-shadow: 0 0 16px rgba(163, 230, 53, 0.18);
}

.sidebar-search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-heading);
  font-size: 0.92rem;
  font-family: var(--font-sans);
  font-weight: 500;
}

.sidebar-search-input::placeholder {
  color: var(--text-muted);
  opacity: 0.75;
}

.sidebar-group {
  margin-bottom: 28px;
}

.sidebar-heading {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--catui-lime);
  margin-bottom: 12px;
  padding: 0 12px;
}

.sidebar-link {
  display: block;
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 10px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.sidebar-link:hover {
  color: var(--text-heading);
  background: var(--bg-btn-hover);
}

.sidebar-link.active {
  color: var(--catui-lime);
  background: rgba(163, 230, 53, 0.12);
  border-color: rgba(163, 230, 53, 0.25);
  font-weight: 700;
}

/* Center Article Content Area */
.main-content {
  width: 100%;
  min-width: 0;
  padding-bottom: 60px;
}

.page-title {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.8px;
  margin-bottom: 24px;
  line-height: 1.25;
}

h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-heading);
  margin: 40px 0 18px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  scroll-margin-top: 120px;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 28px 0 14px 0;
  scroll-margin-top: 120px;
}

p {
  margin-bottom: 18px;
  color: var(--text-main);
  font-size: 1.02rem;
  line-height: 1.7;
}

ul.clean-list, ol.clean-ol {
  margin: 0 0 24px 24px;
  color: var(--text-main);
}

li {
  margin-bottom: 8px;
}

code {
  font-family: var(--font-mono);
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.9em;
  color: var(--catui-lime);
}

.code-block-wrapper {
  margin-bottom: 28px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-code-header);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 18px;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.copy-btn {
  background: var(--bg-btn);
  border: 1px solid var(--border-color);
  color: var(--text-heading);
  font-size: 0.78rem;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: var(--bg-btn-hover);
}

.code-block {
  background-color: var(--bg-code);
  padding: 16px 20px;
  overflow-x: auto;
  margin: 0;
  line-height: 1.5;
}

.code-block code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-heading);
  font-size: 0.94rem;
  line-height: 1.5;
  font-family: var(--font-mono);
  white-space: pre;
  display: block;
}

/* Right Table of Contents (TOC) Sidebar */
.toc-sidebar {
  width: 100%;
  background: transparent;
  padding-left: 20px;
  border-left: 1px solid var(--border-color);
  position: sticky;
  top: 115px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.toc-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-link {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: all 0.15s ease;
}

.toc-link:hover {
  color: var(--text-heading);
}

.toc-link.active {
  color: var(--catui-lime);
  border-left-color: var(--catui-lime);
  font-weight: 700;
}

/* Docs Mobile Sidebar Toggle Pill (hidden on desktop, fixed bottom-left on mobile) */
.docs-toggle-pill {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 16px;
  z-index: 450;
  background: rgba(163, 230, 53, 0.15);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(163, 230, 53, 0.3);
  border-radius: 999px;
  padding: 14px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(163, 230, 53, 0.25);
  transition: all 0.2s ease;
}

.docs-toggle-pill:hover {
  background: rgba(163, 230, 53, 0.25);
  border-color: rgba(163, 230, 53, 0.5);
  box-shadow: 0 8px 32px rgba(163, 230, 53, 0.4);
  transform: scale(1.06);
}

.docs-toggle-pill svg {
  stroke: var(--catui-lime);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 850;
}

.sidebar-overlay.show {
  display: block;
}

.text-center {
  text-align: center;
}

/* Responsive Media Queries */
@media (max-width: 1100px) {
  .doc-container {
    grid-template-columns: 250px 1fr;
    gap: 36px;
  }

  .toc-sidebar {
    display: none;
  }
}

@media (max-width: 900px) {
  .clean-features-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .clean-showcase-item.full-width {
    grid-column: span 1;
  }

  .ramp-wide-frame {
    height: 320px;
  }

  .faq-layout {
    grid-template-columns: 1fr;
  }

  .faq-header {
    align-items: flex-start;
    text-align: left;
  }
}

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

  .logo-mobile {
    display: block;
    height: 30px;
    width: auto;
    object-fit: contain;
  }

  .topbar-wrapper {
    width: calc(100% - 20px);
    top: 12px;
  }

  .topbar-pill {
    padding: 0 16px 0 20px;
    height: 66px;
  }

  .topbar-links {
    display: none;
  }

  .discord-toggle-flat,
  .git-toggle-flat {
    display: none;
  }

  .hamburger-btn {
    display: flex;
  }

  .topbar-controls {
    gap: 8px;
  }

  .theme-toggle-flat {
    width: 44px;
    height: 44px;
  }

  .theme-toggle-flat svg {
    width: 20px;
    height: 20px;
  }

  .lang-dropdown-btn {
    min-width: 100px;
    height: 44px;
    padding: 0 16px;
    font-size: 0.84rem;
  }

  .lang-dropdown-menu {
    left: auto;
    right: 0;
    transform: none;
    min-width: 170px;
  }

  .lang-option {
    padding: 12px 16px;
    font-size: 0.92rem;
  }

  .lang-tag {
    font-size: 0.76rem;
  }

  .mobile-menu {
    top: 90px;
  }

  .hero-display-card {
    height: 300px;
    border-radius: 20px;
  }

  .hero-tagline {
    padding: 14px 28px;
    max-width: 100%;
  }

  .hero-tagline span {
    font-size: 0.92rem;
  }

  .footer-glass-card {
    padding: 32px 24px;
  }

  .footer-main-row {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-links-cols {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .white-display-frame {
    height: 260px;
    border-radius: 20px;
  }

  .social-frame {
    height: 260px;
  }

  .ramp-wide-frame {
    height: 280px;
  }

  .achievements-white-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .item-header .faq-gradient-title {
    font-size: 1.8rem;
  }

  /* FAQ Section Mobile Spacing Optimization */
  .faq-section {
    margin-bottom: 60px;
  }

  .faq-layout {
    gap: 16px;
  }

  .faq-header {
    margin-bottom: 44px;
  }

  .faq-gradient-title {
    font-size: 2.2rem;
  }

  .faq-accordion-card {
    padding: 12px 18px;
    border-radius: 18px;
  }

  .faq-question {
    font-size: 0.94rem;
    padding: 14px 0;
    gap: 10px;
  }

  .faq-answer {
    font-size: 0.88rem;
    line-height: 1.6;
    padding-bottom: 14px;
  }

  #downloadView {
    padding-top: 105px;
    max-width: 440px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .download-main-title {
    font-size: 2.4rem;
  }

  .platform-cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .platform-card {
    flex-direction: row;
    padding: 18px 20px;
    gap: 14px;
    text-align: left;
    align-items: center;
  }

  .platform-icon-wrap svg {
    width: 28px;
    height: 28px;
  }

  .platform-name {
    flex: 1;
    font-size: 0.9rem;
  }

  /* Docs Section Mobile Spacing Optimization */
  #docsView {
    padding-top: 90px;
    padding-bottom: 60px;
    overflow-x: hidden;
  }

  .doc-container {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 24px;
  }

  .main-content {
    padding: 0 24px 40px 24px;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  p {
    font-size: 0.95rem;
    margin-bottom: 14px;
    line-height: 1.65;
  }

  ul.clean-list, ol.clean-ol {
    margin: 0 0 18px 18px;
    font-size: 0.92rem;
  }

  .code-block {
    white-space: pre-wrap;
    word-break: break-all;
    padding: 12px 14px;
    font-size: 0.82rem;
  }

  .code-block-wrapper,
  .code-block-wrapper pre,
  .code-block-wrapper code,
  img,
  table {
    max-width: 100%;
  }

  .page-title {
    font-size: 1.95rem;
    margin-bottom: 18px;
    letter-spacing: -0.4px;
  }

  h2 {
    font-size: 1.35rem;
    margin: 28px 0 12px 0;
    padding-bottom: 6px;
    scroll-margin-top: 85px;
  }

  h3 {
    font-size: 1.1rem;
    margin: 20px 0 10px 0;
    scroll-margin-top: 85px;
  }

  p {
    font-size: 0.95rem;
    margin-bottom: 14px;
    line-height: 1.65;
  }

  ul.clean-list, ol.clean-ol {
    margin: 0 0 18px 18px;
    font-size: 0.92rem;
  }

  .code-block-wrapper {
    margin-bottom: 20px;
    border-radius: 10px;
  }

  .code-header {
    padding: 8px 14px;
    font-size: 0.78rem;
  }

  .code-block {
    padding: 12px 14px;
    font-size: 0.82rem;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-height: 100vh;
    background: var(--bg-dropdown);
    padding: 90px 20px 40px 20px;
    z-index: 900;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    border-right: 1px solid var(--border-color);
  }

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

  .docs-toggle-pill {
    display: flex;
  }
}

@media (max-width: 480px) {
  .topbar-wrapper {
    width: calc(100% - 16px);
    top: 10px;
  }

  .topbar-pill {
    padding: 0 14px 0 16px;
    height: 60px;
  }

  .logo-mobile {
    height: 28px;
  }

  .theme-toggle-flat {
    width: 42px;
    height: 42px;
  }

  .theme-toggle-flat svg {
    width: 18px;
    height: 18px;
  }

  .lang-dropdown-btn {
    min-width: 90px;
    height: 42px;
    padding: 0 12px;
    font-size: 0.78rem;
  }

  .lang-dropdown-menu {
    min-width: 160px;
  }

  .mobile-menu {
    top: 86px;
    width: calc(100% - 28px);
  }

  .mobile-menu-link {
    padding: 13px 16px;
    font-size: 0.95rem;
  }

  #homeView {
    padding-top: 100px;
    padding-left: 14px;
    padding-right: 14px;
  }

  #docsView {
    padding-top: 90px;
  }

  .doc-container {
    padding: 0;
  }

  .main-content {
    padding: 0 18px 40px 18px;
  }

  .hero-display-card {
    height: 220px;
  }

  .hero-tagline {
    padding: 12px 22px;
    border-radius: 999px;
  }

  .hero-tagline span {
    font-size: 0.84rem;
  }

  .doc-container {
    padding: 0 16px;
  }

  .page-title {
    font-size: 1.7rem;
  }

  .faq-accordion-card {
    padding: 10px 14px;
  }

  .faq-gradient-title {
    font-size: 1.9rem;
  }
}

@media (max-width: 400px) {
  .topbar-wrapper {
    width: calc(100% - 12px);
    top: 8px;
  }

  .topbar-pill {
    padding: 0 12px 0 14px;
    height: 56px;
  }

  .logo-mobile {
    height: 26px;
  }

  .theme-toggle-flat {
    width: 40px;
    height: 40px;
  }

  .theme-toggle-flat svg {
    width: 17px;
    height: 17px;
  }

  .lang-dropdown-btn {
    min-width: 82px;
    height: 40px;
    padding: 0 11px;
    font-size: 0.76rem;
  }

  .mobile-menu {
    top: 80px;
    width: calc(100% - 24px);
  }

  .mobile-menu-link {
    padding: 12px 14px;
    font-size: 0.92rem;
  }
}
