/* ==========================================================================
   LEARN PHP WITH SHUBH — WORLD-CLASS APPLE-INSPIRED DESIGN SYSTEM
   Principles: Extreme Polish, Editorial Typography, Cinematic Depth, 
   Translucent Materials, Fluid Spring Motion, and Zero Visual Clutter.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS & SYSTEM VARIABLES
   -------------------------------------------------------------------------- */
:root {
  /* Dark Theme (Obsidian & Deep Graphite) */
  --bg-deep: #050608;
  --bg-main: #090a0f;
  --bg-surface: rgba(16, 18, 27, 0.72);
  --bg-surface-hover: rgba(24, 27, 40, 0.85);
  --bg-surface-active: rgba(32, 36, 54, 0.95);
  --bg-code: #0b0d14;
  --bg-code-header: rgba(14, 17, 26, 0.9);
  --bg-subtle: rgba(255, 255, 255, 0.04);
  --bg-subtle-hover: rgba(255, 255, 255, 0.08);

  /* Borders & Dividers */
  --border-hairline: rgba(255, 255, 255, 0.07);
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(99, 102, 241, 0.6);
  --border-card-hover: rgba(129, 140, 248, 0.35);

  /* Typography Colors */
  --text-hero: #FFFFFF;
  --text-main: #F1F5F9;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --text-accent: #818CF8;

  /* Accent & Status */
  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --primary-light: rgba(99, 102, 241, 0.12);
  --primary-glow: rgba(99, 102, 241, 0.25);
  --secondary: #A855F7;
  --cyan: #06B6D4;
  --emerald: #10B981;
  --amber: #F59E0B;
  --rose: #F43F5E;

  /* Typography Stack */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, Monaco, monospace;

  /* Elevation & Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.5), 0 2px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.6), 0 4px 12px -2px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 35px -5px rgba(99, 102, 241, 0.25);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Layout */
  --header-height: 64px;
  --sidebar-width: 310px;
  --container-max: 100%;

  /* Spring-like Easing */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme (Apple Hardware Off-White) */
html.light {
  --bg-deep: #F1F5F9;
  --bg-main: #F8FAFC;
  --bg-surface: rgba(255, 255, 255, 0.85);
  --bg-surface-hover: rgba(255, 255, 255, 0.98);
  --bg-surface-active: #FFFFFF;
  --bg-code: #0F172A;
  --bg-code-header: rgba(15, 23, 42, 0.95);
  --bg-subtle: rgba(0, 0, 0, 0.03);
  --bg-subtle-hover: rgba(0, 0, 0, 0.06);

  --border-hairline: rgba(0, 0, 0, 0.06);
  --border-subtle: rgba(0, 0, 0, 0.1);
  --border-focus: rgba(99, 102, 241, 0.5);
  --border-card-hover: rgba(99, 102, 241, 0.3);

  --text-hero: #0F172A;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --text-dim: #94A3B8;
  --text-accent: #4F46E5;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 35px -5px rgba(99, 102, 241, 0.15);
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.06);
}

/* --------------------------------------------------------------------------
   2. BASE RESETS & GLOBAL STYLING
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

html::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-main);
  line-height: 1.65;
  font-size: 15px;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

::selection {
  background: var(--primary-glow);
  color: var(--text-hero);
}

/* --------------------------------------------------------------------------
   3. ATMOSPHERIC BACKGROUND SYSTEM (HARDWARE ACCELERATED)
   -------------------------------------------------------------------------- */
.bg-ambient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  contain: strict;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  pointer-events: none;
}

.orb-primary {
  top: -10%;
  left: 30%;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.12) 50%, transparent 70%);
}

.orb-secondary {
  top: 45%;
  right: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, rgba(99, 102, 241, 0.1) 50%, transparent 70%);
}

.orb-tertiary {
  bottom: -15%;
  left: 10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.16) 0%, rgba(99, 102, 241, 0.08) 50%, transparent 70%);
}

html.light .ambient-orb {
  opacity: 0.22;
}

/* Lenis Smooth Momentum Scrolling Rules */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

/* Subtle Noise Texture Overlay */
.bg-noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   4. NAVIGATION BAR (FLOATING TRANSLUCENT CAPSULE)
   -------------------------------------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(9, 10, 15, 0.72);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-hairline);
  transition: all 0.3s var(--ease-smooth);
}

html.light .navbar {
  background: rgba(255, 255, 255, 0.8);
}

