/* JJ Import & Export and Shipping Services
   Logo purple is the dominant colour; crane yellow is the only accent.
   Archivo (expanded) for headings, Jost for everything else. */

:root {
  --brand: #392854;
  --brand-deep: #241835;
  --ink: #1C1428;
  --yellow: #FFC21A;
  --yellow-dark: #E5A800;
  --concrete: #F1EFF4;
  --rule: #D6D0DE;
  --muted: #5A5070;
  --white: #FFFFFF;
  --heading: "Archivo", "Arial Black", sans-serif;
  --text: "Jost", "Century Gothic", "Segoe UI", sans-serif;
  --wrap: min(1180px, 100% - 32px);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
}

img { max-width: 100%; display: block; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.wrap { width: var(--wrap); margin-inline: auto; }

/* ---------- Type ---------- */

h1, h2, h3 {
  font-family: var(--heading);
  font-stretch: 125%;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
h1 { font-weight: 800; }
h2 { font-weight: 800; font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
h3 { font-weight: 700; font-size: 1.25rem; font-stretch: 112%; line-height: 1.2; }

.lead { font-size: 1.2rem; line-height: 1.6; max-width: 60ch; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: 2px solid transparent;
  border-radius: 2px;
  font: 600 1rem/1.2 var(--text);
  text-decoration: none;
  cursor: pointer;
}
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-yellow:hover { background: var(--yellow-dark); }
.btn-brand { background: var(--brand); color: var(--white); }
.btn-brand:hover { background: var(--brand-deep); }

/* ---------- Header ---------- */
/* Dark bar; the logo sits on a white tab that hangs below it like a cargo tag. */

.site-header {
  position: relative;
  z-index: 20;
  background: var(--brand-deep);
  color: var(--white);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 72px;
}
.brand {
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-right: auto;
  margin-bottom: -40px;
  padding: 16px 20px 14px;
  background: var(--white);
  color: var(--ink);
  border-bottom: 6px solid var(--yellow);
  text-decoration: none;
}
.brand img { height: 46px; width: auto; }
.brand-name {
  display: block;
  font: 700 1rem/1.1 var(--heading);
  font-stretch: 112%;
}
.brand-sub {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a {
  font-weight: 500;
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--yellow); }
.nav-toggle {
  display: none;
  font: 600 1rem var(--text);
  color: var(--white);
  background: none;
  border: 2px solid var(--white);
  border-radius: 2px;
  padding: 8px 14px;
  cursor: pointer;
}
.nav-cta { display: none; }

/* ---------- Ribbed container wall (hero + page heads) ---------- */

.ribbed {
  background-color: var(--brand);
  background-image: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0 22px,
    rgba(18, 8, 32, 0.24) 22px 24px,
    rgba(18, 8, 32, 0.1) 24px 46px,
    rgba(255, 255, 255, 0.1) 46px 48px
  );
  color: var(--white);
}

/* ---------- Hero ---------- */

.hero { padding: clamp(96px, 12vw, 152px) 0 clamp(72px, 9vw, 112px); }


.hero h1 { font-size: clamp(2.1rem, 5.8vw, 4.75rem); max-width: 16ch; }
.hero-line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero-line > span { display: block; }

.hero-bar {
  width: 128px;
  height: 10px;
  margin: 36px 0 28px;
  background: var(--yellow);
}
.hero-lead { font-size: 1.2rem; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

/* The one load sequence: headline lines rise, the yellow bar extends,
   then the lead and button settle in. */
@media (prefers-reduced-motion: no-preference) {
  .hero-line > span { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-line:nth-child(2) > span { animation-delay: 0.12s; }
  .hero-line:nth-child(3) > span { animation-delay: 0.24s; }
  .hero-bar { transform-origin: left; animation: extend 0.6s 0.55s cubic-bezier(0.6, 0, 0.2, 1) both; }
  .hero-lead, .hero-actions { animation: settle 0.6s 0.8s ease-out both; }
}
@keyframes rise { from { transform: translateY(105%); } }
@keyframes extend { from { transform: scaleX(0); } }
@keyframes settle { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Sections ---------- */

.section { padding: clamp(72px, 9vw, 120px) 0; }
.section-concrete { background: var(--concrete); }
.section-brand { background: var(--brand-deep); color: var(--white); }

.two-col {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}
.two-col > :last-child > p + p { margin-top: 1em; }

/* About */
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 12px 28px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.facts dt { font-weight: 600; color: var(--brand); }
.facts a { text-decoration-color: var(--yellow-dark); text-underline-offset: 3px; }

/* Services */
.services-head { max-width: 62ch; margin-bottom: 56px; }
.services-head p { margin-top: 18px; }
.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px 64px;
}
.service { border-top: 6px solid var(--brand); padding-top: 24px; }
.service h3 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
.service p { margin: 12px 0 16px; max-width: 52ch; }
.service a {
  font-weight: 600;
  color: var(--brand);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}
.service a:hover { text-decoration-color: var(--yellow-dark); }

/* Process: four stops along one yellow line */
.process h2 { margin-bottom: 56px; max-width: 20ch; }
.route {
  list-style: none;
  counter-reset: stop;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  position: relative;
}
.route::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--yellow);
}
/* The parcel: a small yellow box that rides the line and slips under each stop. */
.route::after {
  content: "";
  position: absolute;
  top: 15px;
  left: 0;
  width: 18px;
  height: 18px;
  border-radius: 2px;
  background: var(--yellow);
  box-shadow: 0 0 0 4px var(--brand-deep);
  opacity: 0;
}
.route li { counter-increment: stop; position: relative; z-index: 1; }
.route li::before {
  content: counter(stop);
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  border: 4px solid var(--yellow);
  border-radius: 50%;
  background: var(--brand-deep);
  font: 800 1.15rem var(--heading);
  position: relative;
}
.route p { margin-top: 10px; color: rgba(255, 255, 255, 0.82); }

/* site.js adds .route-anim (only when motion is allowed) and toggles
   .is-moving as the section scrolls into and out of view. The transitions
   live on the .is-moving state only, so a reset snaps back instantly instead
   of playing the route in reverse. */
.route-anim .route::before { transform: scaleX(0); transform-origin: left; }
.route-anim .route li::before { transform: scale(0); }
.route-anim .route li > * { opacity: 0; transform: translateY(14px); }
.route-anim .route.is-moving::before {
  transform: none;
  transition: transform 1.4s cubic-bezier(0.6, 0, 0.2, 1);
}
.route-anim .route.is-moving li::before {
  transform: none;
  transition: transform 0.5s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.route-anim .route.is-moving li > * {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.route-anim .route.is-moving li:nth-child(2)::before,
.route-anim .route.is-moving li:nth-child(2) > * { transition-delay: 0.35s; }
.route-anim .route.is-moving li:nth-child(3)::before,
.route-anim .route.is-moving li:nth-child(3) > * { transition-delay: 0.7s; }
.route-anim .route.is-moving li:nth-child(4)::before,
.route-anim .route.is-moving li:nth-child(4) > * { transition-delay: 1.05s; }
.route-anim .route.is-moving::after { animation: travel-across 7s 1.6s ease-in-out infinite; }

@keyframes travel-across {
  0% { left: 0; opacity: 0; }
  6%, 92% { opacity: 1; }
  100% { left: calc(100% - 18px); opacity: 0; }
}
@keyframes travel-down {
  0% { top: 0; opacity: 0; }
  6%, 92% { opacity: 1; }
  100% { top: calc(100% - 54px); opacity: 0; }
}

/* Why JJ */
.about-lead { margin: 24px 0 16px; }
.reasons-title { font-size: 1.4rem; margin-bottom: 8px; }
.reasons { list-style: none; }
.reasons li {
  display: grid;
  grid-template-columns: minmax(0, 13rem) 1fr;
  gap: 8px 28px;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
}
.reasons li:last-child { border-bottom: 1px solid var(--rule); }
.reasons p { color: var(--muted); }

/* Facilities */
.facilities-head { max-width: 62ch; margin-bottom: 56px; }
.facilities-head p { margin-top: 18px; }
.facilities-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.facilities-grid img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-bottom: 6px solid var(--yellow);
}
.facilities-grid figcaption { margin-top: 16px; color: rgba(255, 255, 255, 0.82); }
.facilities-grid figcaption strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--heading);
  font-stretch: 112%;
  font-size: 1.2rem;
  line-height: 1.2;
  color: var(--white);
}

/* Quote */
.quote-intro { margin-top: 18px; }
.quote-contact { margin-top: 32px; }
.quote-contact p + p { margin-top: 18px; }
.footnote { font-size: 0.95rem; color: var(--muted); }

.quote-panel {
  background: var(--white);
  border: 2px solid var(--rule);
  border-top: 8px solid var(--yellow);
  padding: clamp(24px, 4vw, 44px);
}

/* ---------- Form ---------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field label span { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  font: 400 1rem/1.4 var(--text);
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--rule);
  border-radius: 2px;
  padding: 12px 14px;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
}
.field [aria-invalid="true"] { border-color: #C0262D; }
.form-hp { position: absolute; left: -9999px; }
.form-error { margin-top: 14px; color: #C0262D; font-weight: 500; }
.form-note { margin-top: 14px; font-size: 0.9rem; color: var(--muted); }
.form-done h3 { font-size: 1.6rem; margin-bottom: 10px; }
.form-done:focus { outline: none; }
.quote-panel .btn { width: 100%; }

/* ---------- Service pages ---------- */

.page-head { padding: clamp(56px, 8vw, 96px) 0 clamp(48px, 7vw, 80px); }
.crumb { font-weight: 500; margin-bottom: 20px; }
.crumb a { text-underline-offset: 4px; }
.page-head h1 { font-size: clamp(2rem, 5vw, 3.8rem); max-width: 18ch; }
.page-head .lead { margin-top: 24px; }

.detail {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: start;
}
.article { max-width: 68ch; }
.article h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 56px 0 18px; }
.article h2:first-child { margin-top: 0; }
.article p + p { margin-top: 1em; }
.article ul, .article ol { margin: 18px 0 0 1.25em; }
.article li { margin-bottom: 10px; padding-left: 4px; }
.article ul li::marker { color: var(--brand); }
.article ol li::marker { font-weight: 700; color: var(--brand); }
.article .address-block {
  margin-top: 18px;
  padding: 20px 24px;
  background: var(--concrete);
  border-left: 6px solid var(--brand);
  font-weight: 500;
}

