/* site.css — consolidated custom styles for eBusiness
   Contents merged from:
   - base.html <style> blocks
   - examples.html <style> block
   - static/donut.css
*/

/* Fonts */
@font-face {
  font-family: "Ebiz Serif";
  src: url('/static/fonts/ebizv.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* CSS-only: align hero to body top by compensating nav block height */
.hero-at-top {
  /* Stronger compensation to ensure hero starts at body y=0 behind sticky nav */
  --nav-space: 128px; /* base estimate for nav+spacing on small screens */
  margin-top: calc(-1 * var(--nav-space));
}
@media (min-width: 410px) {
  .hero-at-top { --nav-space: 144px; }
}
@media (min-width: 590px) {
  .hero-at-top { --nav-space: 164px; }
}
@media (min-width: 1024px) {
  .hero-at-top { --nav-space: 176px; }
}

/* Global tweaks */
html { scroll-padding-top: 4em; }

/* Page background gradient & default font stack (kept light to avoid Tailwind conflicts) */
body {
  font-family: "Kantumruy Pro", system-ui, -apple-system, BlinkMacSystemFont, Inter, Roboto, 'Helvetica Neue', 'Arial Nova', 'Nimbus Sans', Arial, sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
  background: linear-gradient(135deg, #f5f7fa 0%, #e0e8ff 50%, #d9e5ff 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

 /* Page wallpaper variant: gradient + vs.webp */
 .wallpaper-blue {
   background-image: linear-gradient(135deg, #f5f7fa 0%, #e0e8ff 50%, #d9e5ff 100%), url('/static/vs.webp');
   background-attachment: fixed, fixed;
   background-size: auto, cover;
   background-position: center, center;
   background-repeat: no-repeat, no-repeat;
   /* Optional blend for subtle tint over the image */
   background-blend-mode: overlay;
 }

 /* 85% white background helper for translucent cards */
 .bg-white-85 { background-color: rgba(255, 255, 255, 0.85); }

.font-serif { font-family: "Ebiz Serif" !important; }
.font-system { font-family: system-ui, -apple-system, BlinkMacSystemFont, Inter, Roboto, 'Helvetica Neue', 'Arial Nova', 'Nimbus Sans', Arial, sans-serif !important; }

/* Menu item styles */
.menu-item-container { padding: 10px; transition: all 0.3s ease; }
.menu-item-container:hover img { transform: scale3d(1.1, 1.1, 1.1); transition: transform 0.3s ease; }
.menu-item-container img { transition: transform 0.3s ease; }

/* Native details/summary accordion */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Hide scrollbar for specific elements */
.hide-scrollbar { -ms-overflow-style: none !important; scrollbar-width: none !important; }
.hide-scrollbar::-webkit-scrollbar { display: none !important; }

/* Active nav pill */
.nav-active { transform: scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,0.15); font-weight: 600; }

/* Scroll snap helpers for navigation pills */
.scroll-snap-x { scroll-snap-type: x mandatory; scroll-behavior: smooth; }
.scroll-snap-align-start { scroll-snap-align: start; scroll-snap-stop: always; scroll-margin-left: 1rem; }
.scroll-snap-align-center { scroll-snap-align: center; scroll-snap-stop: always; }

/* Disable snapping for auto-scrolling marquees to avoid fighting rAF updates */
.brand-marquee { scroll-snap-type: none !important; -ms-scroll-snap-type: none !important; scroll-behavior: auto !important; will-change: scroll-position; overflow-y: visible; }
.brand-marquee > * { scroll-snap-align: none !important; }
/* Prevent link wrappers from clipping logos due to line box/overflow */
.brand-marquee a { line-height: 0; overflow: visible; align-self: center; }

/* Brand logo sizing with optional height reduction (no cropping) */
.brand-logo {
  --logo-base: 32px; /* matches Tailwind h-8 */
  --logo-reduce: 0px; /* set via inline style when trimming is desired */
  display: block; /* avoid baseline clipping in inline context */
  width: auto;    /* preserve natural width ratio */
  height: auto; /* let image size naturally */
  max-height: max(12px, calc(var(--logo-base) - var(--logo-reduce))); /* cap, don't crop */
  object-fit: contain; /* ensure no visual cropping within bounds */
}
@media (min-width: 410px) { /* Tailwind sm breakpoint in tailwind.config override */
  .brand-logo {
    --logo-base: 36px; /* matches Tailwind sm:h-9 */
    height: auto;
    max-height: max(12px, calc(var(--logo-base) - var(--logo-reduce)));
  }
}

/* Examples page specific */
.favicon-img { width: 24px; height: 24px; object-fit: contain; }
.example-item { transition: background-color 0.15s ease; }
.example-item:hover { background-color: rgba(243, 244, 246, 1); }
.alphabet-nav { font-family: "Space Mono", ui-monospace, monospace; background: white; border-bottom: 1px solid #e5e7eb; }

/* eBusiness Nutrition Dashboard Styles (donut.css merged) */
.ebiz-nutrition-dashboard { margin: 40px auto; background: #ffffff; border-radius: 16px; padding: 0; box-shadow: 0 4px 20px rgba(0,0,0,0.05); overflow: hidden; }

.ebiz-dashboard-header { position: relative; margin-bottom: 0; overflow: hidden; }

/* Donut Chart and Container Styles */
.ebiz-donut-container { padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ebiz-donut-wrapper { width: 140px; height: 140px; display: flex; align-items: center; justify-content: center; position: relative; margin-bottom: 10px; }
.ebiz-donut-chart { width: 100%; height: 100%; }
.ebiz-donut-ring { fill: none; stroke-width: 3.8; }
.ebiz-donut-segment { fill: none; stroke-width: 3.8; stroke-linecap: round; transition: stroke-dasharray 0.3s ease; }
.ebiz-donut-number { fill: #333; font-size: 10px; font-weight: 700; text-anchor: middle; dominant-baseline: middle; font-family: 'Space Mono', 'Courier New', Courier, monospace; }

/* Score Cards Grid */
.ebiz-score-cards { padding: 0 20px 20px; }
.ebiz-score-card { position: relative; background: #fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.04); display: flex; flex-direction: column; overflow: hidden; }
.ebiz-card-label { font-weight: 600; display: flex; align-items: center; color: #374151; }
.ebiz-card-icon { display: inline-flex; align-items: center; justify-content: center; }
.ebiz-card-value { font-weight: 700; color: #fff; font-family: 'Space Mono', 'Courier New', Courier, monospace; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.ebiz-progress-bar { height: 8px; border-radius: 4px; overflow: hidden; }
.ebiz-card-detail { color: #555; line-height: 1.5; }

/* Report Sections */
.ebiz-report-sections { margin-top: 40px; padding: 0; }

/* Responsive Design */
@media (max-width: 768px) {
  .ebiz-nutrition-dashboard { margin: 20px auto; }
  .ebiz-donut-wrapper { width: 120px; height: 120px; }
  .ebiz-donut-number { font-size: 10px; }
}

/* Index hero styles (moved from index.html) */
.bullet::before { content: "✔"; color: #10b981; margin-right: 8px; }
.step { counter-increment: step; }
.step::before { content: counter(step); }

/* Feather only the video (not its overlay content) */
.hero-mask {
  -webkit-mask-image: none !important;
          mask-image: none !important;
}
.hero-mask > video {
  -webkit-mask-image: radial-gradient(120% 84% at 50% 50%, rgba(255,255,255,1) 10%, rgba(255,255,255,0.82) 32%, rgba(255,255,255,0) 60%) !important;
          mask-image: radial-gradient(120% 84% at 50% 50%, rgba(255,255,255,1) 10%, rgba(255,255,255,0.82) 32%, rgba(255,255,255,0) 60%) !important;
  -webkit-mask-repeat: no-repeat !important;
          mask-repeat: no-repeat !important;
  -webkit-mask-position: 50% 50% !important;
          mask-position: 50% 50% !important;
  -webkit-mask-size: 120% 84% !important;
          mask-size: 120% 84% !important;
}

/* Removed redundant video mask to avoid compounded fade */
@media (min-width: 640px) {
  .hero-mask > video {
    -webkit-mask-image: radial-gradient(115% 82% at 50% 50%, rgba(255,255,255,1) 10%, rgba(255,255,255,0.8) 30%, rgba(255,255,255,0) 58%) !important;
            mask-image: radial-gradient(115% 82% at 50% 50%, rgba(255,255,255,1) 10%, rgba(255,255,255,0.8) 30%, rgba(255,255,255,0) 58%) !important;
    -webkit-mask-position: 50% 50%;
            mask-position: 50% 50%;
    -webkit-mask-size: 115% 82% !important;
            mask-size: 115% 82% !important;
  }
}
@media (min-width: 1024px) {
  .hero-mask > video {
    -webkit-mask-image: radial-gradient(110% 80% at 50% 50%, rgba(255,255,255,1) 9%, rgba(255,255,255,0.78) 28%, rgba(255,255,255,0) 56%) !important;
            mask-image: radial-gradient(110% 80% at 50% 50%, rgba(255,255,255,1) 9%, rgba(255,255,255,0.78) 28%, rgba(255,255,255,0) 56%) !important;
    -webkit-mask-position: 50% 50%;
            mask-position: 50% 50%;
    -webkit-mask-size: 110% 80% !important;
            mask-size: 110% 80% !important;
  }
}

/* Subtle top/bottom overlay to guarantee no visible seams */
.hero-mask::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: none;
}

/* Fallback overlay only for browsers without CSS mask support */
@supports not ((-webkit-mask-image: radial-gradient(100% 100% at 50% 50%, #fff 12%, rgba(255,255,255,0) 36%)) or (mask-image: radial-gradient(100% 100% at 50% 50%, #fff 12%, rgba(255,255,255,0) 36%))) {
  .hero-fallback::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    /* Use body gradient tones so edges blend naturally */
    background: radial-gradient(160% 140% at 50% 45%, rgba(245,247,250,0) 32%, rgba(245,247,250,0.9) 60%, rgba(224,232,255,0.92) 78%, #d9e5ff 100%);
  }
}

/* Utilities for hero */
.hero-video { transform: scale(1.08); transform-origin: center; object-position: 50% 50%; }
.hero-title { color: #8484e2; line-height: 1.2 !important; }
.text-brand { color: #8484e2; }
.text-accent-pink { color: #dd4a96; }
.btn-brand { background-color: #8484e2; }
.btn-brand-gradient { background-image: linear-gradient(90deg, #8484e2 0%, #dd4a96 100%); }
.btn-brand-gradient:hover { filter: brightness(0.96); }
.btn-accent-pink { background-color: #dd4a96; }
.btn-accent-pink:hover { filter: brightness(0.96); }
.input-70 { height: 70px; }

/* Faded edge overlays for horizontal scroll containers */
.fade-left { background: linear-gradient(to right, white 0%, white 40%, rgba(255,255,255,0.6) 70%, transparent 100%); }
.fade-right { background: linear-gradient(to left, white 0%, white 40%, rgba(255,255,255,0.6) 70%, transparent 100%); }

/* Glassy navbar pill container */
.glass-nav {
  background: linear-gradient(to bottom, rgba(255,255,255,0.9) 0%, rgba(248,250,255,0.85) 45%, rgba(240,245,255,0.8) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

/* Subtle dot grid background (emerald) */
.bg-dot-grid-emerald {
  background-image: radial-gradient(rgba(16,185,129,0.35) 1px, transparent 1px);
  background-size: 12px 12px;
}

/* Hoverboard: constant-speed vertical float (alternate for seamless up/down) */
@keyframes ebiz-hoverboard {
  0%   { transform: translate3d(0, 12px, 0); }
  100% { transform: translate3d(0, -16px, 0); }
}

.hoverboard-float {
  display: inline-block;
  animation: ebiz-hoverboard 4.8s linear infinite alternate;
  will-change: transform;
  transform-origin: 50% 60%;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Up-only animation for hero logo: baseline at 0, only moves upward */
@keyframes ebiz-hoverboard-up {
  0%   { transform: translate3d(0, 0px, 0); }
  100% { transform: translate3d(0, -16px, 0); }
}

/* Scope to hero so other uses of hoverboard keep their default oscillation */
.hero-mask .hoverboard-float {
  animation: ebiz-hoverboard-up 4.8s linear infinite alternate;
}

/* Shadow wrapper and animation (ellipse under the logo) */
@keyframes ebiz-shadow {
  0%   { transform: scaleX(1.10); opacity: 0.35; filter: blur(2px); }
  100% { transform: scaleX(0.90); opacity: 0.65; filter: blur(4px); }
}

.hoverboard-wrap { position: relative; display: inline-block; }
.hoverboard-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 4px);
  width: 80%;
  height: 14px;
  border-radius: 9999px;
  background: radial-gradient(
    ellipse at center,
    rgba(24, 52, 148, 0.40) 0%,
    rgba(24, 52, 148, 0.26) 42%,
    rgba(24, 52, 148, 0.00) 75%
  );
  transform: scaleX(1);
  margin-left: auto;
  margin-right: auto;
  filter: blur(2px);
  opacity: 0.32;
  pointer-events: none;
  animation: ebiz-shadow 4.8s linear infinite alternate;
}

/* Reduced-motion fallback intentionally disabled */

/* Homepage-only nav shadow overrides (toggle via JS) */
.no-drop-shadow { box-shadow: none !important; }
.nav-shadow-sm { box-shadow: 0 10px 30px -12px rgba(17, 24, 39, 0.25), 0 4px 12px -6px rgba(17, 24, 39, 0.16) !important; }

/* Ensure smooth transition regardless of Tailwind presence */
#top-nav { transition: box-shadow 300ms ease; }

/* Hero shift: move hero section up by a fixed 40vh using layout (reclaims space) */
.hero-shift-40vh {
  margin-top: -40vh;
  margin-bottom: 0; /* avoid cutting into the next section */
}

/* Optional: slightly reduce shift on very small screens if needed */
@media (max-width: 380px) {
  .hero-shift-40vh {
    margin-top: -36vh;
    margin-bottom: 0;
  }
}

/* Removed clip-path-based trimming; using height reduction instead via .brand-logo */

/* Hero logo: keep in normal flow (no absolute positioning) so layout stays intact.
   The nav already has higher z-index (z-50), so it will appear above the logo. */