.nav-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  gap: 1.5rem;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-badge-chip {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 1.15rem;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
  transition: transform 0.25s var(--ease-spring);
}

.logo:hover .logo-badge-chip {
  transform: scale(1.05);
}

.logo-text-wrap {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: -0.025em;
  color: var(--text-hero);
  line-height: 1.2;
}

.logo-sub {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Apple-style Spotlight Search Box */
.search-box {
  flex: 1;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 100%;
  padding: 0.55rem 4.5rem 0.55rem 2.4rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  color: var(--text-hero);
  font-size: 0.84rem;
  outline: none;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  transition: all 0.25s var(--ease-smooth);
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.search-box input:focus {
  background: var(--bg-surface);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
  position: absolute;
  left: 0.95rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  pointer-events: none;
}

.search-kbd {
  position: absolute;
  right: 0.65rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  padding: 0.16rem 0.48rem;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-dim);
  pointer-events: none;
}

html.light .search-kbd {
  background: rgba(0, 0, 0, 0.05);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   5. BUTTON SYSTEM (TACTILE, PHYSICAL & HIGH CONTRAST)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s var(--ease-spring), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(180deg, #6366F1 0%, #4F46E5 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #6E71F5 0%, #5850EC 100%);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-subtle);
  backdrop-filter: blur(12px);
}

.btn-secondary:hover {
  background: var(--bg-subtle-hover);
  color: var(--text-hero);
  border-color: var(--border-focus);
  transform: translateY(-1px);
}

.btn-subtle {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border-color: var(--border-hairline);
}

.btn-subtle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-hero);
  border-color: var(--border-subtle);
}

.btn-sm {
  padding: 0.42rem 0.95rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.85rem 1.85rem;
  font-size: 0.95rem;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}

.icon-btn:hover {
  background: var(--bg-subtle-hover);
  color: var(--text-hero);
  border-color: var(--border-subtle);
}

.icon-btn:active {
  transform: scale(0.95);
}

.theme-icon-light { display: none; }
html.light .theme-icon-dark { display: none; }
html.light .theme-icon-light { display: block; }

.mobile-only { display: none; }

/* --------------------------------------------------------------------------
   6. APP LAYOUT & FLOATING SIDEBAR
   -------------------------------------------------------------------------- */
.app-layout {
  display: flex;
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: calc(100vh - var(--header-height));
  position: relative;
  z-index: 10;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.75rem 1.25rem 2.5rem 1.75rem;
  border-right: 1px solid var(--border-hairline);
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.sidebar::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.sidebar-section-title {
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin: 0.5rem 0 0.75rem 0.5rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Sidebar Accordion Groups */
.sidebar-group {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  backdrop-filter: blur(16px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

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

.sidebar-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.sidebar-group-header:hover {
  background: var(--bg-subtle-hover);
}

.group-title-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  white-space: nowrap;
}

.group-icon-wrap {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--text-accent);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.group-title-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-hero);
  white-space: nowrap;
  letter-spacing: -0.015em;
}

.group-header-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.group-count {
  font-size: 0.68rem;
  font-weight: 750;
  min-width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-hairline);
  padding: 0 0.35rem;
  line-height: 1;
}

.group-chevron {
  font-size: 0.68rem;
  color: var(--text-dim);
  transition: transform 0.3s var(--ease-spring);
  transform: rotate(90deg);
}

.sidebar-group.collapsed .group-chevron {
  transform: rotate(0deg);
}

.sidebar-subnav {
  display: flex;
  flex-direction: column;
  padding: 0.25rem 0.45rem 0.45rem 0.45rem;
  gap: 0.15rem;
  max-height: 500px;
  opacity: 1;
  overflow: hidden;
  border-top: 1px solid var(--border-hairline);
  transition: max-height 0.35s var(--ease-spring), opacity 0.25s ease, padding 0.25s ease;
}

.sidebar-group.collapsed .sidebar-subnav {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top: none;
  pointer-events: none;
}

.sub-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 6px;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sub-link:hover {
  background: var(--bg-subtle);
  color: var(--text-hero);
  transform: translateX(2px);
}

.sub-link:hover .sub-dot {
  background: var(--primary);
  transform: scale(1.3);
}

.sub-link.active {
  background: var(--primary-light);
  color: var(--text-accent);
  font-weight: 600;
}

.sub-link.active .sub-dot {
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

/* Course Roadmap Widget */
.course-roadmap {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.5rem 0;
}

.roadmap-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.roadmap-item.current {
  background: var(--primary-light);
  border-color: var(--border-focus);
  color: var(--text-hero);
  font-weight: 600;
}

.roadmap-item .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
}

