/* =========================================================
   EAGLE1 TRUCKING  |  styles.css
   Mobile-first: the base styles are for phones, the
   @media blocks at the bottom add tablet and desktop layouts.
   Brand colours and fonts are in the :root block below.
   ========================================================= */

:root {
  /* Brand colours (taken from the logo) */
  --navy: #022247;
  --navy-deep: #01142B;
  --red: #D0022A;
  --red-ink: #B00124;        /* red for small text on white */
  --sky: #EAF0F7;            /* light section background */
  --ink: #0F1E33;            /* body text */
  --muted: #475A70;
  --line: #D3DCE6;
  --white: #fff;

  /* Fonts */
  --font-head: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* Spacing */
  --gutter: 1.25rem;
  --pad: 3.5rem;             /* space above/below each section */
  --header-h: 3.75rem;
  --max: 72rem;

  --flag-duration: 42s;      /* seconds for one full flag-bar loop */
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: 1rem; line-height: 1.65; color: var(--ink); background: var(--white); }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; font-style: italic; line-height: 1.05; margin: 0 0 .55em; }
h1 { font-size: clamp(3.2rem, 14vw, 6.5rem); }
h2 { font-size: clamp(2.1rem, 8vw, 3.4rem); max-width: 20ch; }
h3 { font-size: 1.4rem; line-height: 1.15; }
p { margin: 0 0 1rem; max-width: 62ch; }
ul, ol, dl { margin: 0; padding: 0; }
li { list-style: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lead { font-size: 1.15rem; color: var(--muted); }
.pre { white-space: pre-line; }

/* ---------- Buttons ---------- */
.btn { display: inline-block; padding: .85rem 1.4rem; background: var(--red); color: #fff; font-weight: 600; text-decoration: none; text-align: center; border: 2px solid var(--red); border-radius: 4px; transition: background .15s, border-color .15s; }
.btn:hover { background: #E8143B; border-color: #E8143B; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.7); }
.btn-ghost:hover { background: rgba(255,255,255,.14); border-color: #fff; }
.btn-small { padding: .5rem 1.1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.actions .btn { flex: 1 1 10rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand img { height: 2rem; width: auto; }
.nav-toggle { background: none; border: 0; width: 2.75rem; height: 2.75rem; cursor: pointer; color: var(--navy); display: grid; place-items: center; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 1.5rem; height: 3px; background: currentColor; transition: transform .2s, background .2s; }
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -8px; }
.nav-toggle-bars::after { top: 8px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-8px) rotate(-45deg); }
.site-nav { position: absolute; top: var(--header-h); left: 0; right: 0; display: none; flex-direction: column; background: #fff; padding: .5rem var(--gutter) 1.5rem; border-bottom: 1px solid var(--line); }
.site-nav.is-open { display: flex; }
.site-nav a { text-decoration: none; font-weight: 500; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.site-nav a.btn { margin-top: 1rem; color: #fff; border: 2px solid var(--red); }
.site-nav a[aria-current="true"]:not(.btn) { color: var(--red-ink); }

/* ---------- Hero (base) ---------- */
.hero { background: var(--navy-deep); color: #fff; }
.hero-kicker { font-weight: 500; color: #DCE6F2; }
.hero h1 { margin: 0; }

/* ---------- Flag bar (SADC operating countries): pinned to the bottom of the hero ---------- */
.flag-bar {
  position: relative; z-index: 3; flex: 0 0 auto;
  display: flex; align-items: center; gap: 1.25rem;
  height: 3.25rem; padding: 0 var(--gutter);
  background: rgba(1, 20, 43, .72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-top: 2px solid var(--red);
  color: #fff; overflow: hidden;
}
.flag-bar-label {
  flex: 0 0 auto; margin: 0; white-space: nowrap;
  font-size: .72rem; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: #C4D3E3;
}
.flag-marquee { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.flag-track {
  display: flex; width: max-content;
  animation: flag-scroll var(--flag-duration) linear infinite;
}
.flag-group {
  display: flex; align-items: center; gap: 2.5rem;
  margin: 0; padding: 0 2.5rem 0 0; list-style: none;
}
.flag-item { display: flex; align-items: center; gap: .55rem; white-space: nowrap; }
.flag-item img {
  width: 24px; height: 18px; object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .4); border-radius: 2px;
}
.flag-item span { font-size: .85rem; font-weight: 500; }
.flag-static { display: none; }
.flag-bar:hover .flag-track,
.flag-bar:focus-within .flag-track { animation-play-state: paused; }
@keyframes flag-scroll { to { transform: translateX(-50%); } }

/* ---------- Sections: image first, then text ---------- */
.section { padding: var(--pad) 0; }
.section-tint { background: var(--sky); }
.section-dark, .section-navy { background: var(--navy); color: #fff; }
.section-navy { background: var(--navy-deep); }
.section-dark .lead, .section-navy .lead { color: #C4D3E3; }
.banner { margin: calc(var(--pad) * -1) 0 2rem; }
.banner img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* ---------- Image tiles (clients, services) ---------- */
.tiles { display: grid; gap: 2rem 1.25rem; margin-top: 2rem; }
.tiles img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-bottom: 4px solid var(--red); }
.tiles h3 { margin: .8rem 0 .3rem; }
.tiles p { margin: 0; color: var(--muted); font-size: .95rem; }
.section-dark .tiles p { color: #C4D3E3; }
.tiles-4 { grid-template-columns: repeat(2, 1fr); gap: 1.5rem .9rem; }
.tiles-4 h3 { font-size: 1.15rem; }
.tiles-4 p { font-size: .88rem; }

.callout { margin: 2.5rem 0 0; padding: 1.25rem; max-width: none; background: #fff; border-left: 5px solid var(--red); }
.section:not(.section-tint) .callout { background: var(--sky); }

/* ---------- Text blocks ---------- */
.pillars { display: grid; gap: 1.25rem; margin: 2rem 0; }
.pillars li { border-top: 4px solid var(--red); padding-top: .9rem; }
.pillars h3, .needs h3 { margin-bottom: .25em; }
.pillars p, .needs p { margin: 0; color: var(--muted); }
.statements { display: grid; gap: 1.25rem; }
.statement { padding: 1.25rem; background: var(--navy); color: #fff; }
.statement p { margin: 0; color: #DCE6F2; }
.needs { display: grid; gap: 0 2rem; margin-top: 1.5rem; }
.needs li { padding: 1rem 0 1rem 1rem; border-left: 4px solid var(--red); margin-bottom: .75rem; }

/* Flow: Shipper > Eagle1 > Transporter > Destination */
.flow { display: grid; gap: 1.6rem; margin-top: 1.5rem; }
.flow li { position: relative; padding: 1rem; border: 2px solid var(--navy); text-align: center; }
.flow strong { display: block; font-family: var(--font-head); font-style: italic; font-size: 1.5rem; line-height: 1.1; }
.flow span { color: var(--muted); font-size: .9rem; }
.flow li.is-us { background: var(--navy); border-color: var(--navy); color: #fff; }
.flow li.is-us span { color: #C4D3E3; }
.flow li:not(:last-child)::after { content: "\2193"; position: absolute; left: 50%; bottom: -1.6rem; transform: translateX(-50%); color: var(--red); font-size: 1.4rem; font-weight: 700; line-height: 1.6rem; }

/* Process steps (a real sequence, so numbered) */
.steps { counter-reset: step; max-width: 46rem; margin-top: 1.5rem; }
.steps li { counter-increment: step; position: relative; padding: 0 0 2rem 3.6rem; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--red); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 1.4rem; display: grid; place-items: center; }
.steps li::after { content: ""; position: absolute; left: 1.15rem; top: 2.6rem; bottom: .2rem; border-left: 2px dashed var(--line); }
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }
.steps h3 { margin: .3rem 0 .3rem; }
.steps p { margin: 0; color: var(--muted); }
.tagline { margin-top: 2rem; font-family: var(--font-head); font-style: italic; font-size: 1.8rem; font-weight: 700; color: var(--red-ink); }

/* Coverage */
.two-col { display: grid; gap: 2.5rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.chips li { padding: .3rem .85rem; border: 1px solid rgba(255,255,255,.5); border-radius: 99px; }
.checks li { position: relative; padding: .6rem 0 .6rem 2rem; border-bottom: 1px solid rgba(255,255,255,.2); }
.checks li::before { content: ""; position: absolute; left: .2rem; top: .95rem; width: .45rem; height: .8rem; border: solid var(--red); border-width: 0 3px 3px 0; transform: rotate(40deg); filter: brightness(1.5); }
.note { margin: 1rem 0 0; font-size: .9rem; color: #C4D3E3; }

/* Testimonials */
#testimonials { margin-top: 2.5rem; }
.quotes { display: grid; gap: 1.25rem; }
.quotes blockquote { margin: 0; padding: 1.25rem; background: var(--sky); border-left: 5px solid var(--red); }
.quotes p { font-size: 1.1rem; }
.quotes cite { font-style: normal; font-weight: 600; color: var(--muted); }

/* Contact */
.contact-logo { height: 2.2rem; width: auto; margin-bottom: 1.5rem; }
.contact-details dl div { padding: .8rem 0; border-top: 1px solid rgba(255,255,255,.2); }
.contact-details dt { font-size: .85rem; color: #9FB4C9; }
.contact-details dd { margin: 0; overflow-wrap: anywhere; }
.contact-details a { text-decoration-color: var(--red); text-underline-offset: 3px; }

/* Footer */
.site-footer { background: #000B1A; color: #9FB4C9; padding: 1.75rem 0; font-size: .9rem; }
.site-footer p { margin: 0 0 .25rem; max-width: none; }
.footer-tag { color: #fff; font-family: var(--font-head); font-style: italic; font-size: 1.15rem; font-weight: 700; }

/* ---------- Tablet (600px+) ---------- */
@media (min-width: 600px) {
  :root { --gutter: 2rem; --pad: 4.5rem; }
  .banner img { aspect-ratio: 2 / 1; }
  .tiles-3 { grid-template-columns: repeat(2, 1fr); }
  .tiles-4 { grid-template-columns: repeat(2, 1fr); gap: 2rem 1.25rem; }
  .tiles-4 h3 { font-size: 1.4rem; }
  .tiles-4 p { font-size: .95rem; }
  .pillars { grid-template-columns: repeat(3, 1fr); }
  .needs { grid-template-columns: repeat(2, 1fr); }
  .actions .btn { flex: 0 0 auto; }
}

/* ---------- Phones: one full-screen (TikTok-style) hero ---------- */
@media (max-width: 899px) {
  .hero {
    position: relative; display: flex; flex-direction: column;
    height: calc(100svh - var(--header-h));
    min-height: 34rem;
    overflow: hidden;
  }
  .hero-media { position: absolute; inset: 0; display: block; z-index: 0; }
  .hero-img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; object-position: center 50%; }
  /* Darken only the top and bottom; the middle band (the truck) stays clear. */
  .hero::after {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
      linear-gradient(180deg, rgba(1,20,43,.85) 0%, rgba(1,20,43,.5) 18%, rgba(1,20,43,0) 40%),
      linear-gradient(0deg, rgba(1,20,43,.92) 0%, rgba(1,20,43,.55) 16%, rgba(1,20,43,0) 30%);
  }
  .hero-text {
    position: relative; z-index: 2; flex: 1 1 auto;
    display: flex; flex-direction: column; justify-content: flex-start;
    padding: 2rem var(--gutter) calc(1rem + env(safe-area-inset-bottom));
  }
  .hero-kicker { margin: 0 0 .75rem; max-width: 30ch; }
  .hero h1 { font-size: clamp(2.4rem, 10vw, 3.2rem); line-height: 1.05; margin: 0; }
  .hero .actions { flex-direction: column; gap: .75rem; margin-top: auto; }
  .hero .actions .btn {
    flex: 1 1 auto; width: 100%; min-height: 3rem;
    display: flex; align-items: center; justify-content: center;
  }
}

/* Short phones (e.g. iPhone SE): tighten the top so text/buttons stay clear */
@media (max-width: 899px) and (max-height: 700px) {
  .hero-text { padding-top: 1.25rem; }
  .hero h1 { font-size: clamp(2.1rem, 9vw, 2.8rem); }
}

/* Landscape phones: fall back to the desktop split layout */
@media (max-width: 899px) and (max-height: 500px) {
  .hero { height: auto; min-height: calc(100svh - var(--header-h)); }
  .hero-img { object-position: 50% 50%; }
  .hero::after { background: linear-gradient(90deg, rgba(1,20,43,.72) 0%, rgba(1,20,43,.45) 30%, rgba(1,20,43,0) 55%); }
  .hero-text {
    flex: 1 1 auto; justify-content: center; align-items: flex-start;
    width: 40%; max-width: 40%; padding: 0 0 0 var(--gutter);
  }
  .hero-kicker { font-size: 1rem; margin: 0 0 1rem; }
  .hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
  .hero .actions { flex-direction: row; margin-top: 1.25rem; gap: .75rem; }
  .hero .actions .btn { flex: 0 0 auto; width: auto; min-height: 0; }
}

/* ---------- Desktop (900px+) ---------- */
@media (min-width: 900px) {
  :root { --pad: 7rem; --header-h: 4.5rem; --gutter: 2.5rem; --max: 84rem; }
  .brand img { height: 2.4rem; }
  .nav-toggle { display: none; }
  .site-nav { position: static; display: flex; flex-direction: row; align-items: center; gap: 2.4rem; padding: 0; border: 0; background: none; }
  .site-nav a { padding: .4rem 0; border: 0; font-size: 1rem; }
  .site-nav a.btn { margin: 0 0 0 .75rem; padding: .6rem 1.5rem; }

  /* Hero: full-viewport photo, text in the left 40%, flag bar pinned to the bottom */
  .hero { position: relative; display: flex; flex-direction: column; min-height: calc(100svh - var(--header-h)); overflow: hidden; }
  .hero-media { position: absolute; inset: 0; display: block; }
  .hero-img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; object-position: 50% 50%; }
  .hero::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(1,20,43,.72) 0%, rgba(1,20,43,.45) 30%, rgba(1,20,43,0) 55%); }
  .hero-text {
    position: relative; z-index: 2; flex: 1 1 auto;
    display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
    width: 40%; max-width: 40%; margin: 0; padding: 0 0 0 var(--gutter);
  }
  .hero-kicker { font-size: 1.1rem; margin: 0 0 1.75rem; max-width: 32ch; }
  .hero h1 { font-size: clamp(3.3rem, 4.3vw, 4.8rem); margin: 0; }
  .hero .actions { margin-top: 1.75rem; gap: 1rem; flex-direction: row; flex-wrap: wrap; }
  .hero .actions .btn { flex: 0 0 auto; width: auto; min-height: 0; }

  .flag-bar { height: 4rem; }
  .flag-item img { width: 30px; height: 23px; }
  .flag-item span { font-size: .95rem; }

  .banner img { aspect-ratio: 21 / 8; max-height: 34rem; }
  .tiles { gap: 2.5rem 1.75rem; }
  .tiles-3 { grid-template-columns: repeat(3, 1fr); }
  .tiles-4 { grid-template-columns: repeat(4, 1fr); }
  .statements { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .two-col { grid-template-columns: 1.1fr 1fr; gap: 5rem; }
  .flow { grid-template-columns: repeat(4, 1fr); gap: 3rem; }
  .flow li:not(:last-child)::after { content: "\2192"; left: auto; right: -2.4rem; bottom: auto; top: 50%; transform: translateY(-50%); }
  .quotes { grid-template-columns: 1fr 1fr; gap: 1.75rem; }
  .site-footer { padding: 2.25rem 0; }
  .site-footer .wrap { display: flex; justify-content: space-between; align-items: baseline; }
}

/* ---------- Large desktop (1280px+) ---------- */
@media (min-width: 1280px) {
  :root { --max: 92rem; --pad: 8rem; --gutter: 3rem; }
  .site-nav { gap: 3rem; }
  .hero-text { padding: 0 0 0 var(--gutter); }
  .hero h1 { font-size: clamp(3.6rem, 4.2vw, 5rem); }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .flag-bar { height: auto; min-height: 3.25rem; padding-top: .5rem; padding-bottom: .5rem; }
  .flag-marquee { display: none; }
  .flag-static {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
    gap: .5rem 2rem; margin: 0; padding: .25rem 0; list-style: none;
  }
}
