/* ==========================================================================
   CARGO FORGE CO — Design tokens & base styles (v3)
   Direction: premium light/dark rhythm, warm gold accent, real photography,
   serif+italic display type, soft rounded shapes. Closer to a trusted
   enterprise logistics brand than an industrial dashboard.
   (placeholder brand name — swap via find/replace, see HANDOFF.md)
   ========================================================================== */

:root {
  /* Dark surfaces (hero, footer, CTA bands) */
  --navy:        #0E1B2E;
  --navy-2:      #142A45;
  --navy-deep:   #081220;

  /* Light surfaces (content sections) */
  --paper:       #FBF9F5;
  --paper-2:     #F3EFE7;
  --white:       #FFFFFF;

  /* Text */
  --text-dark:   #1B2333;   /* body text on light backgrounds */
  --text-mute:   #5C6478;   /* secondary text on light backgrounds */
  --bone:        #F5F2EA;   /* primary text on dark backgrounds */
  --bone-mute:   #AEB8CC;   /* secondary text on dark backgrounds */

  /* Accent */
  --gold:        #E0A53D;
  --gold-deep:   #C98A22;
  --gold-pale:   #F4D697;
  --gold-soft:   rgba(224, 165, 61, 0.14);

  /* Status */
  --green:       #2F9E63;
  --green-soft:  rgba(47, 158, 99, 0.12);
  --amber:       #E0922F;
  --amber-soft:  rgba(224, 146, 47, 0.13);
  --red:         #D1564A;
  --red-soft:    rgba(209, 86, 74, 0.12);

  --line-dark:   rgba(245, 242, 234, 0.12);
  --line-light:  rgba(27, 35, 51, 0.10);

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;

  --container: 1180px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-soft: 0 16px 40px rgba(14, 27, 46, 0.10);
  --shadow-deep: 0 24px 64px rgba(8, 18, 32, 0.35);
}

* { box-sizing: border-box; }

/* Nothing should ever push the page wider than the screen. A single overflowing
   element used to drag the whole layout sideways and clip every section. */
html, body { max-width: 100%; overflow-x: hidden; }
img, svg, video { max-width: 100%; }

/* The [hidden] attribute is only `display: none` in the UA stylesheet, so any
   author rule setting `display` (flex, grid, block…) silently outranks it and
   the element stays on screen. Everything toggled from JS via `el.hidden`
   depends on this. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.01em;
}
em, .accent-italic { font-style: italic; color: var(--gold); font-weight: 600; }

p { margin: 0; }
button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 720px) { .wrap { padding: 0 20px; } }

.on-dark { color: var(--bone); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow.on-dark { color: var(--gold-pale); }
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.section { padding: 96px 0; }
@media (max-width: 720px) { .section { padding: 60px 0; } }
.section-light { background: var(--paper); }
.section-white { background: var(--white); }
.section-dark { background: var(--navy); }

.section-head { max-width: 620px; margin-bottom: 52px; }
.section-head h2 {
  font-size: clamp(28px, 4vw, 42px);
  margin-top: 14px;
}
.section-head p {
  margin-top: 16px;
  color: var(--text-mute);
  font-size: 17px;
}
.section-head.on-dark p { color: var(--bone-mute); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 15px 30px;
  border-radius: var(--radius-pill);
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--gold);
  color: #2A1B04;
  box-shadow: 0 10px 28px rgba(224, 165, 61, 0.35);
}
.btn-primary:hover { background: var(--gold-pale); transform: translateY(-2px); box-shadow: 0 14px 32px rgba(224, 165, 61, 0.45); }

.btn-ghost {
  border-color: rgba(245, 242, 234, 0.35);
  color: var(--bone);
  background: rgba(255,255,255,0.04);
}
.btn-ghost:hover { border-color: var(--gold-pale); color: var(--gold-pale); background: rgba(255,255,255,0.08); }

.btn-ghost-dark {
  border-color: rgba(27, 35, 51, 0.18);
  color: var(--text-dark);
  background: transparent;
}
.btn-ghost-dark:hover { border-color: var(--gold-deep); color: var(--gold-deep); }

.btn-block { width: 100%; }

/* Header / nav ----------------------------------------------------------- */
.topbar {
  background: var(--navy-deep);
}
.topbar .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 38px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--bone-mute);
  letter-spacing: 0.02em;
}
.topbar a:hover { color: var(--gold-pale); }
.topbar-item { display: inline-flex; align-items: center; gap: 7px; }
@media (max-width: 880px) {
  .topbar-item.hide-sm { display: none; }
}

