/* CIMPLE: THE DEFINITIVE, FINAL, AND COMPLETE STYLESHEET */

/* --- CORE SETUP AND THEME VARIABLES (Original + Enhancements) --- */
html {
  scroll-behavior: smooth;
}

:root {
  --font-main: 'Inter', sans-serif;
  /* Original Dark Mode */
  --bg-color: #121212;
  --text-color: #EAEAEA;
  --text-secondary: #999999;
  --accent-color: #448aff;
  --button-text-color: #FFFFFF;
  --header-bg: rgba(18, 18, 18, 0.7);
  --card-bg: rgba(30, 30, 30, 0.5); /* Retained for non-docs elements */
  --card-border: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.2); /* Added for shadows */

  /* NEW: Custom properties for interactive glow. JS updates these. */
  --mouse-x: 50%;
  --mouse-y: 50%;
}

body.light-mode {
  --bg-color: #f5f5f7;
  --text-color: #1d1d1f;
  --text-secondary: #5a5a5f;
  --accent-color: #0071e3;
  --header-bg: rgba(251, 251, 253, 0.7);
  --card-bg: #ffffff;
  --card-border: rgba(0, 0, 0, 0.1);
  --shadow-color: rgba(0, 113, 227, 0.15); /* Added for shadows */
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-main);
  margin: 0;
  /* MODIFIED: Universal smooth transition for theme switching */
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- HEADER & NAVIGATION (Original + Enhancements) --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10;
  background-color: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  /* MODIFIED: Smoother transition for header background/border on theme change */
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
}

.logo-container a {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
}

.site-logo {
  height: 36px;
  width: auto;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 500;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  margin-left: 24px;
  transition: color .3s cubic-bezier(0.4, 0, 0.2, 1); /* Enhanced easing */
}

.site-nav a:hover {
  color: var(--text-color);
}

.site-nav a.nav-active {
  color: var(--text-color);
  cursor: default;
}
.site-nav a.nav-active:hover { /* Unchanged */
  color: var(--text-color);
}


.theme-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.toggle-track {
  width: 40px;
  height: 22px;
  background-color: #4d4d4d;
  border-radius: 22px;
  position: relative;
  transition: background-color .4s cubic-bezier(0.4, 0, 0.2, 1); /* Enhanced easing */
}

.toggle-thumb {
  width: 16px;
  height: 16px;
  background-color: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  /* MODIFIED: Enhanced bouncy transition */
  transition: transform .4s cubic-bezier(.175,.885,.32,1.275);
}

body.light-mode .toggle-track {
  background-color: var(--accent-color);
}

body.light-mode .toggle-thumb {
  transform: translateX(18px);
}

/* --- ORIGINAL: HERO & GENERAL SECTIONS --- */
.main-content {
  padding-top: 64px;
}

.hero-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: calc(100vh - 64px);
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hero-headline {
  font-size: 6rem;
  font-weight: 800;
  letter-spacing: -2.5px;
  margin: 0;
  min-height: 96px;
}

.hero-alt-name {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-top: .75rem;
}

.hero-alt-name strong {
  font-weight: 500;
  color: var(--text-color);
}

.hero-subheadline {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin: 2rem auto 3rem auto;
  line-height: 1.6;
  max-width: 600px;
}

.content-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 2rem;
  scroll-margin-top: 80px;
  width: 100%;
  box-sizing: border-box;
}

.content-section:not(.hero-section) {
  border-top: 1px solid var(--card-border);
}

.section-title {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 3rem;
  min-height: 64px;
}

.section-paragraph {
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  text-align: left;
}

.feature-item {
  background-color: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  padding: 1.5rem;
  border-radius: 16px;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--text-color);
}

/* --- BUTTONS & LINKS (Original + NEW Shine Effect) --- */
.hero-cta, .community-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.button-elegant {
  background-image: linear-gradient(45deg, var(--accent-color) 0%, #448aff 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #FFF;
  text-decoration: none;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 15px var(--shadow-color); /* Uses new variable */
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); /* Enhanced easing */

  /* NEW: Required for shine effect */
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.button-elegant:hover {
  /* MODIFIED: More pronounced hover effect */
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 8px 30px var(--accent-color);
}

/* NEW: Glossy shine pseudo-element for ALL .button-elegant instances */
.button-elegant::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 70%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-30deg);
    transition: left 0.85s cubic-bezier(0.2, 1, 0.3, 1);
}

.button-elegant:hover::before {
    left: 150%;
}


.cta-link {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
}


/* --- ANIMATIONS & TYPEWRITER (Original + Enhanced Easing) --- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  /* MODIFIED: Professional easing */
  transition: opacity 1.0s cubic-bezier(0.1, 0.8, 0.2, 1), transform 1.0s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.typewriter-heading {
  visibility: hidden;
}

.Typewriter__cursor {
  color: var(--accent-color);
  font-weight: 100;
  font-size: inherit;
}

.Typewriter__wrapper {
  display: inline-block;
}

/* --- MOBILE SIDEBAR (Original + Enhanced Easing) --- */
.hamburger-menu {
  display: none;
  background: none;
  border: none;
  padding: 0;
  margin-left: 1rem;
  cursor: pointer;
  color: var(--text-color);
}

