/* ==========================================================================
   think.AGRI - site-wide motion and interaction layer
   Loaded on every page (head.ascx). Everything is scoped under html.sm,
   a class added by js/site-motion.js, so without JavaScript the site looks
   exactly as before. Nothing here changes an image's source or hides an image.
   Motion follows the ui-ux-pro-max guidance: transform/opacity only,
   150-300 ms hovers, 300-450 ms reveals, reduced motion only turns off smooth scrolling.
   ========================================================================== */

html.sm { scroll-behavior: smooth; }

/* ---------- reading progress bar ---------- */
.sm-progress {
    position: fixed; top: 0; left: 0; z-index: 10001;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, #fcdb5a, #9fcf5a);
    transform-origin: 0 50%;
    transform: scaleX(var(--sm-p, 0));
    pointer-events: none;
}

/* ---------- header: sticks and comes back when scrolling up ---------- */
html.sm .top-bar.sm-fixed {
    position: fixed; top: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    transition: transform .3s ease-out;
    animation: smDrop .35s ease-out;
}
html.sm .top-bar.sm-fixed:not(.is-expanded) .top-bar__bg {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1;
    background-color: rgba(31, 37, 33, .96) !important;
    background-image: none !important;   /* the template's header image has placeholder text in it */
}
/* the template's header background is a grey "500 x 322 / Powered by HTML.COM" placeholder that
   shows when the phone menu is open; keep the dark colour, drop the placeholder picture */
html.sm .top-bar .top-bar__bg { background-image: none !important; }
html.sm .top-bar.is-expanded .top-bar__bg { background-color: #1f2521 !important; }
html.sm .top-bar.sm-fixed .top-bar__logo img { height: 64px; transition: height .25s ease; }
html.sm .top-bar.sm-fixed .top-bar__navigation a:not(.custom-btn) { color: #fff; }
html.sm .top-bar.sm-fixed.sm-hide { transform: translateY(-110%); }
html.sm .top-bar.sm-fixed.is-expanded { transform: none; }
@keyframes smDrop { from { transform: translateY(-100%); } to { transform: none; } }

/* ---------- reveal on scroll (only for elements the template doesn't animate) ---------- */
html.sm .sm-reveal { opacity: 0; transform: translateY(14px); }
html.sm .sm-reveal.sm-in {
    opacity: 1; transform: none;
    transition: opacity .45s ease-out, transform .45s cubic-bezier(.2, .8, .2, 1);
    transition-delay: var(--sm-d, 0ms);
}

/* ---------- buttons: lift + light sweep + ripple ---------- */
html.sm .custom-btn { overflow: hidden; transition: background-color .25s ease, color .25s ease, border-color .25s ease, transform .2s ease, box-shadow .2s ease; }
html.sm .custom-btn::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
    transform: skewX(-20deg); pointer-events: none;
}
html.sm .custom-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 0, 0, .18); }
html.sm .custom-btn:hover::after { left: 130%; transition: left .6s ease; }
html.sm .custom-btn:active { transform: translateY(0) scale(.98); }
.sm-ripple {
    position: absolute; border-radius: 50%; pointer-events: none;
    background: rgba(255, 255, 255, .5);
    transform: scale(0); animation: smRipple .55s ease-out forwards;
}
@keyframes smRipple { to { transform: scale(2.6); opacity: 0; } }

/* ---------- navigation ---------- */
html.sm .top-bar__navigation li:not(.li-btn) > a { transition: color .2s ease, transform .2s ease; }
html.sm .top-bar__navigation li:not(.li-btn) > a:hover { transform: translateY(-1px); }

/* ---------- home: feature icons bounce, screenshot tiles zoom, logos lift ---------- */
html.sm .feature .__item .__ico img { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
html.sm .feature .__item:hover .__ico img { transform: translateY(-6px) scale(1.08); }
html.sm .feature .__item .__title { transition: color .2s ease; }
html.sm .feature .__item:hover .__title { color: #2f3c20; }

html.sm .product-preview .__item .__image img { transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
html.sm .product-preview .__item:hover .__image img { transform: scale(1.07); }
html.sm .product-preview .__item .__image + .__content { transition: background-color .35s ease; }
html.sm .product-preview .__item:hover .__image + .__content { background-color: rgba(17, 48, 9, .72); }
html.sm .product-preview .__item .__title { transition: transform .35s ease; }
html.sm .product-preview .__item:hover .__title { transform: translateY(-4px); }

html.sm .partners-list .__item img { transition: transform .3s ease, filter .3s ease; }
html.sm .partners-list .__item:hover img { transform: translateY(-4px) scale(1.04); filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .12)); }

html.sm .counter .__item .__ico img { transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
html.sm .counter .__item:hover .__ico img { transform: rotate(-8deg) scale(1.1); }

html.sm .company-contacts .__item .__ico { display: inline-block; transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
html.sm .company-contacts .__item:hover .__ico { transform: translateY(-6px) scale(1.12); }

/* contact form: fields light up on focus */
html.sm form .textfield { transition: border-color .25s ease, box-shadow .25s ease; }
html.sm form .textfield:focus { border-color: #fcdb5a; box-shadow: 0 6px 0 -4px #fcdb5a; }

/* home: "click a module" hint on the big banner, and a highlight that tours the modules */
.sm-hint {
    position: absolute; left: 50%; bottom: 18px; z-index: 3;
    transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: 30px;
    background: rgba(17, 30, 12, .82); color: #fff;
    font-family: Raleway, sans-serif; font-weight: 700; font-size: 14px; white-space: nowrap;
    pointer-events: none;
}
.sm-hint::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #fcdb5a; animation: smDot 1.6s infinite; }
@keyframes smDot { 0% { box-shadow: 0 0 0 0 rgba(252, 219, 90, .7); } 80%, 100% { box-shadow: 0 0 0 10px rgba(252, 219, 90, 0); } }
html.sm polygon.hoverable { transition: stroke .3s ease, fill .3s ease; }
html.sm polygon.hoverable:hover, html.sm polygon.hoverable.sm-lit { stroke: #fcdb5a; fill: rgba(252, 219, 90, .14); }

/* tilt + spotlight cards (desktop pointers only; set up by JS) */
.sm-tilt { transition: transform .25s ease; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); will-change: transform; }
.sm-spot::before {
    content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(252, 219, 90, .16), transparent 60%);
    opacity: 0; transition: opacity .3s ease;
}
.sm-spot:hover::before { opacity: 1; }

/* keyboard focus that is always visible */
html.sm a:focus-visible, html.sm button:focus-visible { outline: 3px solid #fcdb5a; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
    html.sm { scroll-behavior: auto; }
}
