/* ==========================================================================
   ROOT & BATTER — ARTISANAL BAKERY & BRAND STORYTELLING STYLESHEET
   Brand Positioning: The Earth-Rich Heirloom ("Classic bakes, naturally sweetened.")
   ========================================================================== */

:root {
  /* Brand Color Palette */
  --oat-cream: #F6F0E6;
  --oat-cream-light: #FAF6F0;
  --oat-cream-deep: #ECE2D2;
  --cacao-crust: #2C1E18;
  --cacao-muted: #59463E;
  --date-caramel: #A8583B;
  --date-caramel-hover: #8E462C;
  --olive-leaf: #5C6B50;
  --olive-leaf-soft: #E5E9E0;
  --honey-glaze: #D99B43;
  --honey-glaze-soft: rgba(217, 155, 67, 0.18);

  /* Typography */
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Base Reset & Smooth Scrolling */
html {
  scroll-behavior: smooth;
  background-color: var(--oat-cream);
  color: var(--cacao-crust);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--oat-cream);
  color: var(--cacao-crust);
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* Subtle Tactile Parchment Grain Overlay */
.parchment-grain {
  background-image: radial-gradient(rgba(44, 30, 24, 0.035) 1px, transparent 0),
                    radial-gradient(rgba(168, 88, 59, 0.025) 1px, transparent 0);
  background-size: 28px 28px;
  background-position: 0 0, 14px 14px;
}

/* Typography Rules from Brand Identity Guide */
.font-editorial {
  font-family: var(--font-serif);
  font-variation-settings: "SOFT" 50, "WONK" 1;
}

.font-editorial-italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}

.font-structural {
  font-family: var(--font-sans);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.font-body {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
}

.font-spec {
  font-family: var(--font-mono);
  font-weight: 400;
}

/* Custom Selection */
::selection {
  background-color: var(--date-caramel);
  color: var(--oat-cream-light);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--oat-cream);
}

::-webkit-scrollbar-thumb {
  background: #C9B9A6;
  border-radius: 5px;
  border: 2px solid var(--oat-cream);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--date-caramel);
}

/* Sticky Header Glass Parchment Effect */
.header-parchment {
  background-color: rgba(246, 240, 230, 0.93);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow 0.3s ease, padding 0.3s ease, border-color 0.3s ease;
}

.header-parchment.scrolled {
  box-shadow: 0 10px 30px -12px rgba(44, 30, 24, 0.12);
  border-bottom-color: rgba(217, 155, 67, 0.45);
}

/* Navigation Link Underline Animation */
.nav-link {
  position: relative;
  transition: color 0.25s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 1.5px;
  background-color: var(--date-caramel);
  transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Primary Accent Button (Spiced Date Caramel #A8583B) */
.btn-caramel {
  background-color: var(--date-caramel);
  color: var(--oat-cream-light);
  transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 4px 14px -3px rgba(168, 88, 59, 0.35);
}

.btn-caramel:hover {
  background-color: var(--date-caramel-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -4px rgba(168, 88, 59, 0.48);
}

.btn-caramel:active {
  transform: translateY(0);
}

/* Secondary Outline Button (Deep Cacao Crust #2C1E18) */
.btn-cacao-outline {
  border: 1.5px solid var(--cacao-crust);
  color: var(--cacao-crust);
  background-color: transparent;
  transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-cacao-outline:hover {
  background-color: var(--cacao-crust);
  color: var(--oat-cream);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(44, 30, 24, 0.22);
}

/* Golden Honey Glaze Hairline Dividers */
.honey-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(217, 155, 67, 0.35) 15%,
    rgba(217, 155, 67, 0.85) 50%,
    rgba(217, 155, 67, 0.35) 85%,
    transparent 100%
  );
}

/* Product Card Styling */
.product-card {
  background-color: var(--oat-cream-light);
  border: 1px solid rgba(44, 30, 24, 0.12);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.35s ease;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 44px -16px rgba(44, 30, 24, 0.16);
  border-color: rgba(217, 155, 67, 0.7);
}

.product-card .product-image-wrap {
  overflow: hidden;
}

.product-card .product-image {
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.product-card:hover .product-image {
  transform: scale(1.045);
}

/* Format Pill Selector inside Product Cards */
.format-pill {
  transition: all 0.2s ease;
  cursor: pointer;
}

.format-pill.active {
  background-color: var(--cacao-crust);
  color: var(--oat-cream-light);
  border-color: var(--cacao-crust);
}

/* Ingredient Chip */
.ingredient-chip {
  background-color: var(--oat-cream);
  border: 1px solid rgba(44, 30, 24, 0.14);
  color: var(--cacao-crust);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ingredient-chip:hover {
  border-color: var(--olive-leaf);
  background-color: rgba(92, 107, 80, 0.08);
}

/* Form Input Focus States */
.form-field {
  background-color: var(--oat-cream-light);
  border: 1.5px solid rgba(44, 30, 24, 0.2);
  color: var(--cacao-crust);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-field:focus {
  outline: none;
  border-color: var(--date-caramel);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(168, 88, 59, 0.12);
}

.form-field::placeholder {
  color: rgba(44, 30, 24, 0.45);
}

/* Rotating Seal Animation (Subtle & Slow) */
@keyframes slowSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.seal-spin-hover {
  animation: slowSpin 28s linear infinite;
}

.seal-spin-hover:hover {
  animation-play-state: paused;
}

/* Scroll Reveal Utility */
.reveal-up {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Hero Thumbnail Switcher Active State */
.hero-thumb.active {
  border-color: var(--date-caramel);
  box-shadow: 0 0 0 2px var(--date-caramel);
  transform: translateY(-2px);
}
