@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Brand palette */
  --ocean: #00688f;
  --ocean-dark: #00506e;
  --sky: #0391b5;
  --leaf: #69c760;
  --sand: #cea176;
  /* Neutrals derived from the brand blue */
  --ink: #04283A;
  --paper: #F4F9FB;
  --paper-muted: #E6F1F5;
  --card: #FFFFFF;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

::selection { background: var(--leaf); color: var(--ink); }

.font-display { font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif; letter-spacing: -0.01em; }
.font-mono { font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace; }

/* ---------- Brand helpers ---------- */
.text-gradient {
  background: linear-gradient(90deg, #2bb3d3 0%, var(--leaf) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.bg-brand-gradient {
  background: linear-gradient(120deg, var(--ocean) 0%, var(--sky) 100%);
}
.btn-primary {
  background: linear-gradient(120deg, var(--ocean) 0%, var(--sky) 100%);
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 104, 143, 0.35);
  filter: brightness(1.06);
}
.btn-accent {
  background: var(--leaf);
  color: var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-accent:hover {
  background: #82d67a;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(105, 199, 96, 0.4);
}
.btn-ghost {
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

/* ---------- Scroll progress + header state ---------- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  z-index: 70;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--ocean), var(--sky), var(--leaf));
  pointer-events: none;
}
#site-header {
  transition: box-shadow 0.25s ease, background-color 0.25s ease;
}
#site-header.is-scrolled {
  background-color: rgba(244, 249, 251, 0.96);
  box-shadow: 0 8px 28px rgba(4, 40, 58, 0.09);
}
.nav-link {
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: linear-gradient(90deg, var(--sky), var(--leaf));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-link:hover::after,
.nav-link.is-active::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--ocean); }

/* ---------- Back to top ---------- */
#back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: flex;
  height: 42px;
  width: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(120deg, var(--ocean), var(--sky));
  box-shadow: 0 10px 24px rgba(0, 104, 143, 0.35);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s cubic-bezier(0.22,1,0.36,1), transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-group.is-visible > * { opacity: 1; transform: translateY(0); }
.reveal-group > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s cubic-bezier(0.22,1,0.36,1), transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
.reveal-group.is-visible > *:nth-child(1) { transition-delay: 0.02s; }
.reveal-group.is-visible > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-group.is-visible > *:nth-child(3) { transition-delay: 0.14s; }
.reveal-group.is-visible > *:nth-child(4) { transition-delay: 0.20s; }
.reveal-group.is-visible > *:nth-child(5) { transition-delay: 0.26s; }
.reveal-group.is-visible > *:nth-child(6) { transition-delay: 0.32s; }

/* ---------- Waybill card (hero) ---------- */
.waybill {
  position: relative;
  overflow: hidden;
  animation: afl-float 7s ease-in-out infinite;
}
.waybill::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--ocean), var(--sky), var(--leaf));
}
@keyframes afl-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.afl-perforation {
  background-image: radial-gradient(circle, #0a3a52 2.4px, transparent 2.6px);
  background-size: 14px 14px;
  background-position: center;
}

.afl-route-line { stroke-dasharray: 6 7; animation: afl-dash 22s linear infinite; }
@keyframes afl-dash { to { stroke-dashoffset: -400; } }

/* ---------- Hero scroll cue ---------- */
.scroll-cue {
  animation: afl-bob 2.2s ease-in-out infinite;
}
@keyframes afl-bob {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* ---------- Cards: hover lift ---------- */
.lift {
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 38px rgba(4, 40, 58, 0.12);
  border-color: rgba(3, 145, 181, 0.45);
}

/* ---------- Service cards (dark section) ---------- */
.service-card {
  position: relative;
  overflow: hidden;
  transition: background-color 0.3s ease;
}
.service-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sky), var(--leaf));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1);
}
.service-card:hover { background-color: #06364d; }
.service-card:hover::after { transform: scaleX(1); }
.service-icon {
  display: inline-flex;
  height: 46px;
  width: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(3, 145, 181, 0.16);
  border: 1px solid rgba(3, 145, 181, 0.35);
  color: #5fd0ea;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}
.service-card:hover .service-icon {
  transform: translateY(-3px) rotate(-4deg);
  background: rgba(105, 199, 96, 0.2);
  border-color: rgba(105, 199, 96, 0.5);
  color: var(--leaf);
}
.service-num {
  position: absolute;
  top: 22px;
  right: 24px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(244, 249, 251, 0.28);
}

/* ---------- Chips ---------- */
.chip {
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.chip:hover {
  background: var(--ocean);
  border-color: var(--ocean);
  color: #fff;
  transform: translateY(-2px);
}

/* ---------- About-us photo carousel (3D coverflow) ---------- */
.carousel-3d-stage {
  position: relative;
  height: clamp(240px, 42vw, 420px);
  perspective: 1400px;
  overflow: hidden;
  background:
    radial-gradient(60% 90% at 50% 110%, rgba(3, 145, 181, 0.35), transparent 70%),
    radial-gradient(40% 60% at 85% 0%, rgba(105, 199, 96, 0.14), transparent 70%),
    var(--ink);
}

.carousel-3d-slide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72%;
  max-width: 460px;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(244, 249, 251, 0.12);
  cursor: pointer;
  will-change: transform, opacity;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
  /* Default (pre-JS) stacking so the stage isn't empty before main.js runs */
  transform: translate(-50%, -50%);
  opacity: 0;
}
.carousel-3d-slide[data-index="0"] { opacity: 1; z-index: 10; }

.carousel-3d-slide picture,
.carousel-3d-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

@media (min-width: 640px) {
  .carousel-3d-slide { width: 50%; }
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  display: flex;
  height: 38px;
  width: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(244, 249, 251, 0.14);
  color: #F4F9FB;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(244, 249, 251, 0.25);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}
.group:hover .carousel-arrow,
.group:focus-within .carousel-arrow {
  opacity: 1;
}
.carousel-arrow:hover {
  background: var(--sky);
  border-color: var(--sky);
}
.carousel-dot {
  height: 7px;
  width: 7px;
  border-radius: 9999px;
  background: rgba(244, 249, 251, 0.3);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, width 0.2s ease;
}
.carousel-dot.is-active {
  background: var(--leaf);
  width: 18px;
  border-radius: 9999px;
}

@media (hover: none) {
  /* Always-visible arrows on touch devices, since there's no hover state */
  .carousel-arrow { opacity: 1; }
}

/* ---------- Parallax hero (video) ---------- */
.parallax-hero {
  position: relative;
  overflow: hidden;
  background: #031d2b; /* shows briefly before the video paints */
}

.parallax-video-wrap {
  position: absolute;
  inset: -12% 0; /* vertical overscan so parallax translation never reveals an edge */
  will-change: transform;
  pointer-events: none;
}

.parallax-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Scrim: light, left-weighted tint so the truck video stays clearly visible while the
   headline on the left remains readable. Lower the alpha values to reveal even more video. */
.parallax-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 70% at 12% 100%, rgba(3, 145, 181, 0.2), transparent 65%),
    radial-gradient(45% 55% at 92% 8%, rgba(105, 199, 96, 0.1), transparent 65%),
    linear-gradient(180deg, rgba(3, 29, 43, 0.4) 0%, rgba(3, 29, 43, 0.1) 38%, rgba(3, 29, 43, 0.14) 75%, rgba(3, 29, 43, 0.5) 100%),
    linear-gradient(90deg, rgba(4, 40, 58, 0.62) 0%, rgba(4, 40, 58, 0.3) 35%, rgba(4, 40, 58, 0) 65%);
  pointer-events: none;
}

/* Keeps hero copy legible over the brighter, clearer video */
.hero-copy h1,
.hero-copy p,
.hero-copy > span {
  text-shadow: 0 2px 18px rgba(3, 29, 43, 0.6), 0 1px 3px rgba(3, 29, 43, 0.35);
}
.hero-copy .text-gradient {
  text-shadow: none;
  filter: drop-shadow(0 2px 10px rgba(3, 29, 43, 0.55));
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .afl-route-line,
  .waybill,
  .scroll-cue { animation: none; }
  .reveal, .reveal-group > * { opacity: 1; transform: none; transition: none; }
  .parallax-video-wrap { transform: none !important; }
  .carousel-3d-slide { transition: opacity 0.3s ease; }
  .lift:hover, .btn-primary:hover, .btn-accent:hover, .btn-ghost:hover, .chip:hover { transform: none; }
}