.glance {
  position: sticky;
  top: 104px;
  background: var(--concrete);
  border-left: 6px solid var(--yellow);
  padding: 28px;
}
.glance h2 { font-size: 1.3rem; margin-bottom: 18px; }
.glance dl { margin-bottom: 24px; }
.glance dd + dt { margin-top: 14px; }
.glance dt { font-weight: 600; color: var(--brand); font-size: 0.95rem; }
.glance .btn { width: 100%; }

.others { border-top: 1px solid var(--rule); padding: clamp(48px, 6vw, 72px) 0; }
.others h2 { font-size: 1.4rem; margin-bottom: 20px; }
.others ul { list-style: none; display: flex; flex-wrap: wrap; gap: 12px 40px; }
.others a { font-weight: 600; color: var(--brand); text-underline-offset: 4px; }

.ship-band { background: var(--yellow); padding: clamp(48px, 6vw, 72px) 0; }
.ship-band .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.ship-band h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
.ship-band p { margin-top: 8px; }
.ship-band .actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Thank-you page ---------- */

.thanks { padding: clamp(96px, 14vw, 180px) 0; }
.thanks h1 { font-size: clamp(2rem, 5vw, 3.6rem); }
.thanks .lead { margin: 20px 0 32px; }

/* ---------- Footer ---------- */

