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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background:
    linear-gradient(180deg, rgba(5, 8, 22, 0.92) 0%, rgba(8, 18, 32, 0.98) 44%, #050816 100%),
    #050816;
  color: white;
  overflow-x: hidden;
}

.page-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
}

.glass {
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.gradient-text {
  background: linear-gradient(135deg, #67E8F9 0%, #A7F3D0 46%, #FDE68A 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.course-card {
  min-height: 100%;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.course-card:hover {
  transform: translateY(-6px);
  border-color: rgba(103, 232, 249, 0.35);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.course-card:hover .course-image {
  transform: scale(1.05);
}

.course-image {
  transition: transform 0.45s ease;
}

.course-card:focus-visible,
.nav-link:focus-visible,
.action-link:focus-visible {
  outline: 2px solid #67E8F9;
  outline-offset: 4px;
}

.section-label {
  color: #67E8F9;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.soft-divider {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  height: 1px;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s ease-out both;
}

@media (max-width: 768px) {
  .mobile-tight {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 640px) {
  html,
  body {
    max-width: 100vw;
    overflow-x: hidden;
  }

  body .max-w-7xl {
    max-width: 100% !important;
  }

  .site-header-inner {
    padding-left: 1rem;
    padding-right: 1rem;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    max-width: 100vw !important;
  }

  .brand-link {
    gap: 0.75rem;
    min-width: 0;
  }

  .brand-mark {
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
  }

  .brand-title {
    font-size: 1.35rem;
    line-height: 1.1;
  }

  .brand-subtitle {
    display: none;
  }

  .top-cta {
    display: none;
  }

  .hero-copy {
    overflow-wrap: anywhere;
    word-break: break-all;
    max-width: calc(100vw - 2rem);
  }

  img {
    max-width: 100%;
  }
}

/* Course Detail Drawer Styles */
#course-drawer-overlay {
  transition: opacity 0.3s ease;
}

#course-drawer-overlay:not(.hidden) {
  opacity: 1;
}

#course-drawer-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Mobile: slide up from bottom */
@media (max-width: 767px) {
  #course-drawer-panel {
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    border-radius: 20px 20px 0 0;
  }

  #course-drawer-overlay:not(.hidden) #course-drawer-panel {
    transform: translateY(0);
  }

  #course-drawer-overlay.hidden #course-drawer-panel {
    transform: translateY(100%);
  }
}

/* Desktop/Tablet: scale + fade in center */
@media (min-width: 768px) {
  #course-drawer-panel {
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  #course-drawer-overlay:not(.hidden) #course-drawer-panel {
    transform: scale(1);
    opacity: 1;
  }

  #course-drawer-overlay.hidden #course-drawer-panel {
    transform: scale(0.95);
    opacity: 0;
  }
}

/* Prevent body scroll when drawer is open */
body.drawer-open {
  overflow: hidden;
}

/* Mobile optimizations for all-courses page */
@media (max-width: 767px) {
  /* Hide scrollbar for category nav */
  .scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .scrollbar-hide::-webkit-scrollbar {
    display: none;
  }

  /* Course card touch feedback */
  .course-card-trigger:active {
    transform: scale(0.98);
  }

  /* Smooth scroll behavior */
  html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  /* Better spacing for mobile sections */
  .course-section {
    padding-bottom: 0.5rem;
  }

  /* Improve tap targets */
  .category-btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Prevent horizontal scroll */
  body {
    position: relative;
  }
}

/* Desktop background effects */
@media (min-width: 768px) {
  .page-grid {
    position: relative;
  }
  
  .page-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
      radial-gradient(ellipse at 20% 50%, rgba(103, 232, 249, 0.08) 0%, transparent 50%),
      radial-gradient(ellipse at 80% 20%, rgba(167, 243, 208, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
  }
}
