/* ============================================================
   site-polish.css — sitewide visual refinement layer
   ────────────────────────────────────────────────────────────
   Loaded LAST on every landing page (after page CSS and
   site-nav.css) so its refinements win the cascade.
   Purely presentational: no layout-structural rules, safe to
   remove at any time.

   Contents
   · Aurora + geometric star-pattern background (fixed layer)
   · Gradient hairlines on the nav shell & footer
   · Card hover physics · CTA sheen · tactile press
   · Hero gradient headline · deck slide entrance (index)
   · Staggered mobile menu · glassy dropdown
   · Selection / focus-visible / scrollbar / progress bar
   · prefers-reduced-motion: everything calms down
   ============================================================ */

/* ── FOUNDATIONS ── */
html { accent-color: #2f7b64; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { text-wrap: balance; }

::selection { background: #1d6652; color: #fffdfa; }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid #c8963e;
  outline-offset: 2px;
}

/* Thin branded scrollbar (index hides <main>'s own — more specific, still wins) */
html { scrollbar-width: thin; scrollbar-color: rgba(29, 102, 82, 0.35) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #2f7b64, #1d6652);
  border-radius: 999px;
  border: 3px solid #fffdfa;
}

/* ── AURORA + GEOMETRIC PATTERN BACKGROUND ──
   One fixed layer behind everything. Replaces index's old grid
   (all properties reset explicitly). position:fixed adds no
   scrollable height, so the one-screen homepage stays locked. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 1;
  filter: none;
  -webkit-mask-image: none;
  mask-image: none;
  background-image:
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='112'%20height='112'%20viewBox='0%200%20112%20112'%3E%3Cg%20fill='none'%20stroke='%231d6652'%20stroke-opacity='0.05'%3E%3Crect%20x='36'%20y='36'%20width='40'%20height='40'/%3E%3Crect%20x='36'%20y='36'%20width='40'%20height='40'%20transform='rotate(45%2056%2056)'/%3E%3Ccircle%20cx='56'%20cy='56'%20r='2.5'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(42% 40% at 85% 10%, rgba(47, 123, 100, 0.15), transparent 70%),
    radial-gradient(38% 40% at 6% 32%, rgba(242, 164, 58, 0.12), transparent 70%),
    radial-gradient(32% 32% at 52% 96%, rgba(125, 185, 255, 0.10), transparent 70%);
  background-size: 112px 112px, 100% 100%, 100% 100%, 100% 100%;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat;
  background-position: center top, 0 0, 0 0, 0 0;
  animation: polish-aurora 26s ease-in-out infinite alternate;
}
@keyframes polish-aurora {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(0, -1.2%, 0) scale(1.03); }
}

/* ── HEADER: gradient hairline + brand micro-interaction ── */
.site-header .nav-shell { position: relative; }
.site-header .nav-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(242, 164, 58, 0.55),
    rgba(215, 229, 191, 0.35) 38%,
    rgba(47, 123, 100, 0.38) 62%,
    rgba(29, 102, 82, 0.55));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
.site-header .brand-mark {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}
.site-header .brand:hover .brand-mark {
  transform: rotate(-4deg) scale(1.06);
  box-shadow: 0 14px 30px rgba(29, 102, 82, 0.16);
}

/* Glassy dropdown with a slide-and-settle feel */
.site-header .nav-dropdown {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 24px 48px rgba(15, 35, 24, 0.16), inset 0 0 0 1px rgba(242, 164, 58, 0.08);
}
.site-header .nav-dropdown a { transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.site-header .nav-dropdown a:hover { transform: translateX(-3px); }

/* ── CTA SHEEN SWEEP (RTL: light passes right → left) ── */
.nav-cta-btn, .mobile-cta, .nav-cta {
  position: relative;
  overflow: hidden;
}
.nav-cta-btn::after, .mobile-cta::after, .nav-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
  transform: translateX(130%);
  transition: transform 0.65s ease;
  pointer-events: none;
}
.nav-cta-btn:hover::after, .mobile-cta:hover::after, .nav-cta:hover::after {
  transform: translateX(-130%);
}

/* Tactile press on real buttons */
:where(.nav-cta-btn, .mobile-cta, .nav-cta, .store-link, button):active { transform: scale(0.98); }

/* ── CARD HOVER PHYSICS ──
   Any card-ish block inside <main> gets a lift + deep soft shadow. */
@media (hover: hover) {
  main :where([class*="-card"]) {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  }
  main :where([class*="-card"]):hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px rgba(29, 102, 82, 0.13);
  }
}
.store-link { transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, border-color 0.3s ease; }
.store-link:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(29, 102, 82, 0.14); }

/* ── HERO HEADLINE: gold→green gradient ink (homepage) ── */
.hero-title span {
  background: linear-gradient(115deg, #c8963e, #f2a43a 45%, #2f7b64);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #c8963e; /* fallback */
}

/* ── DECK SLIDE ENTRANCE (homepage one-screen deck) ── */
body.deck-ready main > section.slide.is-active {
  animation: polish-deck-in 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes polish-deck-in {
  from { opacity: 0; transform: translateY(14px) scale(0.988); }
  to   { opacity: 1; transform: none; }
}

/* ── FOOTER: gradient hairline replaces the flat rule ── */
footer { position: relative; }
footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 4%, rgba(242, 164, 58, 0.55), rgba(29, 102, 82, 0.5), transparent 96%);
  pointer-events: none;
}
footer .footer-shell { border-top: 0; }

/* ── MOBILE MENU: pop + staggered items ── */
.mobile-nav.open .mobile-nav-shell {
  animation: polish-menu-pop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.mobile-nav.open .mobile-nav-shell > a {
  animation: polish-item-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.mobile-nav.open .mobile-nav-shell > a:nth-child(2)  { animation-delay: 0.03s; }
.mobile-nav.open .mobile-nav-shell > a:nth-child(3)  { animation-delay: 0.06s; }
.mobile-nav.open .mobile-nav-shell > a:nth-child(4)  { animation-delay: 0.09s; }
.mobile-nav.open .mobile-nav-shell > a:nth-child(5)  { animation-delay: 0.12s; }
.mobile-nav.open .mobile-nav-shell > a:nth-child(6)  { animation-delay: 0.15s; }
.mobile-nav.open .mobile-nav-shell > a:nth-child(7)  { animation-delay: 0.18s; }
.mobile-nav.open .mobile-nav-shell > a:nth-child(8)  { animation-delay: 0.21s; }
.mobile-nav.open .mobile-nav-shell > a:nth-child(9)  { animation-delay: 0.24s; }
.mobile-nav.open .mobile-nav-shell > a:nth-child(10) { animation-delay: 0.27s; }
.mobile-nav.open .mobile-nav-shell > a:nth-child(11) { animation-delay: 0.3s; }
@keyframes polish-menu-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes polish-item-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ── READING PROGRESS BAR (created by site-polish.js) ── */
.scroll-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  z-index: 300;
  pointer-events: none;
  transform-origin: right center; /* RTL: grows from the right */
  transform: scaleX(0);
  background: linear-gradient(90deg, #2f7b64, #f2a43a);
}

/* ── CALM MODE ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