.mobile-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background-color: var(--header-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 1001;
  transform: translateX(100%);
  /* MODIFIED: More professional easing */
  transition: transform .4s cubic-bezier(.25,.46,.45,.94);
  border-left: 1px solid var(--card-border);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  height: 64px;
  border-bottom: 1px solid var(--card-border);
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.close-sidebar-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-color);
  cursor: pointer;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 1rem;
}

.sidebar-nav a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 500;
  padding: .75rem 0;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, .3);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}

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

body.sidebar-open .sidebar-overlay {
  opacity: 1;
  pointer-events: auto;
}

body.sidebar-open {
  overflow: hidden;
}

/* --- ORIGINAL: DOCUMENTATION PAGE LAYOUT --- */
.docs-wrapper {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 64px;
}

.docs-sidebar {
  width: 240px;
  flex-shrink: 0;
  height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
  padding: 2rem;
  border-right: 1px solid var(--card-border);
}

.docs-sidebar nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.docs-sidebar nav a {
  display: block;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  padding: .5rem 0;
  transition: all .2s ease;
}

.docs-sidebar nav a:hover {
  color: var(--text-color);
  padding-left: .25rem;
}

/* The active state is now handled by JS for the indicator to work, but the style is preserved */
.docs-sidebar nav a.active {
  color: var(--accent-color);
  font-weight: 700;
  padding-left: .25rem;
}

.docs-content {
  flex-grow: 1;
  padding: 2rem 3rem;
}

.docs-content section {
  scroll-margin-top: 80px;
  padding: 2rem 0;
}

.docs-content h1 {
  font-size: 2rem;
  text-align: center;
  border: none;
  margin-bottom: 2rem;
  min-height: 32px;
}

.docs-content h2 {
  font-size: 2rem;
  min-height: 38px;
}

.docs-heading-with-icon {
  display: flex;
  align-items: center;
  gap: .75rem;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: .5rem;
  margin-top: 4rem;
}

.heading-icon {
  width: 28px;
  height: 28px;
  stroke: var(--accent-color);
  stroke-width: 1.5;
  flex-shrink: 0;
  fill: none;
}

.docs-heading-with-icon h2 {
  margin: 0;
  border: none;
  padding: 0;
}

.docs-content h3 {
  font-size: 1.4rem;
  margin-top: 2.5rem;
}

/* Pre-existing styling for code blocks and tables */
.docs-content pre {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 1.5rem 2rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
  border-radius: 12px;
  white-space: pre-wrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.docs-content pre code {
  font-family: Menlo, Consolas, monospace;
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
}

.docs-content th,
.docs-content td {
  text-align: left;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--card-border);
}

.docs-content tbody tr:last-child td {
  border-bottom: none;
}

.docs-content ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  line-height: 1.9;
}


/* --- ORIGINAL: RESPONSIVENESS --- */
@media (min-width: 901px) {
  .hero-section,
  .content-section,
  .docs-content > section {
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

@media (max-width: 900px) {
  .docs-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .site-nav {
    display: none;
  }
  .hamburger-menu {
    display: block;
  }
  .hero-headline {
    font-size: 3.5rem;
    min-height: 0;
  }
  .section-title,
  .docs-content h1,
  .docs-content h2 {
    font-size: 2rem;
    min-height: 0;
  }
  .content-section {
    padding: 3rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
    gap: 1rem;
  }
}

/****************************************************************
 * FINAL, SAFELY SCOPED ENHANCEMENTS
 ****************************************************************/

/* 1. Interactive Card Effects (SCOPED TO DOCS PAGE) with BRIGHTER GLOW */
.docs-page .feature-item,
.docs-page .docs-content pre,
.docs-page .docs-content table {
  /* Using these instead of your original selectors ensures this only applies on the docs page */
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.1, 0.8, 0.2, 1), box-shadow 0.4s cubic-bezier(0.1, 0.8, 0.2, 1), background-color 0.4s ease, border-color 0.4s ease;
  transform-style: preserve-3d;
}

.docs-page .feature-item::before,
.docs-page .docs-content pre::before,
.docs-page .docs-content table::before {
    content: "";
    position: absolute;
    left: var(--mouse-x);
    top: var(--mouse-y);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, hsla(217, 100%, 75%, 0.5) 0%, transparent 60%);
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.5s;
    pointer-events: none;
}

.docs-page .feature-item:hover,
.docs-page .docs-content pre:hover,
.docs-page .docs-content table:hover {
  border-color: var(--accent-color) !important; /* Ensures the hover border is visible */
  transform: scale(1.02) perspective(800px) rotateY(-2deg) rotateX(2deg);
  box-shadow: 0 12px V-color);
}

.docs-page .feature-item:hover::before,
.docs-page .docs-content pre:hover::before,
.docs-page .docs-content table:hover::before {
    opacity: 1; /* Reveals the bright glow on hover */
}


/* 2. Sliding Sidebar Indicator (SCOPED TO DOCS PAGE) */
.docs-page .docs-sidebar nav ul {
  position: relative;
}

.docs-page .docs-sidebar nav ul::before {
  content: '';
  position: absolute;
  left: -20px;
  width: 4px;
  height: 25px;
  background-color: var(--accent-color);
  border-radius: 4px;
  transition: top 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease, background-color 0.4s ease;
  top: var(--active-link-top, 0); /* JS will set this variable */
  opacity: var(--active-link-opacity, 0); /* JS will set this */
}