.roadmap-item.current .dot {
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
}

.status-tag {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald);
}

.status-tag.locked {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   7. MAIN CONTENT AREA & EDITORIAL HERO
   -------------------------------------------------------------------------- */
.main-content {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 2.5rem 3.5rem 6rem 3.5rem;
}

/* Cinematic Hero Section */
.hero-banner {
  padding: 2.5rem 0 3.5rem 0;
  position: relative;
  width: 100%;
}

.hero-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  border: 1px solid var(--border-focus);
  color: var(--text-accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  backdrop-filter: blur(12px);
}

.hero-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.hero-title {
  font-size: clamp(2.6rem, 5.2vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.038em;
  line-height: 1.05;
  color: var(--text-hero);
  margin-bottom: 1.25rem;
  max-width: 1300px;
}

.hero-gradient-text {
  background: linear-gradient(135deg, #FFFFFF 20%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.light .hero-gradient-text {
  background: linear-gradient(135deg, #0F172A 20%, #64748B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 1.8vw, 1.22rem);
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 1050px;
  margin-bottom: 2rem;
  font-weight: 400;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.hero-stats-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

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

.stat-chip i {
  color: var(--primary);
  font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   8. EDITORIAL CARDS & GLASS CONTAINERS
   -------------------------------------------------------------------------- */
.doc-section {
  margin-bottom: 4.5rem;
  scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

.section-header {
  margin-bottom: 1.75rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.section-header h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-hero);
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
  transition: transform 0.3s var(--ease-spring), border-color 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card:hover {
  border-color: var(--border-card-hover);
  box-shadow: var(--shadow-lg), 0 0 25px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

.card-body {
  padding: 1.75rem 2rem;
}

.card-glow {
  position: relative;
}

.card-glow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.4), transparent);
}

/* Feature Lists */
.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.55;
}

.feature-list li > div {
  flex: 1;
  min-width: 0;
}

.feature-list li i {
  margin-top: 0.2rem;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* Parameter Specifier Badges */
.param-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 1rem 0;
}

.param-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  line-height: 1.55;
  transition: border-color 0.2s ease;
}

.param-item:hover {
  border-color: var(--border-subtle);
}

.param-icon {
  margin-top: 0.15rem;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.param-content {
  flex: 1;
  min-width: 0;
}

.param-title {
  font-weight: 600;
  color: var(--text-hero);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  margin-bottom: 0.15rem;
}

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

.param-sublist {
  margin-top: 0.35rem;
  padding-left: 1.1rem;
  list-style: disc;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Info Callout Boxes */
.info-box {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
}

.info-blue {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
}

.info-blue i {
  color: var(--text-accent);
  font-size: 1.15rem;
  margin-top: 0.1rem;
}

.info-purple {
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.25);
}

.info-purple i {
  color: var(--secondary);
  font-size: 1.15rem;
  margin-top: 0.1rem;
}

/* --------------------------------------------------------------------------
   9. MAC-STYLE CODE CONTAINERS & TERMINALS
   -------------------------------------------------------------------------- */
.code-container {
  margin: 1.25rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-code);
  border: 1px solid var(--border-hairline);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

.mac-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 0.65rem;
}

.mac-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background: #FF5F56; }
.dot-yellow { background: #FFBD2E; }
.dot-green { background: #27C93F; }

.copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
  font-size: 0.72rem;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

.copy-btn:active {
  transform: scale(0.95);
}

pre[class*="language-"] {
  margin: 0 !important;
  padding: 1.25rem !important;
  background: transparent !important;
  font-family: var(--font-mono) !important;
  font-size: 0.86rem !important;
  line-height: 1.65 !important;
  overflow-x: auto;
}

/* Output Preview Windows */
.output-preview {
  margin-top: 1rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-hairline);
}

.output-title {
  padding: 0.5rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-hairline);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--emerald);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.output-box {
  padding: 0.9rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #E2E8F0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   10. FUNCTION BADGES, SYNTAX CHIPS & TABLES
   -------------------------------------------------------------------------- */
.fn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.fn-name {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-hero);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.fn-syntax {
  background: rgba(0, 0, 0, 0.45);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #38BDF8;
  margin: 0.75rem 0;
  white-space: nowrap;
  overflow-x: auto;
  word-break: normal;
  scrollbar-width: none !important;
}

.fn-syntax::-webkit-scrollbar {
  display: none !important;
}

/* Tags & Badges */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tag-success {
  background: rgba(16, 185, 129, 0.14);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.tag-purple {
  background: rgba(168, 85, 247, 0.14);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.tag-danger {
  background: rgba(244, 63, 94, 0.14);
  color: var(--rose);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.tag-php8 {
  background: rgba(99, 102, 241, 0.15);
  color: #A5B4FC;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Apple-style Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  background: rgba(0, 0, 0, 0.2);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}

.data-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.85rem 1.1rem;
  font-weight: 700;
  color: var(--text-hero);
  border-bottom: 1px solid var(--border-hairline);
  letter-spacing: -0.01em;
}

.data-table td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--text-muted);
  line-height: 1.5;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--bg-subtle-hover);
}

/* --------------------------------------------------------------------------
   11. FUNCTION LIBRARY CATEGORY TABS
   -------------------------------------------------------------------------- */
.function-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.f-tab {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.f-tab:hover {
  background: var(--bg-subtle-hover);
  color: var(--text-hero);
  border-color: var(--border-subtle);
}

.f-tab.active {
  background: var(--primary-light);
  border-color: var(--border-focus);
  color: var(--text-accent);
  box-shadow: 0 0 12px var(--primary-glow);
}

.function-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 1.5rem;
}

.fn-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 290px;
  backdrop-filter: blur(16px);
  transition: all 0.25s var(--ease-spring);
}

.fn-card:hover {
  border-color: var(--border-card-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.fn-card .fn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.fn-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-dim);
  border: 1px solid var(--border-hairline);
  white-space: nowrap;
}

.fn-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  line-height: 1.5;
  min-height: 40px;
}

.fn-code {
  background: var(--bg-code);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-top: auto;
}

.fn-code pre {
  padding: 0.75rem 0.95rem !important;
  font-size: 0.82rem !important;
  line-height: 1.6 !important;
  font-family: var(--font-mono) !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
}
  padding: 0.6rem 0.8rem !important;
  font-size: 0.78rem !important;
}

/* --------------------------------------------------------------------------
   12. INTERACTIVE PLAYGROUND / SANDBOX
   -------------------------------------------------------------------------- */
.playground-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.playground-editor, .playground-output {
  display: flex;
  flex-direction: column;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-select, .form-input {
  width: 100%;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-sm);
  background: var(--bg-code);
  border: 1px solid var(--border-hairline);
  color: var(--text-hero);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-select:focus, .form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.playground-output-box {
  flex: 1;
  min-height: 220px;
  background: var(--bg-code);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: #38BDF8;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   13. FOOTER & TOAST NOTIFICATION
   -------------------------------------------------------------------------- */
.footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-hairline);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(16, 18, 27, 0.92);
  border: 1px solid var(--border-focus);
  backdrop-filter: blur(20px);
  color: #FFFFFF;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 15px var(--primary-glow);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s var(--ease-spring), opacity 0.3s ease;
  z-index: 9999;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   14. GRID UTILITIES & HELPERS
   -------------------------------------------------------------------------- */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.w-full { width: 100%; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.font-bold { font-weight: 700; }
.text-green { color: var(--emerald); }
.text-blue { color: #38BDF8; }
.text-purple { color: #C084FC; }
.text-red { color: var(--rose); }
.text-warning { color: var(--amber); }

.code-box-mini {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.code-box-title {
  padding: 0.55rem 0.85rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-hairline);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-hero);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* --------------------------------------------------------------------------
   15. RESPONSIVE DESIGN (320px → 4K)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .sidebar {
    width: 260px;
  }
  .hero-title {
    font-size: 2.8rem;
  }
  .grid-2, .playground-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-only {
    display: inline-flex;
  }
  .search-box {
    display: none;
  }
  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 300px;
    height: calc(100vh - var(--header-height));
    background: var(--bg-deep);
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.35s var(--ease-spring);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    padding: 1.5rem 1.25rem 4rem 1.25rem;
  }
  .card-body {
    padding: 1.25rem 1.25rem;
  }
  .hero-title {
    font-size: 2.2rem;
  }
}

@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;
  }
}

/* ==========================================================================
   16. ANTI-DUMPING & CONTENT PROTECTION
   ========================================================================== */
body {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Allow text selection only within code snippets and form controls */
pre, code, input, textarea, select, .form-input, .form-select, .playground-output-box, .output-box {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

img, svg, a, .card, .btn, .sidebar {
  -webkit-user-drag: none;
  user-drag: none;
}

