/* Base Styles - Minimal Normalize + Typography */

/* Minimal Normalize */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-background);
  min-height: 100vh;
}

/* ============================================
   ELEGANT CUSTOM SCROLLBARS
   ============================================ */

/* For Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}

::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 4px;
  transition: all 0.3s ease;
  box-shadow: 0 0 4px rgba(45, 80, 22, 0.2);
  opacity: 0.6;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-light);
  box-shadow: 0 0 8px rgba(45, 80, 22, 0.4);
  border-radius: 6px;
  opacity: 1;
}

::-webkit-scrollbar-thumb:active {
  background: var(--color-primary-dark);
  box-shadow: 0 0 12px rgba(45, 80, 22, 0.6);
}

/* For Firefox */
* {
  scrollbar-color: var(--color-primary) transparent;
  scrollbar-width: thin;
}

/* Glow animation on active scroll */
@keyframes scrollGlow {
  0% {
    box-shadow: 0 0 4px rgba(45, 80, 22, 0.2);
  }
  50% {
    box-shadow: 0 0 12px rgba(45, 80, 22, 0.5);
  }
  100% {
    box-shadow: 0 0 4px rgba(45, 80, 22, 0.2);
  }
}

/* Apply glow during active scrolling */
::-webkit-scrollbar-thumb:active {
  animation: scrollGlow 0.6s ease-in-out;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  z-index: var(--z-tooltip);
  border-radius: 0 0 var(--radius-md) 0;
}

.skip-link:focus {
  top: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

h1 {
  font-size: var(--font-size-4xl);
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-base);
}

p {
  margin-bottom: var(--space-md);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Lists */
ul, ol {
  list-style: none;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Form Elements */
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Responsive Images */
@media (max-width: 767px) {
  html {
    font-size: 14px;
  }
  
  h1 {
    font-size: var(--font-size-3xl);
  }
  
  h2 {
    font-size: var(--font-size-2xl);
  }
  
  h3 {
    font-size: var(--font-size-xl);
  }
  
  /* Disable fixed attachment on mobile for performance */
  .hero,
  .challenge-banner,
  .categories,
  .trending,
  .featured-creators,
  .email-capture,
  .discover,
  .grow-page,
  .video-page,
  .recipes-page,
  .learn-page,
  .auth-page,
  .profile-page,
  .profile-page__banner {
    background-attachment: scroll !important;
  }
}

