/* Crystal Logistics — enhancement layer (typography + motion).
 * Loaded AFTER style.css; improves the existing site without rewriting it.
 * Inspired by the motion/typography patterns of logistics templates
 * (staggered reveals, word-by-word headline fill, sticky header slide-in,
 * colour-sweep buttons, footer micro-interactions) — original code, Crystal
 * brand colours only: orange #D73F22, green #006A44, dark #092E26.
 * Everything here is switched off for prefers-reduced-motion.
 */

/* ---------------------------------------------------------------- type */
:root {
  --font-head: 'Manrope', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.77, 0, .18, 1);
  --orange-soft: #ff9d83;
}
body { font-family: var(--font-body); font-size: 16px; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .btn, .navitem > a, .navitem > button, .slide-caption strong, .strip-intro, .about-label {
  font-family: var(--font-head);
}
h1, h2 { font-weight: 800; letter-spacing: -.035em; }
h3 { font-weight: 700; letter-spacing: -.02em; }
p { font-size: 16px; line-height: 1.8; }
.section-head p, .hero-v2 p { font-size: 16px; }
.hero-v2 p { font-size: 17px; max-width: 430px; }
.hero-v2 h1 { letter-spacing: -.04em; }
.eyebrow, .hero-v2 .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .16em; }
.service-card p, .article-card p, .info-box p, .process-card p { font-size: 15px; }

/* top bar + menu */
.topbar { font-size: 12.5px; letter-spacing: .04em; }
.navitem > a, .navitem > button { font-size: 15px; font-weight: 700; letter-spacing: 0; position: relative; }
.navitem > a::after, .navitem > button::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 26px; height: 2px; background: var(--orange);
  transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease-out);
}
.navitem:hover > a::after, .navitem:hover > button::after,
.navitem.active > a::after, .navitem.active > button::after { transform: scaleX(1); transform-origin: left; }
.dropdown a { font-size: 15px; transition: color .25s, padding-left .25s; }
.dropdown a:hover { padding-left: 6px; }

/* buttons: brand colour sweep (orange -> green), arrow lifts */
.btn { font-size: 14px; font-weight: 700; letter-spacing: .01em; }
.btn::after { content: none !important; }
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--green);
  transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease-out);
}
.btn:hover::before { transform: scaleX(1); transform-origin: left; }
.btn.outline::before { background: var(--orange); }
.btn:hover { transform: translateY(-2px); }

/* ------------------------------------------------- sticky header slide-in */
/* until the compact header slides in, the header scrolls away with the top bar */
header:not(.is-stuck) { position: relative; }
.hero-v2 { overflow: hidden; } /* the zooming background photos must not widen the page */
header.is-stuck {
  position: fixed; left: 0; right: 0; top: 0; z-index: 60;
  box-shadow: 0 10px 30px #092e2614; animation: header-in .55s var(--ease-out) both;
}
header.is-stuck .navwrap { min-height: 74px; }
header.is-stuck .navitem > a, header.is-stuck .navitem > button { padding: 25px 0; }
header.is-stuck .navitem > a::after, header.is-stuck .navitem > button::after { bottom: 17px; }
header.is-stuck .logo img { width: 165px; transition: width .3s; }
@keyframes header-in { from { transform: translateY(-100%); } to { transform: none; } }
.header-spacer { display: none; }
.header-spacer.on { display: block; }

/* ------------------------------------------------------------ hero intro */
/* each line of the slide text rises into place, one after another; replayed
   on every slide, and when the window is restored or resized (enhance.js) */
