/* ═══════════════════════════════════════════════════════════
   CropWhen — 2026 Premium Theme Layer
   Loads AFTER Tailwind build. Overlays the whole site.
   Pairs with public/js/theme-2026.js
   ═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --cw-forest: #1B4332;
  --cw-pine: #081C15;
  --cw-leaf: #74A57F;
  --cw-sage: #B7C9A8;
  --cw-sand: #F4EDE1;
  --cw-cream: #FBF8F1;
  --cw-soil: #5C4433;
  --cw-sun: #E9B949;
  --cw-sky: #7FB5D5;
  --cw-ink: #16241C;
  --cw-shadow-soft: 0 8px 40px rgba(8, 28, 21, 0.08);
  --cw-shadow-lift: 0 20px 60px rgba(8, 28, 21, 0.14);
}

/* ── Typography unification ── */
body { font-family: "Outfit", "Inter", ui-sans-serif, system-ui, sans-serif; color: var(--cw-ink); }
h1, h2, h3, .font-display {
  font-family: "Fraunces", "Playfair Display", Georgia, serif !important;
  font-weight: 500 !important;
  letter-spacing: -0.01em;
  color: var(--cw-pine);
}
h1 em, h2 em { font-style: italic; color: var(--cw-forest); }

::selection { background: var(--cw-sun); color: var(--cw-pine); }

:focus-visible { outline: 3px solid var(--cw-sun); outline-offset: 3px; }

