/* ==========================================================================
   Upgrid Landing Page — global styles
   Ported from the v4 design prototype. Colors, type, and layout rules match
   the handoff 1:1; loader + GSAP reveal helpers are additive.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #F2F4F7;
  -webkit-font-smoothing: antialiased;
  font-family: 'Schibsted Grotesk', sans-serif;
  color: #101322;
}
h1, h2, h3 { font-family: 'Figtree', sans-serif; text-transform: capitalize; }
a { color: #3F97FF; }
a:hover { color: #2B85F0; }

/* --- Marquees ------------------------------------------------------------ */
@keyframes upgrid-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes upgrid-tabfill { from { width: 0%; } to { width: 100%; } }
.upgrid-marquee-track { display: flex; width: max-content; gap: 20px; animation: upgrid-marquee 48s linear infinite; }
.upgrid-marquee-mask:hover .upgrid-marquee-track { animation-play-state: paused; }

/* --- Layout grids -------------------------------------------------------- */
.cargo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.ref-row { display: grid; grid-template-columns: 250px 1fr; gap: 56px; }
.cmp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); gap: 0; align-items: center; }
.cmp-others { transform: scale(0.92); transform-origin: left center; opacity: 0.9; margin-left: -22px; position: relative; z-index: 1; }
@media (max-width: 720px) { .cmp-grid { grid-template-columns: 1fr; gap: 20px; } .cmp-others { transform: none; margin-left: 0; opacity: 1; } }
@media (max-width: 760px) { .ref-row { grid-template-columns: 1fr; gap: 18px; } }
@media (max-width: 900px) { .cargo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .cargo-grid { grid-template-columns: 1fr; } }

/* --- Who it's for radial vs stacked -------------------------------------- */
.who-radial { display: block; }
.who-stack { display: none; }
.who-h { display: flex; }
.who-h-arrow { display: block; flex-shrink: 0; }
@media (max-width: 860px) {
  .who-radial { display: none !important; }
  .who-map { display: none !important; }
  .who-stack { display: grid !important; }
  .who-h { flex-direction: column !important; align-items: stretch !important; }
  .who-h-arrow, .who-h-stub, .who-h-spine { display: none !important; }
}

button, a { -webkit-tap-highlight-color: transparent; }

/* --- Button / interactive lift ------------------------------------------- */
.lift { transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .24s ease, transform .24s cubic-bezier(.2,.7,.3,1) !important; }
@media (hover: hover) { .lift:hover { transform: translateY(-2px); } }
.lift:active { transform: translateY(0) scale(.97); }

