/* =========================================================
   Reflection Logistics — Clean Stylesheet
   (header: no-jump + auto-collapse, hero, sections, cards)
   ========================================================= */

/* ---------- Base & resets ---------- */
:root { --header-h: 120px; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: clip; } /* no horizontal scroll */
@supports not (overflow-x: clip) { html, body { overflow-x: hidden; } }

body {
  font-family: Arial, sans-serif;
  margin: 0;
  color: #0f172a;
  background: #f0f2f5;
  padding-top: var(--header-h);      /* space for fixed header */
}
body.home { padding-top: 0; }        /* hero sits under header on home */

a { color: #1e40af; text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

main { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem; }
footer { background: #1e2a38; color: #fff; padding: 1rem; text-align: center; }

/* ---------- Header (fixed, no jump) ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: #1e2a38;   /* default on non-home or after scroll */
}

/* Transparent overlay look at top of home */
body.home .site-header { background: transparent; }

/* Solid/raised after small scroll */
body.scrolled .site-header { background: #1e2a38; box-shadow: 0 8px 20px rgba(0,0,0,.15); }

/* Top nav (inline by default) */
.site-nav {
  display: flex; justify-content: center; align-items: center;
  gap: 2rem; padding: .8rem 0;
}
.site-nav a { color: #fff; font-weight: 700; white-space: nowrap; }
.site-nav a:hover { text-decoration: underline; }

/* ---------- Auto-collapse to dropdown (button shows when body.nav-collapsed) ---------- */
.nav-toggle {
  display: none; position: absolute; right: 1rem; top: .75rem;
  width: 40px; height: 34px; background: transparent; border: 0; cursor: pointer; z-index: 110;
}
.nav-toggle span { display:block; width:22px; height:2px; background:#fff; margin:4px 0; transition:transform .2s, opacity .2s; }

/* Collapsed mode: hide inline, show button */
body.nav-collapsed .nav-toggle { display: grid; place-items: center; }
body.nav-collapsed .site-nav { display: none; }

/* Dropdown panel when open (top-right) */
body.nav-collapsed.nav-open .site-nav {
  display: flex;
  position: fixed;
  right: .75rem;
  top: calc(var(--header-h) - 2px);
  flex-direction: column;
  gap: .5rem;
  width: min(82vw, 260px);
  padding: .75rem;
  background: rgba(15,23,42,.97);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  z-index: 120;
}
body.nav-collapsed.nav-open .site-nav a { color:#fff; padding:.35rem .25rem; }

/* Turn hamburger into X when open */
body.nav-open .nav-toggle span:nth-child(1){ transform: translateY(6px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2){ opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3){ transform: translateY(-6px) rotate(-45deg); }

/* Helpful small-screen tweaks (logo size & tighter gaps) */
@media (max-width: 520px) {
  .site-header img[alt="Reflection Logistics Company Logo"] { height: 64px !important; }
  .site-nav { gap: 1.25rem; }
}
@media (max-width: 400px) {
  .site-header img[alt="Reflection Logistics Company Logo"] { height: 56px !important; }
}

/* ---------- Hero (full-bleed, fullscreen) ---------- */
.hero--fullscreen {
  position: relative; isolation: isolate;
  min-height: 100svh; overflow: hidden;
  /* escape main's max-width to be full-bleed */
  width: 100vw; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw;
}
.hero__bg { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1.02); will-change: transform; }
.hero__overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.55)); }
.hero__content {
  position: relative; z-index: 2; min-height: 100%;
  display: grid; place-items: center; text-align: center; color: #fff;
  padding: clamp(2rem, 6vh, 4rem) 1rem;
}
.hero__content h1 {
  font-size: clamp(1.9rem, 4.6vw, 3.6rem); line-height: 1.08; margin: .75rem 0 1.25rem;
  text-shadow: 0 2px 8px rgba(0,0,0,.35);
}
/* Give headline room under the header */
.home .hero__content { padding-top: clamp(6rem, 16svh, 11rem); }

/* CTA button */
.btn { display: inline-block; padding: .85rem 1.1rem; border-radius: .8rem; font-weight: 600; text-decoration: none; }
.btn--primary { background: #3b82f6; color: #fff; }
.btn--primary:hover { filter: brightness(1.05); }

/* Scroll cue */
.scroll-cue {
  position: absolute; left: 50%; bottom: 1.25rem; transform: translateX(-50%);
  width: 34px; height: 54px; border-radius: 20px; border: 2px solid rgba(255,255,255,.7);
  background: transparent; display: grid; place-items: center; z-index: 2;
}
.scroll-cue span { width: 6px; height: 10px; border-radius: 3px; background: #fff; opacity: .9; animation: cue 1.4s infinite; }
@keyframes cue { 0%{transform:translateY(-6px);opacity:.2;} 50%{transform:translateY(0);opacity:1;} 100%{transform:translateY(6px);opacity:.2;} }

/* ---------- Sections & layout scaffolding ---------- */
.section { padding: clamp(3rem, 8vw, 6rem) 1.25rem; }
.section--alt { background: #f8fafc; }
.section__title { text-align: center; font-size: clamp(1.75rem, 3.5vw, 2.25rem); margin: 0 0 1.25rem; }
.section__lead { text-align: center; color: #475569; margin-bottom: 2rem; }

.container { width: min(1100px, 92%); margin-inline: auto; }

#services, #why, #how-it-works, #integrations, #faq {
  scroll-margin-top: calc(var(--header-h) + 10px); /* anchors land below header */
}

/* ---------- Unified card system ---------- */
.rl-cards { display: grid; gap: 1.25rem; align-items: stretch; justify-content: center; }
.rl-cards.auto { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.rl-card {
  height: 100%;
  display: flex; flex-direction: column;
  background: linear-gradient(to bottom right, #ffffff, #f2f7fc);
  border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 1.25rem 1.25rem 1.15rem;
  box-shadow: 0 12px 28px rgba(2,6,23,.06), 0 2px 6px rgba(2,6,23,.04);
  transition: transform .22s ease, box-shadow .22s ease;
}
.rl-card:hover { transform: translateY(-6px); box-shadow: 0 12px 24px rgba(0,0,0,.10); }
.rl-card h3 { margin: .25rem 0 .35rem; color: #003087; font-size: 1.12rem; }
.rl-card p { margin: 0; color: #334155; }

/* Optional icon (services/why) */
.rl-icon { font-size: 1.9rem; color: #003087; margin-bottom: .45rem; }
/* Number bubble (steps) */
.rl-num {
  position: absolute; top: 10px; right: 12px; width: 28px; height: 28px;
  border-radius: 999px; background: #003087; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .95rem;
}

/* Integrations tiles reusing card shell */
.rl-tile { padding: 1rem; display: grid; place-items: center; height: 100px; }
.rl-tile img { max-height: 36px; max-width: 130px; filter: grayscale(1) contrast(.9) opacity(.85); transition: filter .18s ease; }
.rl-tile:hover img { filter: none; }

/* Home services helpers */
.home-services { padding: clamp(2.5rem, 7vw, 4.5rem) 1.25rem; }
.home-services__more { text-align: center; margin-top: 1rem; }
.home-services .section__title { color: #003087; }

/* Small screens: single-column centered cards */
@media (max-width: 640px) {
  .section { padding-inline: clamp(.75rem, 3.5vw, 1.25rem); }
  .rl-cards.auto { grid-template-columns: minmax(280px, 1fr); }
  .rl-card { max-width: 560px; margin-inline: auto; }
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; will-change: opacity, transform; }
.reveal.is-visible { opacity: 1; transform: none; }

/* stagger children when parent reveals */
.stagger > * { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible .stagger > * { opacity: 1; transform: none; }
.stagger > *:nth-child(1){ transition-delay: 40ms; }
.stagger > *:nth-child(2){ transition-delay: 100ms; }
.stagger > *:nth-child(3){ transition-delay: 160ms; }
.stagger > *:nth-child(4){ transition-delay: 220ms; }
.stagger > *:nth-child(5){ transition-delay: 280ms; }
.stagger > *:nth-child(6){ transition-delay: 340ms; }
.stagger > *:nth-child(7){ transition-delay: 400ms; }
.stagger > *:nth-child(8){ transition-delay: 460ms; }

/* Force inline nav on wide screens; hide hamburger */
@media (min-width: 1024px) {
  body.nav-collapsed .site-nav { display: flex !important; }
  body.nav-collapsed .nav-toggle { display: none !important; }
}

/* Make header solid when collapsed/open */
body.nav-collapsed .site-header { background: #1e2a38; }

/* Position the dropdown exactly below the header (no gap) */
body.nav-collapsed.nav-open .site-nav {
  top: var(--header-h);            /* was calc(var(--header-h) - 2px) */
}

/* Home: remove main’s top padding so the hero sits flush under the header */
body.home main { padding-top: 0; }

/* (Optional) tiny belt-and-suspenders for sub-pixel seams on some GPUs */
body.home .hero__bg,
body.home .hero__overlay { top: -1px; }

/* Put the homepage hero text below the fixed header, always */
body.home .hero__content{
  /* align text to the top of the hero area, centered horizontally */
  display: grid;
  place-content: start center;

  /* offset by the exact header height + a little breathing room */
  padding-top: calc(var(--header-h) + 1rem);
}

/* Integrations: use text labels on very small screens without changing columns */
#integrations .logo-label { display: none; }      /* default: show logos */

@media (max-width: 640px) {
  #integrations .rl-tile img { display: none; }   /* hide logos only here */
  #integrations .logo-label {
    display: block;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    color: #1f2937;
    letter-spacing: .01em;
  }
}