.site-footer { background: var(--brand-deep); color: var(--white); padding-top: 72px; }
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  padding-bottom: 48px;
}
.footer-address {
  font: 800 clamp(1.6rem, 3.6vw, 2.8rem)/1.1 var(--heading);
  font-stretch: 125%;
}
.footer-contact { display: flex; flex-wrap: wrap; gap: 8px 32px; margin-top: 20px; }
.footer-contact a { color: var(--yellow); text-underline-offset: 4px; }
.footer-logo { background: var(--white); padding: 10px; width: 132px; height: auto; flex-shrink: 0; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  padding: 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.footer-links a { color: rgba(255, 255, 255, 0.85); text-underline-offset: 3px; }
.footer-links a:hover { color: var(--yellow); }
.footer-base {
  padding: 18px 0 22px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .header-row > .btn { display: none; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 48px 16px 20px;
    background: var(--brand-deep);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
  .site-nav .nav-cta { display: flex; margin-top: 16px; border: 0; }

  .two-col, .detail { grid-template-columns: 1fr; }
  .glance { position: static; }
  .route { grid-template-columns: 1fr 1fr; row-gap: 48px; }
  .route::before, .route::after { display: none; }
}

@media (max-width: 640px) {
  .brand { margin-bottom: -28px; padding: 12px 14px 10px; }
  .brand img { height: 36px; }
  .brand-sub { display: none; }
  .footer-top { flex-direction: column-reverse; }
  .services-grid, .field-row { grid-template-columns: 1fr; }
  .facilities-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .facilities-grid figure:first-child { grid-column: 1 / -1; }
  .facilities-grid figure:first-child img { aspect-ratio: 4 / 3; }
  .route { grid-template-columns: 1fr; row-gap: 0; }
  .route::before { display: block; top: 0; bottom: 36px; left: 22px; right: auto; width: 4px; height: auto; }
  .route li { padding: 0 0 36px 76px; }
  .route li::before { position: absolute; left: 0; top: 0; margin: 0; }
  .route::after { display: block; left: 15px; }
  .route-anim .route::before { transform: scaleY(0); transform-origin: top; }
  .route-anim .route.is-moving::after { animation-name: travel-down; }
  .reasons li { grid-template-columns: 1fr; }
}