header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 27, 46, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-dark);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--bone);
}
.brand .mark {
  width: 42px;
  height: 42px;
  flex: none;
  background: var(--navy-deep);
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand .mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.brand .word-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--bone-mute);
  font-weight: 400;
  margin-top: 3px;
  text-transform: uppercase;
}

.nav-links { display: flex; align-items: center; gap: 38px; }
.nav-links a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--bone-mute);
  position: relative;
  padding: 6px 0;
}
.nav-links a:hover, .nav-links a.active { color: var(--bone); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}
.nav-cta { display: flex; align-items: center; gap: 14px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--bone);
  width: 36px; height: 36px;
}
@media (max-width: 920px) {
  .nav-links, .nav-cta .btn-ghost { display: none; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--navy-deep);
  z-index: 60;
  padding: 24px;
  flex-direction: column;
}
.mobile-menu.open { display: flex; }
.mobile-menu .close-row { display: flex; justify-content: flex-end; }
.mobile-menu .close-row button { background: none; border: none; color: var(--bone); width: 36px; height: 36px; }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: 27px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-dark);
  color: var(--bone);
}
.mobile-menu .btn { margin-top: 24px; }

/* Footer ------------------------------------------------------------------*/
footer.site-footer {
  background: var(--navy-deep);
  color: var(--bone);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 48px;
  padding: 76px 0 52px;
}
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-mute);
  margin-bottom: 18px;
  font-weight: 500;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.footer-grid a { color: var(--bone-mute); font-size: 14px; }
.footer-grid a:hover { color: var(--gold-pale); }
.footer-about p { color: var(--bone-mute); font-size: 14px; margin-top: 14px; max-width: 320px; }
.footer-bottom {
  border-top: 1px solid var(--line-dark);
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--bone-mute);
  flex-wrap: wrap;
  gap: 10px;
}
.footer-bottom a { color: var(--bone-mute); }
.footer-bottom a:hover { color: var(--gold-pale); }
.footer-legal { display: flex; gap: 20px; }

/* Reveal-on-scroll utility */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* Shared status pill (used on home + track page) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-transit { background: var(--amber-soft); color: var(--amber); }
.status-delivered { background: var(--green-soft); color: var(--green); }
.status-exception { background: var(--red-soft); color: var(--red); }
.status-pending { background: rgba(174,184,204,0.16); color: var(--bone-mute); }

/* ==========================================================================
   PHONE LAYOUT (<= 620px)
   The site previously had no breakpoint below 560px, so the header, topbar and
   forms all exceeded a phone viewport and pushed the page sideways.
   ========================================================================== */
@media (max-width: 620px) {
  /* Topbar: tighten, but the location still fits at this width. */
  .topbar .wrap { height: auto; padding-top: 8px; padding-bottom: 8px; font-size: 11px; }

  /* Header: brand + hamburger only. The CTAs live in the mobile menu. */
  .wrap.nav { height: 66px; gap: 12px; }
  .nav-cta .btn { display: none; }
  .brand { font-size: 18px; gap: 9px; }
  .brand .mark { width: 34px; height: 34px; }
  .brand .word-sub { font-size: 8px; letter-spacing: 0.12em; }

  /* Give tap targets a sane minimum and stop buttons overflowing their row. */
  .btn { padding: 13px 20px; font-size: 14px; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { flex: 1 1 100%; justify-content: center; }

  .section { padding: 48px 0; }
  .section-head p { font-size: 15px; }
}

/* Very narrow phones — drop the HQ label so the topbar can't overflow.
   !important because those topbar divs carry an inline display:flex. */
@media (max-width: 400px) {
  .wrap { padding: 0 16px; }
  .brand span:not(.word-sub):not(.mark) { font-size: 17px; }
  .topbar .wrap > div:last-child { display: none !important; }
}
