/* ==========================================================================
   CREAMSON FOODS — BASE STYLES & TYPOGRAPHY
   Premium Organic Nutraceutical Aesthetic
   ========================================================================== */

/* --- Modern CSS Reset (Bulletproof) --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-canvas);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* --- Selection Highlight --- */
::selection {
  background-color: var(--color-forest);
  color: var(--color-cream-bg, #FAF7F2);
}

::-moz-selection {
  background-color: var(--color-forest);
  color: var(--color-cream-bg, #FAF7F2);
}

/* ==========================================================================
   TYPOGRAPHY HIERARCHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.15;
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.5rem, 5.5vw, var(--text-5xl));
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.02em;
  line-height: 1.08;
}

h2 {
  font-size: clamp(2rem, 4vw, var(--text-4xl));
  font-weight: var(--fw-bold);
  line-height: 1.12;
}

h3 {
  font-size: clamp(1.4rem, 2.5vw, var(--text-2xl));
  font-weight: var(--fw-semibold);
}

h4 {
  font-size: var(--text-xl);
  font-weight: var(--fw-semibold);
}

h5 {
  font-size: var(--text-lg);
  font-weight: var(--fw-medium);
}

h6 {
  font-size: var(--text-md);
  font-weight: var(--fw-medium);
}

/* Serif accent headings — elegant organic feel */
.heading-serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

p.lead {
  font-size: var(--text-md);
  line-height: 1.8;
  color: var(--text-muted);
  font-weight: var(--fw-regular);
}

p.lead-lg {
  font-size: var(--text-lg);
  line-height: 1.8;
  color: var(--text-secondary);
}

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

a:hover {
  color: var(--color-leaf);
}

a:focus-visible {
  outline: 2px solid var(--color-leaf);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

img, picture, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

/* ==========================================================================
   CONTAINER & SECTION SYSTEM
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1.25rem, 4vw, 2.5rem);
  padding-right: clamp(1.25rem, 4vw, 2.5rem);
}

.container-narrow {
  max-width: var(--container-narrow-width);
}

.section {
  padding-top: clamp(4rem, 8vw, var(--section-spacing-desktop));
  padding-bottom: clamp(4rem, 8vw, var(--section-spacing-desktop));
  position: relative;
}

/* Alternating cream canvas for visual rhythm */
.section-alt {
  background-color: var(--bg-canvas-alt);
}

/* White surface section */
.section-surface {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

/* Dark forest contrast section */
.section-dark {
  background: var(--gradient-forest);
  color: var(--text-white);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4 {
  color: var(--text-white);
}

.section-dark p {
  color: rgba(255, 255, 255, 0.82);
}

.section-dark .section-tag {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-leaf);
  border-color: rgba(46, 163, 85, 0.35);
}

/* ==========================================================================
   SECTION HEADERS — Centered Title Blocks
   ========================================================================== */

.section-header {
  text-align: center;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 0.4rem 1.1rem;
  border-radius: var(--radius-full);
  background: var(--color-forest-surface);
  color: var(--color-forest);
  border: 1px solid var(--border-medium);
  margin-bottom: 1.2rem;
}

.section-tag.amber {
  background: var(--color-amber-light);
  color: var(--color-amber-dark);
  border-color: var(--border-amber);
}

.section-tag.leaf {
  background: var(--color-leaf-light);
  color: var(--color-leaf-dark);
  border-color: var(--border-leaf);
}

.section-title {
  margin-bottom: 1.2rem;
  position: relative;
}

.section-title .highlight-leaf {
  color: var(--color-leaf);
  position: relative;
  display: inline-block;
}

.section-title .highlight-amber {
  color: var(--color-amber);
  position: relative;
  display: inline-block;
}

.section-title .highlight-serif {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-leaf);
}

.section-description {
  font-size: var(--text-md);
  color: var(--text-muted);
  line-height: 1.8;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-leaf { color: var(--color-leaf) !important; }
.text-amber { color: var(--color-amber) !important; }
.text-forest { color: var(--color-forest) !important; }
.text-white { color: var(--text-white) !important; }
.text-muted { color: var(--text-muted) !important; }

.font-serif { font-family: var(--font-serif); }
.font-display { font-family: var(--font-display); }

.fw-light { font-weight: var(--fw-light); }
.fw-medium { font-weight: var(--fw-medium); }
.fw-semibold { font-weight: var(--fw-semibold); }
.fw-bold { font-weight: var(--fw-bold); }
.fw-extrabold { font-weight: var(--fw-extrabold); }

.uppercase { text-transform: uppercase; letter-spacing: 0.08em; }

/* Display Utilities */
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-inline-flex { display: inline-flex; }
.d-block { display: block; }
.d-none { display: none; }

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.flex-wrap { flex-wrap: wrap; }
.gap-xs { gap: 0.5rem; }
.gap-sm { gap: 0.75rem; }
.gap-md { gap: 1.25rem; }
.gap-lg { gap: 2rem; }
.gap-xl { gap: 3rem; }

/* Spacing */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Overflow */
.overflow-hidden { overflow: hidden; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }

/* ==========================================================================
   SCROLL REVEAL ANIMATION SYSTEM
   ========================================================================== */

/* Elements start invisible and slide up when they enter the viewport */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.85s var(--ease-smooth), transform 0.85s var(--ease-smooth);
  will-change: opacity, transform;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Slide from left */
.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.85s var(--ease-smooth), transform 0.85s var(--ease-smooth);
  will-change: opacity, transform;
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* Slide from right */
.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.85s var(--ease-smooth), transform 0.85s var(--ease-smooth);
  will-change: opacity, transform;
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* Scale up entrance */
.reveal-scale {
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-spring);
  will-change: opacity, transform;
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Staggered delay classes — used for card grids */
.delay-1 { transition-delay: 0.1s !important; }
.delay-2 { transition-delay: 0.2s !important; }
.delay-3 { transition-delay: 0.3s !important; }
.delay-4 { transition-delay: 0.4s !important; }
.delay-5 { transition-delay: 0.5s !important; }
.delay-6 { transition-delay: 0.6s !important; }

/* ==========================================================================
   CUSTOM SCROLLBAR
   ========================================================================== */

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-canvas);
}

::-webkit-scrollbar-thumb {
  background: var(--color-forest-surface);
  border-radius: 5px;
  border: 2px solid var(--bg-canvas);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-forest);
}

/* Firefox scrollbar */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--color-forest-surface) var(--bg-canvas);
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES — Base Typography Adjustments
   ========================================================================== */

@media (max-width: 1024px) {
  .section {
    padding-top: clamp(3rem, 6vw, 5rem);
    padding-bottom: clamp(3rem, 6vw, 5rem);
  }
}

@media (max-width: 768px) {
  body {
    line-height: 1.65;
  }

  h1 {
    font-size: clamp(2rem, 7vw, 2.8rem);
  }

  h2 {
    font-size: clamp(1.6rem, 5.5vw, 2.2rem);
  }

  h3 {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
  }

  .section-description {
    font-size: var(--text-base);
  }

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

@media (max-width: 480px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ==========================================================================
   ACCESSIBILITY: SKIP TO CONTENT
   ========================================================================== */
.skip-link {
  position: absolute;
  top: -80px;
  left: 1rem;
  background: var(--color-forest, #1F3D2B);
  color: #FFFFFF !important;
  padding: 0.75rem 1.5rem;
  z-index: 99999;
  border-radius: var(--radius-sm, 8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: top 0.2s ease-in-out;
  outline: none;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 1rem;
  outline: 3px solid var(--color-amber, #D97706);
  outline-offset: 2px;
}

