/* ============================================
   XiDuoFu — Premium Children's Yogurt Beverages
   Design System & Global Styles
   ============================================ */

:root {
  /* — Color Palette — */
  --cream-50: #FFFBF5;
  --cream-100: #FDF6EC;
  --cream-200: #F7EDDC;
  --cream-300: #EEE1C9;
  --cream-400: #E3D2B4;

  --milk-white: #FFFDF9;
  --pure-white: #FFFFFF;

  --ink-900: #1A1A2E;
  --ink-700: #3A3A4F;
  --ink-500: #6B6B80;
  --ink-400: #9A9AB0;
  --ink-300: #C9C9D6;
  --ink-200: #E4E4EC;
  --ink-100: #F0F0F5;

  /* Flavor accent colors */
  --original: #3B7DD8;   /* blue */
  --strawberry: #E25A6E; /* red/pink */
  --mango: #F4B942;      /* yellow/gold */
  --grape: #8B6BC9;      /* purple */

  /* Signature accent */
  --accent: #C9A96E;     /* warm gold — premium dairy feel */
  --accent-dark: #A88B4E;

  /* Typography */
  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'DM Mono', monospace;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 8rem;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(26, 26, 46, 0.04), 0 1px 3px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 4px 8px rgba(26, 26, 46, 0.06), 0 2px 4px rgba(26, 26, 46, 0.04);
  --shadow-lg: 0 10px 30px rgba(26, 26, 46, 0.08), 0 4px 10px rgba(26, 26, 46, 0.05);
  --shadow-xl: 0 20px 50px rgba(26, 26, 46, 0.12), 0 8px 20px rgba(26, 26, 46, 0.06);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-base: 300ms;
  --duration-slow: 600ms;

  /* Layout */
  --max-width: 1280px;
  --nav-height: 80px;
}

/* — Reset & Base — */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-700);
  background-color: var(--cream-50);
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* — Typography Scale — */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink-900);
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); font-weight: 400; }
h2 { font-size: clamp(2rem, 3.5vw, 3rem); font-weight: 400; }
h3 { font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 500; }
h4 { font-size: 1.25rem; font-weight: 500; }
h5 { font-size: 1rem; font-weight: 600; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.subtitle {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--ink-500);
  font-weight: 300;
}

/* — Layout Utilities — */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-3xl) 0;
  position: relative;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.section-label::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background-color: var(--accent);
}

/* — Buttons — */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  transition: all var(--duration-base) var(--ease-out);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--ink-900);
  color: var(--pure-white);
}

.btn-primary:hover {
  background-color: var(--ink-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: transparent;
  color: var(--ink-900);
  border: 1px solid var(--ink-300);
}

.btn-secondary:hover {
  border-color: var(--ink-900);
  background-color: var(--ink-900);
  color: var(--pure-white);
}

.btn-ghost {
  background-color: transparent;
  color: var(--ink-700);
}

.btn-ghost:hover {
  color: var(--ink-900);
}

.btn-text {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-900);
  transition: gap var(--duration-base) var(--ease-out);
}

.btn-text::after {
  content: '→';
  transition: transform var(--duration-base) var(--ease-out);
}

.btn-text:hover::after {
  transform: translateX(4px);
}

/* — Scroll Reveal — */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* — Product Card Flavors — */
.flavor-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.flavor-original { background-color: var(--original); }
.flavor-strawberry { background-color: var(--strawberry); }
.flavor-mango { background-color: var(--mango); }
.flavor-grape { background-color: var(--grape); }

/* — Focus States — */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* — Reduced Motion — */
@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;
  }
}

/* — Responsive — */
@media (max-width: 768px) {
  :root {
    --space-3xl: 4rem;
    --space-2xl: 3rem;
    --space-xl: 2.5rem;
  }

  .container {
    padding: 0 var(--space-md);
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  /* Advantages: stack to single column on mobile */
  .advantages-grid {
    flex-direction: column !important;
  }
  .advantages-grid > * {
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }
}