.hero-copy { animation: none !important; }
.hero-copy > * { animation: rise-in 1s var(--ease-out) both; }
.hero-copy > *:nth-child(1) { animation-delay: .15s; }
.hero-copy > *:nth-child(2) { animation-delay: .3s; }
.hero-copy > *:nth-child(3) { animation-delay: .5s; }
.hero-copy > *:nth-child(4) { animation-delay: .68s; }
.hero-copy > *:nth-child(5) { animation-delay: .82s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: none; } }
/* hold the entrance while the loading ring is still covering the page */
body:has(#preloader:not(.done)) .hero-copy > *,
body:has(#preloader:not(.done)) .hero-bottom,
body:has(#preloader:not(.done)) .hero-side-label { animation-play-state: paused; }
.hero-v2 .hero-bg { transition: opacity 1.2s ease, transform 10s linear; }
.hero-v2 .hero-bg.active { transform: scale(1.0); }
.hero-v2 .hero-bg:not(.active) { transform: scale(1.09); }
.hero-side-label { animation: fade-in 1.4s .9s both; }
.hero-bottom { animation: rise-in 1s .95s var(--ease-out) both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------- hero foreground vehicle */
/* a cut-out truck / roller over the moving slideshow background (enhance.js
   adds it and swaps it per slide): drives in from the right, then floats */
.hero-fg {
  position: absolute; z-index: 2; right: clamp(20px, 5vw, 90px); bottom: 118px;
  width: clamp(330px, 34vw, 560px); pointer-events: none;
}
.hero-fg img { width: 100%; height: auto; display: block; filter: drop-shadow(0 26px 30px #000a); }
.hero-fg::after { /* ground shadow */
  content: ""; position: absolute; left: 8%; right: 8%; bottom: -10px; height: 26px; border-radius: 50%;
  background: radial-gradient(ellipse at center, #000c 0%, #0000 70%); z-index: -1;
}
.hero-fg.enter { animation: fg-in 1.4s var(--ease-out) .55s both; }
.hero-fg.enter img { animation: fg-float 5s ease-in-out 2s infinite; }
@keyframes fg-in { from { opacity: 0; transform: translateX(160px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes fg-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.hero-fg.leave { animation: fg-out .45s ease-in both; }
@keyframes fg-out { to { opacity: 0; transform: translateX(-60px); } }
body:has(#preloader:not(.done)) .hero-fg { animation-play-state: paused; }
/* the right of the photo is darkened a touch so the vehicle stands out */
.hero-v2 .hero-shade { background:
  linear-gradient(90deg, #06271df0 0%, #06271dc9 25%, #06271d66 49%, #06271d33 75%, #06271d55 100%),
  linear-gradient(0deg, #05291dd9 0%, transparent 28%) !important; }
@media (max-width: 900px) { .hero-fg { display: none; } }

/* ------------------------------------------------------- scroll reveals */
.js-motion .reveal { transform: translateY(45px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.js-motion .split > .reveal:first-child { transform: translateX(-45px); }
.js-motion .split > .reveal:last-child { transform: translateX(45px); }
.js-motion .map-section > .reveal:last-child { transform: translateX(45px) scale(.97); }
.js-motion .reveal.visible { transform: none; }
main { overflow-x: clip; } /* side-sliding blocks must never widen the page */
@media (max-width: 900px) { /* stacked layouts: everything rises, nothing slides in from the side */
  .js-motion .split > .reveal:first-child, .js-motion .split > .reveal:last-child,
  .js-motion .map-section > .reveal:last-child { transform: translateY(45px); }
}

/* image reveal. (Not clip-path: Chrome fails to repaint lazy-loaded images
   inside a clipped box, leaving them blank.) Only the HIDDEN state is styled,
   so the site's own hover zooms keep working once revealed. */
/* card photos: a brand-green panel slides away upwards, uncovering the photo */
.service-card .image::before, .article-card > a:first-child::after {
  content: ""; position: absolute; inset: 0; z-index: 2; background: var(--green);
  transform: scaleY(0); transform-origin: top; transition: transform 1.15s var(--ease-io) .2s; pointer-events: none;
}
.article-card > a:first-child { position: relative; }
.js-motion .service-card.reveal:not(.visible) .image::before,
.js-motion .article-card.reveal:not(.visible) > a:first-child::after { transform: scaleY(1); transition: none; }
/* large pictures: settle in from a slight zoom */
.js-motion .about-art.reveal > img, .js-motion .project-card.reveal > img { transition: transform 1.6s var(--ease-out), opacity 1.2s ease; }
.js-motion .about-art.reveal:not(.visible) > img, .js-motion .project-card.reveal:not(.visible) > img { transform: scale(1.14); opacity: 0; }
.js-motion .about-art.reveal > img.small-image { transition-delay: .35s; }

/* headline words fill in as they scroll up (enhance.js wraps the words) */
.w { opacity: .18; transition: opacity .45s ease; }
.w.lit { opacity: 1; }

/* ------------------------------------------------------------ card hovers */
.service-card { transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out); }
.service-card::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--orange), var(--green)); transform: scaleX(0);
  transform-origin: left; transition: transform .5s var(--ease-out);
}
.service-card:hover { transform: translateY(-8px); box-shadow: 0 24px 50px #092e261a; }
.service-card:hover::after { transform: scaleX(1); }
.service-card .image::after, .project-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(120deg, transparent 30%, #ffffff40 50%, transparent 70%);
  transform: translateX(-120%);
}
.service-card:hover .image::after, .project-card:hover::before { transform: translateX(120%); transition: transform .9s ease; }
.article-card:hover img { animation: img-flash .7s ease; }
@keyframes img-flash { 0% { filter: blur(0) brightness(1); } 35% { filter: blur(5px) brightness(1.12); } 100% { filter: blur(0) brightness(1); } }
.article-card h3 a { background: linear-gradient(var(--orange), var(--orange)) 0 100% / 0 2px no-repeat; transition: background-size .45s var(--ease-out); }
.article-card:hover h3 a { background-size: 100% 2px; }
.process-card { transition: transform .4s var(--ease-out), box-shadow .4s; }
.process-card:hover { transform: translateY(-6px); box-shadow: 0 20px 45px #092e2614; }
.process-card:hover .process-icon { animation: icon-bob .9s ease; }
@keyframes icon-bob { 0%, 100% { transform: none; } 40% { transform: translateY(-6px) rotate(-6deg); } }
.strip-item svg { transition: transform .45s var(--ease-out); }
.strip-item:hover svg { transform: rotateY(180deg); }
.about-label { animation: float-y 5s ease-in-out infinite; }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* --------------------------------------------------------------- footer */
footer { padding-top: 85px; }
.footer-grid h4 {
  font-size: 22px; font-weight: 800; letter-spacing: -.01em; position: relative; padding-bottom: 16px; margin-bottom: 26px;
}
.footer-grid h4::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 38px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--orange), var(--orange-soft)); transition: width .5s var(--ease-out);
}
.footer-grid > div:hover h4::after { width: 78px; }
.footer-grid p { font-size: 15px; line-height: 1.8; }
.footer-grid > div > a:not(.footer-logo) {
  font-size: 15px; line-height: 2.35; width: fit-content; position: relative; padding-left: 0;
  transition: color .3s, padding-left .35s var(--ease-out);
}
.footer-grid > div > a:not(.footer-logo)::before {
  content: "›"; position: absolute; left: -2px; opacity: 0; color: var(--orange-soft); transition: opacity .3s, left .35s var(--ease-out);
}
.footer-grid > div > a:not(.footer-logo):hover { color: #fff; padding-left: 16px; }
.footer-grid > div > a:not(.footer-logo):hover::before { opacity: 1; left: 0; }
.footer-grid > div > a:not(.footer-logo)::after {
  content: ""; position: absolute; left: 16px; right: 0; bottom: 6px; height: 1px; background: var(--orange-soft);
  transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease-out);
}
.footer-grid > div > a:not(.footer-logo):hover::after { transform: scaleX(1); }
.footer-logo { transition: transform .45s var(--ease-out), box-shadow .45s; }
.footer-logo:hover { transform: translateY(-4px); box-shadow: 0 16px 34px #0006; }
.footer-bottom a { position: relative; transition: color .3s; }
.footer-bottom a:hover { color: var(--orange-soft); }
/* footer columns rise in when the footer comes into view */
.js-motion footer .footer-grid > div { opacity: 0; transform: translateY(35px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.js-motion footer.in-view .footer-grid > div { opacity: 1; transform: none; }
.js-motion footer.in-view .footer-grid > div:nth-child(2) { transition-delay: .12s; }
.js-motion footer.in-view .footer-grid > div:nth-child(3) { transition-delay: .24s; }
.js-motion footer.in-view .footer-grid > div:nth-child(4) { transition-delay: .36s; }

/* ----------------------------------------------------- inner page banner */
/* breadcrumb, title and subtitle rise in one after another, like the hero */
.page-banner .wrap > * { animation: rise-in .95s var(--ease-out) both; }
.page-banner .wrap > *:nth-child(1) { animation-delay: .1s; }
.page-banner .wrap > *:nth-child(2) { animation-delay: .25s; }
.page-banner .wrap > *:nth-child(3) { animation-delay: .45s; }
body:has(#preloader:not(.done)) .page-banner .wrap > * { animation-play-state: paused; }
.breadcrumb a { transition: color .3s; }
.breadcrumb a:hover { color: var(--orange-soft); }

/* blocks the enhancement script marks for reveal on inner pages */
.js-motion .auto-reveal { opacity: 0; transform: translateY(40px); transition: opacity .85s var(--ease-out), transform .85s var(--ease-out); }
.js-motion .auto-reveal.visible { opacity: 1; transform: none; }

/* ------------------------------------------------------ inner page hovers */
.product-card, .info-box, .price-card { position: relative; transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out); }
.product-card:hover, .info-box:hover, .price-card:hover { transform: translateY(-8px); box-shadow: 0 24px 50px #092e261a; }
.product-card::after, .info-box::after, .price-card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; pointer-events: none;
  background: linear-gradient(90deg, var(--orange), var(--green)); transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease-out);
}
.product-card:hover::after, .info-box:hover::after, .price-card:hover::after { transform: scaleX(1); }
.product-art { position: relative; overflow: hidden; }
.product-art img { transition: transform .8s var(--ease-out); }
.product-card:hover .product-art img { transform: scale(1.06); }
.product-art::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(120deg, transparent 30%, #ffffff40 50%, transparent 70%); transform: translateX(-120%);
}
.product-card:hover .product-art::after { transform: translateX(120%); transition: transform .9s ease; }
.price-card.featured { animation: glow 3.5s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 #d73f2200; } 50% { box-shadow: 0 0 0 6px #d73f2214; } }
.gallery-grid img, .detail-image { transition: transform .8s var(--ease-out); }
.gallery-grid > *:hover img, .gallery-grid img:hover { transform: scale(1.05); }
.gallery-grid > * { overflow: hidden; }
.filter { transition: background .3s, color .3s, transform .3s; }
.filter:hover { transform: translateY(-2px); }
.error-number { animation: float-y 4s ease-in-out infinite; display: inline-block; }
.profile-monogram { animation: float-y 6s ease-in-out infinite; }

/* FAQ: the + turns into a ×, answers slide open */
summary { transition: color .3s; }
summary:hover { color: var(--orange); }
details summary:after { content: '+' !important; transition: transform .35s var(--ease-out); }
details[open] summary:after { transform: rotate(45deg); }
details[open] > :not(summary) { animation: answer-in .5s var(--ease-out) both; }
@keyframes answer-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- preloader */
#preloader {
  position: fixed; inset: 0; z-index: 9999; background: #fff; display: grid; place-items: center;
  transition: opacity .5s ease, visibility .5s;
}
#preloader.done { opacity: 0; visibility: hidden; }
#preloader .ring {
  width: 64px; height: 64px; border-radius: 50%; border: 3px solid #f2e2dc;
  border-top-color: var(--orange); border-right-color: var(--green); animation: spin .9s linear infinite;
}
#preloader span { display: block; margin-top: 14px; font: 700 10px/1 var(--font-head); letter-spacing: .35em; color: var(--green); text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- phone widths */
@media (max-width: 650px) {
  p, .hero-v2 p { font-size: 15px; }
  .footer-grid h4 { font-size: 19px; }
  header.is-stuck .navwrap { min-height: 64px; }
}

/* ------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js-motion .reveal, .js-motion .auto-reveal, .js-motion footer .footer-grid > div { opacity: 1 !important; transform: none !important; }
  .service-card .image::before, .article-card > a:first-child::after { display: none !important; }
  .js-motion .reveal > img { opacity: 1 !important; transform: none !important; }
  .w { opacity: 1 !important; }
}

/* designer credit (footer) */
.photo-note a { color: #c9d8cf; border-bottom: 1px solid #ffffff40; transition: color .3s, border-color .3s; }
.photo-note a:hover { color: var(--orange-soft); border-color: var(--orange-soft); }

/* form spam trap: invisible to people */
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.prepared.sent { border-left-color: var(--green); }
.prepared.sent h4 { color: var(--green); }
.prepared.sending h4 { color: var(--muted); }