/* ── Re-skin existing components (Tailwind class overlays) ── */
.hero-gradient {
  background: linear-gradient(175deg, #EAF2E3 0%, var(--cw-cream) 55%, var(--cw-sand) 100%) !important;
}
.gradient-text {
  background-image: linear-gradient(100deg, var(--cw-forest), var(--cw-leaf)) !important;
}
.btn-premium {
  background: var(--cw-forest) !important;
  background-image: none !important;
  box-shadow: 0 6px 20px rgba(27, 67, 50, 0.28) !important;
  font-weight: 600 !important;
  will-change: transform;
}
.btn-premium:hover { background: var(--cw-pine) !important; box-shadow: 0 10px 28px rgba(27, 67, 50, 0.4) !important; }
.badge-glow {
  background: rgba(27, 67, 50, 0.08) !important;
  background-image: none !important;
  color: var(--cw-forest) !important;
  border: 1px solid rgba(27, 67, 50, 0.14);
  box-shadow: none !important;
  font-weight: 500 !important;
}
.card-premium {
  border-radius: 20px !important;
  border-color: rgba(22, 36, 28, 0.08) !important;
  box-shadow: var(--cw-shadow-soft);
  transform-style: preserve-3d;
  will-change: transform;
}
.card-premium:hover { border-color: var(--cw-sage) !important; box-shadow: var(--cw-shadow-lift) !important; }

/* Header: warm glass */
header.sticky {
  background: rgba(251, 248, 241, 0.82) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: rgba(22, 36, 28, 0.08) !important;
  transition: box-shadow 0.3s ease;
}
header.sticky.cw-scrolled { box-shadow: 0 2px 24px rgba(8, 28, 21, 0.08); }

/* ── Reveal system initial states (only when JS is live) ── */
.cw-js [data-cw-reveal] { opacity: 0; transform: translateY(28px); }
.cw-js .cw-word { display: inline-block; transform: translateY(115%); }
.cw-split-line { display: inline-block; overflow: hidden; vertical-align: bottom; }

/* ── Shared page hero (x-page-hero) ── */
.cw-hero {
  background: linear-gradient(170deg, #EAF2E3 0%, var(--cw-cream) 60%, var(--cw-sand) 100%);
  border-bottom: 1px solid rgba(22, 36, 28, 0.06);
}
.cw-hero__inner { position: relative; z-index: 2; padding-top: 3.5rem; padding-bottom: 3rem; }
.cw-hero__kicker {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin: 0 0 1rem; padding: 0.4rem 1rem;
  border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(27, 67, 50, 0.07); border: 1px solid rgba(27, 67, 50, 0.13);
  color: var(--cw-forest);
}
.cw-hero__title {
  margin: 0; max-width: 22ch;
  font-size: clamp(2rem, 4.5vw, 3.1rem) !important;
  line-height: 1.12 !important;
}
.cw-hero__lead { margin: 0.9rem 0 0; max-width: 58ch; font-size: 1.06rem; color: rgba(22, 36, 28, 0.62); }
.cw-hero__inner > :not(h1):not(.cw-hero__kicker):not(.cw-hero__lead) { margin-top: 1rem; }
.cw-hero__blob {
  position: absolute; border-radius: 50%; filter: blur(60px); pointer-events: none;
}
.cw-hero__blob--a { width: 420px; height: 420px; background: var(--cw-sage); opacity: 0.4; top: -180px; right: -80px; }
.cw-hero__blob--b { width: 280px; height: 280px; background: var(--cw-sun); opacity: 0.18; bottom: -140px; left: 12%; }
.cw-hero__leaves {
  position: absolute; right: clamp(1rem, 6vw, 6rem); bottom: -12px;
  width: clamp(90px, 11vw, 150px); color: var(--cw-forest); opacity: 0.35;
  pointer-events: none;
}
@media (max-width: 640px) { .cw-hero__leaves { width: 64px; right: 0.5rem; opacity: 0.22; } }

/* ═══════════ ENTERTAINMENT LAYER ═══════════ */

/* Page transition bird */
.cw-bird {
  position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none;
  width: 92px; height: 58px; will-change: transform;
  filter: drop-shadow(0 8px 16px rgba(8, 28, 21, 0.28));
}
.cw-bird__wing { transform-origin: 28px 20px; animation: cwWingbeat 0.18s ease-in-out infinite alternate; }
.cw-bird__wing--b { animation-delay: 0.09s; }
@keyframes cwWingbeat { from { transform: scaleY(1) } to { transform: scaleY(0.25) } }

/* Ambient floating leaves */
.cw-ambient {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  overflow: hidden;
}
.cw-ambient svg { position: absolute; opacity: 0.35; color: var(--cw-leaf); will-change: transform; }

/* Scroll vine (grows down the left edge) */
.cw-vine {
  position: fixed; top: 0; left: clamp(4px, 1vw, 14px); height: 100vh; width: 34px;
  pointer-events: none; z-index: 2; opacity: 0.85;
}
.cw-vine path { stroke: var(--cw-leaf); }
.cw-vine .cw-vine__leaf { fill: var(--cw-leaf); stroke: none; }
@media (max-width: 900px) { .cw-vine { display: none; } }

/* Critters (butterflies, bee, dragonfly, ladybug) */
.cw-critter {
  position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none;
  will-change: transform;
  filter: drop-shadow(0 4px 8px rgba(8, 28, 21, 0.18));
}
.cw-butterfly { width: 42px; height: 42px; }
.cw-butterfly .cw-wing { transform-origin: 21px 21px; animation: cwFlap 0.22s ease-in-out infinite alternate; }
.cw-butterfly .cw-wing--r { animation-delay: 0.11s; }
@keyframes cwFlap { from { transform: scaleX(1) } to { transform: scaleX(0.35) } }
.cw-bee .cw-bee__wing { transform-origin: 20px 10px; animation: cwBuzz 0.09s linear infinite alternate; }
.cw-bee .cw-bee__wing--b { animation-delay: 0.045s; }
@keyframes cwBuzz { from { transform: scaleY(1) } to { transform: scaleY(0.45) } }
.cw-dragonfly .cw-df__wings { transform-origin: 27px 15px; animation: cwBuzz 0.07s linear infinite alternate; }

/* Leaf burst particles */
.cw-particle {
  position: fixed; z-index: 9998; pointer-events: none;
  width: 14px; height: 14px; will-change: transform, opacity;
}

/* Cursor glow (fine pointers) */
.cw-glow {
  position: fixed; z-index: 5; pointer-events: none;
  width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(116, 165, 127, 0.13), transparent 65%);
  transform: translate(-50%, -50%);
  will-change: left, top;
}
@media (pointer: coarse) { .cw-glow { display: none; } }

/* Shimmer sweep on gradient text */
.cw-js .gradient-text {
  background-size: 200% 100% !important;
  animation: cwShimmer 6s ease-in-out infinite;
}
@keyframes cwShimmer {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}

/* Gentle breathing for emoji icons in headers/cards */
.cw-js .badge-glow, .cw-js header .shadow { transition: transform 0.3s ease; }

/* Table & list row hover life */
tbody tr { transition: background 0.2s ease, transform 0.2s ease; }
tbody tr:hover { background: rgba(116, 165, 127, 0.07); }

/* Links underline grow */
main a:not(.btn-premium):not([class*="card"]) { position: relative; }

/* ── Reduced motion: calm everything ── */
@media (prefers-reduced-motion: reduce) {
  .cw-js [data-cw-reveal], .cw-js .cw-word { opacity: 1 !important; transform: none !important; }
  .cw-ambient, .cw-critter, .cw-glow, .cw-vine { display: none !important; }
  .cw-js .gradient-text { animation: none !important; }
  .cw-bird { display: none !important; }
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