@keyframes upgrid-fade-a { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes upgrid-fade-b { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes upgrid-spin { to { transform: rotate(360deg); } }

/* NumberFlow custom element — inherit type styling from its wrapper. */
number-flow { display: inline-block; }

/* services accordion (mobile) vs tab grid (desktop) */
.svc-accordion { display: none; }
.footer-contacts > a { flex: 1 1 0; justify-content: center; min-width: 0; }
.wa-fab-icon { display: none; }
/* Mobile-only round phone-call button in the nav (hidden on desktop). */
.nav-phone-mobile { display: none; }

/* --- Mobile layout rules (ported verbatim) ------------------------------- */
@media (max-width: 760px) {
  .hero-media { order: 2 !important; }
  .hero-copy { order: 1 !important; }
  .why-benefits { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 26px 8px !important; }
  .why-benefits > div { flex: none !important; }
  .svc-desktop { display: none !important; }
  .svc-accordion { display: flex !important; }
  .dock-media { order: 2 !important; }
  .pricing-grid { grid-template-columns: 1fr !important; }
  .pricing-card { flex-direction: row !important; align-items: center !important; gap: 16px !important; padding: 16px 18px !important; }
  .pricing-card .pricing-icon { margin: 0 !important; flex-shrink: 0; width: 42px !important; height: 42px !important; }
  .pricing-card .pricing-text { gap: 3px !important; }
  .pricing-card h3 { margin: 0 !important; font-size: 17px !important; }
  .pricing-card p { font-size: 13.5px !important; }
  .faq-aside { flex: 0 1 100% !important; }
  .nav-logo { height: 35px !important; }
  .hero-stats { grid-template-columns: repeat(3, 1fr) !important; gap: 10px !important; }
  .hero-stats > div > span:first-child { font-size: 20px !important; }
  .hero-stats > div > span:last-child { font-size: 11px !important; }
  .hero-checks { grid-template-columns: 1fr !important; gap: 10px !important; }
  .hero-checks > span { font-size: 12.5px !important; }
  .hero-checks > span:nth-child(n+3) { display: none !important; }
  .trusted-strip { padding-top: 20px !important; padding-left: 0 !important; padding-right: 0 !important; }
  .trusted-mask img { transform: scale(0.85); }
  .cargo-grid { display: flex !important; grid-template-columns: none !important; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; gap: 14px !important; margin-left: -24px !important; margin-right: -24px !important; padding-left: 24px !important; padding-right: 24px !important; padding-bottom: 6px; scrollbar-width: none; }
  .cargo-grid::-webkit-scrollbar { display: none; }
  .cargo-grid > div { flex: 0 0 80% !important; scroll-snap-align: center; scroll-snap-stop: always; }
  .cred-list { flex-direction: column !important; align-items: stretch !important; }
  .cred-list > span { justify-content: center; box-sizing: border-box; width: 100%; }
  .cmp-grid { display: flex !important; grid-template-columns: none !important; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; gap: 14px !important; margin-left: -24px !important; margin-right: -24px !important; padding-left: 24px !important; padding-right: 24px !important; padding-bottom: 6px; scrollbar-width: none; align-items: stretch !important; }
  .cmp-grid::-webkit-scrollbar { display: none; }
  .cmp-others { transform: none !important; margin-left: 0 !important; opacity: 1 !important; }
  .cmp-card { flex: 0 0 82% !important; scroll-snap-align: center; scroll-snap-stop: always; padding: 24px 22px !important; }
  .cmp-row { padding: 8px 0 !important; }
  .cmp-pt { font-size: 13px !important; }
  .cmp-dots { display: flex !important; }
  .review-card { width: 270px !important; }
  .reviews-mask { margin-left: -24px !important; margin-right: -24px !important; }
  .loc-contacts { flex-wrap: nowrap !important; gap: 10px !important; }
  .loc-contacts > a { flex: 1 1 0 !important; justify-content: center; min-width: 0; padding-left: 10px !important; padding-right: 10px !important; font-size: 13px !important; }
  .map-box { min-height: 352px !important; }
  .wa-fab { padding: 0 !important; width: 56px; height: 56px; border-radius: 999px !important; align-items: center !important; justify-content: center !important; gap: 0 !important; }
  .wa-fab-text { display: none !important; }
  .wa-fab-icon { display: block !important; }
  .final-cta-side { width: 100% !important; align-items: stretch !important; }
  .final-cta-card { padding: 34px 24px !important; }
  .final-cta-actions { flex-direction: column !important; width: 100%; }
  .final-cta-actions > * { width: 100% !important; justify-content: center !important; box-sizing: border-box; }
}
@media (max-width: 820px) {
  .nav-links, .nav-phone { display: none !important; }
  .nav-phone-mobile { display: inline-flex !important; }
  #nav-bar { padding: 0 16px 0 22px !important; }
}
/* Location: map sits left of the text on desktop (set via inline order).
   Once the grid stacks (~<=904px) put the text first for readability. */
@media (max-width: 904px) {
  .loc-text { order: 1 !important; }
  .map-box { order: 2 !important; }
}
@media (max-width: 640px) {
  .pad-104 { padding-top: 60px !important; padding-bottom: 60px !important; }
  .pad-loc { padding-top: 60px !important; padding-bottom: 52px !important; }
  .pad-72 { padding-top: 52px !important; padding-bottom: 52px !important; }
  .pad-why { padding-top: 56px !important; padding-bottom: 52px !important; }
  .hero-imgblock { min-height: 340px !important; }
  .hero-inner { padding-top: 120px !important; }
}

input:focus, textarea:focus, select:focus { border-color: #3F97FF !important; outline-color: #3F97FF; }
input, textarea, select { accent-color: #3F97FF; caret-color: #3F97FF; }

/* --- Form field components (recreate DS Input / Select) ------------------ */
.field { display: flex; flex-direction: column; gap: 7px; }
.field-row { display: flex; gap: 14px; }
.field-row > .field { flex: 1 1 0; min-width: 0; }
@media (max-width: 440px) { .field-row { flex-wrap: wrap; } .field-row > .field { flex: 1 1 100%; } }
.field > label { font-size: 13px; font-weight: 600; color: #101322; }
.field > label .req { color: #D14343; margin-left: 2px; }
.field input, .field select, .field textarea {
  width: 100%; box-sizing: border-box; height: 48px; padding: 0 14px;
  background: #FFFFFF; border: 1px solid #E4E6EA; border-radius: 10px;
  /* 16px minimum keeps iOS Safari from auto-zooming on focus. */
  font-family: 'Schibsted Grotesk', sans-serif; font-size: 16px; color: #101322;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field textarea {
  height: auto; min-height: 116px; padding: 12px 14px; line-height: 1.5; resize: vertical;
}
.field textarea:focus { border-color: #3F97FF !important; box-shadow: 0 0 0 4px rgba(63,151,255,0.14); outline: none; }
.field textarea::placeholder { color: #A6ADBB; }
.field select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%236B7385' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.field input:focus, .field select:focus { border-color: #3F97FF !important; box-shadow: 0 0 0 4px rgba(63,151,255,0.14); outline: none; }
.field input::placeholder { color: #A6ADBB; }

/* --- Loader (progress bar loading screen) -------------------------------- */
#loader {
  position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 28px; background: #000F1D;
  transition: opacity 520ms ease, visibility 520ms ease;
}
#loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
#loader .loader-logo { height: 44px; width: auto; opacity: 0.96; }
#loader .loader-bar { width: min(260px, 60vw); height: 4px; border-radius: 999px; background: rgba(255,255,255,0.14); overflow: hidden; }
#loader .loader-bar > span { display: block; height: 100%; width: 0%; border-radius: 999px; background: #3F97FF; transition: width 200ms ease; }
#loader .loader-pct { font-family: 'Figtree', sans-serif; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: rgba(255,255,255,0.55); }

/* --- Scroll reveal (IntersectionObserver toggles .is-in) ----------------- */
.reveal {
  opacity: 0; transform: translateY(36px); will-change: opacity, transform;
  transition: opacity 0.8s cubic-bezier(0.2,0.7,0.3,1) 0.12s, transform 0.8s cubic-bezier(0.2,0.7,0.3,1) 0.12s;
}
.reveal.is-in { opacity: 1; transform: none; }
/* When JS is unavailable, never keep content hidden. */
.no-js .reveal { opacity: 1 !important; transform: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
