/* ============================================================
   Cargoventra Logistics - public layer
   ------------------------------------------------------------
   All design tokens live in assets/css/tokens.css. This file is the
   public-facing layer only: it must not redeclare :root, because the
   dashboard loads the same tokens through dashboard.css and the two
   used to drift apart.

   Direction: modern freight / tech. Sharp corners, tight type scale,
   monospace for identifiers, denser layout, gold as a fine accent
   rather than a large fill.

   The class API here is load-bearing: ~9,600 lines of PHP markup
   depend on it, so selectors are kept even where the survey could not
   find them in a static scan (current/done are applied dynamically by
   shipments.php and tracking.php, is-stale by fleet.php, bg-navy by
   index.php and reports.php).
   ============================================================ */

/* ---------------- Base ----------------
   scroll-behavior and overflow-x: clip on <html> now live in tokens.css,
   so the dashboards and admin get them too. */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--cv-font-sans);
    font-size: var(--cv-fs-500);
    line-height: var(--cv-lh-base);
    color: var(--cv-ink-soft);
    background: var(--cv-surface);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, .brand-text, .navbar-brand {
    font-family: var(--cv-font-display);
    color: var(--cv-primary);
    line-height: var(--cv-lh-tight);
    letter-spacing: var(--cv-ls-tight);
}

a { transition: color var(--cv-dur-fast) var(--cv-ease); }

/* Identifiers, tracking numbers, codes, quantities. */
.mono, code, kbd, samp, pre {
    font-family: var(--cv-font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: var(--cv-ls-mono);
}

/* ---------------- Top bar ---------------- */
.topbar {
    background: var(--cv-primary-dark);
    color: var(--cv-on-dark-5);
    font-size: var(--cv-fs-200);
    letter-spacing: .02em;
}
/* :not(.btn) is load-bearing. `.topbar a` is (0,1,1) and `.btn-warning`
   is only (0,1,0), so the topbar rule was winning and repainting the
   accent "Get Started" button with pale text: --cv-on-dark-2 on the
   accent measured 1.46:1 at the time, i.e. effectively illegible.
   Excluding buttons lets the button keep its own dark-on-accent
   foreground, which is now 5.50:1. */
.topbar a:not(.btn) { color: var(--cv-on-dark-2); text-decoration: none; }
.topbar a:not(.btn):hover { color: var(--cv-gold); }
/* The sign-out control is an icon with no text, so its box was exactly the
   width of the glyph: 12px. Padded to a 32px square, and given an
   aria-label in the markup since the icon itself is aria-hidden. */
.topbar-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    border-radius: var(--cv-r-sm);
    transition: color var(--cv-dur-fast) var(--cv-ease),
                background-color var(--cv-dur-fast) var(--cv-ease);
}
.topbar-icon-btn:hover, .topbar-icon-btn:focus-visible {
    color: var(--cv-gold);
    background: rgba(255, 255, 255, .08);
}
/* Login and the brand link in the top bar are 19px tall. They only exist
   above lg, where there is a pointer, but the tap-target rule applies
   regardless and a 19px link is still fiddly for a stylus or a
   touchscreen laptop. */
.topbar-left a, .topbar-right a:not(.btn) {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
}

/* ---------------- Navbar ---------------- */
.main-nav {
    background: var(--cv-primary-dark);
    border-bottom: 1px solid rgba(var(--cv-accent-rgb), .28);
    box-shadow: var(--cv-shadow);
    padding: 0;
    backdrop-filter: blur(10px);
}
.main-nav > .container {
    display: flex;
    align-items: center;
    min-height: var(--cv-topbar-h);
}
.main-nav .navbar-brand {
    color: #fff;
    display: flex;
    align-items: center;
    gap: var(--cv-sp-2);
    font-size: var(--cv-fs-700);
    font-weight: 700;
    letter-spacing: var(--cv-ls-tight);
}
.brand-box {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    background: var(--cv-gold);
    color: var(--cv-primary-dark);
    border-radius: var(--cv-r-sm);
    font-size: .95rem;
    font-weight: 700;
    flex: none;
}
/* Brand mark (assets/images/logo-mark.svg). Replaces the old Font Awesome
   truck glyph inside .brand-box. The SVG carries its own orange tile, so this
   only has to reserve the same 34px square and stop the alt text from
   showing while the image loads. */
.brand-logo {
    width: 34px; height: 34px;
    flex: none;
    border-radius: var(--cv-r-sm);
    display: block;
}
.brand-text { color: #fff; }
.brand-text strong { color: var(--cv-gold); font-weight: 700; }
.main-nav .nav-link {
    color: var(--cv-on-dark-3);
    font-weight: 500;
    font-size: var(--cv-fs-400);
    padding: var(--cv-sp-2) var(--cv-sp-3);
    border-radius: var(--cv-r-sm);
    border-bottom: 2px solid transparent;
    transition: color var(--cv-dur-fast) var(--cv-ease),
                border-color var(--cv-dur-fast) var(--cv-ease);
}
.main-nav .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.main-nav .nav-link.active { color: var(--cv-gold); border-bottom-color: var(--cv-gold); }

/* ---------------- Buttons ---------------- */
.btn { border-radius: var(--cv-r-sm); font-weight: 600; letter-spacing: .01em; }
/* Bootstrap's .btn-sm renders 31px tall, a pixel under the 32px target
   that reads as comfortable on a phone and short of it everywhere. The
   padding is nudged rather than the font or the radius, so the visual
   change is 1px and nothing else moves. */
.btn-sm { padding-top: .3125rem; padding-bottom: .3125rem; }
/* Bootstrap's .badge is font-size: .75em, i.e. 10.5px next to 14-15px body
   text. 13px is the smallest size that still reads as a badge. */
.badge { font-size: .8125rem; }

/* Bootstrap's checkbox is 15px square and its switch is 15px tall, both well
   under the 24px WCAG 2.2 minimum target. Both already sit inside a <label>
   so tapping the text works, but the control itself should be finger-sized.
   em-based so it still tracks whatever font-size it inherits - except the
   switch height, which has to be explicit px because it inherits 15px here
   and 1.25em would only reach 19px. The knob stays 8x8, so it stays round. */
.form-check-input { width: 1.25em; height: 1.25em; margin-top: .25em; }
/* ...and the plain checkbox needs an absolute floor, not em: at the 15px form
   font 1.25em is 19px, still short of the WCAG 2.2 24px minimum. */
.form-check:not(.form-switch) .form-check-input { min-width: 24px; min-height: 24px; }
.form-switch .form-check-input {
    width: 2.5em;
    height: 24px;
    margin-top: 0;
    margin-left: -2.75em;
    padding-left: 2.5em;
}
/* `.btn-group-sm > .btn` outranks a plain .btn-sm, so it needs the nudge too. */
.btn-group-sm > .btn { padding-top: .3125rem; padding-bottom: .3125rem; }
/* ...and the same for an .input-group-sm, which sizes its field and button
   from the child padding. */
.input-group-sm > .form-control, .input-group-sm > .btn,
.input-group-sm > .input-group-text {
    padding-top: .3125rem;
    padding-bottom: .3125rem;
}
.form-control-sm { padding-top: .375rem; padding-bottom: .375rem; }

/* Gold is an accent, not a primary action: reserved for secondary CTAs. */
.btn-warning {
    --bs-btn-bg: var(--cv-gold);
    --bs-btn-border-color: var(--cv-gold);
    --bs-btn-hover-bg: var(--cv-gold-dark);
    --bs-btn-hover-border-color: var(--cv-gold-dark);
    --bs-btn-active-bg: var(--cv-gold-dark);
    --bs-btn-active-border-color: var(--cv-gold-dark);
    --bs-btn-disabled-bg: var(--cv-gold);
    --bs-btn-disabled-border-color: var(--cv-gold);
    color: var(--cv-primary-dark);
}
.btn-warning:hover, .btn-warning:focus, .btn-warning:active { color: var(--cv-primary-dark); }
.btn-warning.btn-outline-warning { color: var(--cv-gold-ink); }
.btn-warning.btn-outline-warning:hover { color: var(--cv-primary-dark); }

.btn-navy {
    --bs-btn-bg: var(--cv-primary);
    --bs-btn-border-color: var(--cv-primary);
    --bs-btn-hover-bg: var(--cv-primary-light);
    --bs-btn-hover-border-color: var(--cv-primary-light);
    --bs-btn-active-bg: var(--cv-primary-light);
    --bs-btn-active-border-color: var(--cv-primary-light);
    color: #fff;
}
.btn-navy:hover, .btn-navy:focus, .btn-navy:active { color: #fff; }
.btn-navy.btn-outline-navy, .btn-outline-navy {
    --bs-btn-color: var(--cv-primary);
    --bs-btn-border-color: var(--cv-line-strong);
    --bs-btn-hover-bg: var(--cv-primary);
    --bs-btn-hover-border-color: var(--cv-primary);
    --bs-btn-active-bg: var(--cv-primary);
    color: var(--cv-primary);
}
.btn-outline-navy:hover, .btn-outline-navy:focus { color: #fff; }
.btn-outline-warning { border-color: var(--cv-gold); }

/* ---------------- Hero ---------------- */
.hero {
    background: var(--cv-primary-dark);
    color: #fff;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
/* Grid texture instead of the old dot grid: reads as instrumented surface. */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 64px 64px;
    pointer-events: none;
    z-index: 0;
    mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
/* Full-bleed hero clip. Live again: this selector had no markup behind it for
   as long as the hero drew an SVG instead, and it is what the homepage video
   wears today (index.php tags the element class="hero-video home-hero-video").
   The rest of this .hero block is still dead and is left alone rather than
   deleted, because .hero-video is the name
   tests/accessibility_test.php requires in the reduced-motion rule further down
   and keeping it in one obvious place is worth more than the dead bytes.

   Every declaration here is load-bearing for "no layout impact": absolute
   removes the element from flow, inset:0 with an explicit width and height
   makes the replaced element's intrinsic 16:9 ratio irrelevant to layout, and
   object-fit:cover does the cropping inside that box instead of the box
   cropping the clip. Without the width/height pair a video's intrinsic ratio
   wins and the hero's min-height stops meaning anything. */
.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(90deg, rgba(var(--cv-primary-dark-rgb), .94) 0%, rgba(var(--cv-primary-dark-rgb), .78) 42%, rgba(var(--cv-primary-dark-rgb), .42) 100%),
        linear-gradient(180deg, rgba(var(--cv-primary-dark-rgb), .55) 0%, transparent 40%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 {
    font-size: var(--cv-fs-hero);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
    max-width: 18ch;
}
.hero .lead { color: var(--cv-on-dark-4); font-size: var(--cv-fs-600); max-width: 52ch; }
.hero .feature-chip {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(var(--cv-accent-rgb), .35);
    border-radius: var(--cv-r-pill);
    padding: var(--cv-sp-1) var(--cv-sp-3);
    font-size: var(--cv-fs-300);
    display: inline-flex;
    align-items: center;
    gap: var(--cv-sp-2);
}
.hero .feature-chip i { color: var(--cv-gold); font-size: var(--cv-fs-200); }
/* ---------------- Hero stats ---------------- */
/* Each figure is centred on small screens and left-aligned from lg up,
   matching the Bootstrap text utilities the markup used before. The
   earlier version set `text-center text-lg-start` on the row, which is
   inherited - it does not win against the column's own alignment. */
.hero-stats .stat-item {
    text-align: center;
    padding-left: var(--cv-sp-2);
    padding-right: var(--cv-sp-2);
    border-left: 1px solid rgba(255, 255, 255, .12);
}
.hero-stats > div:first-child .stat-item { border-left: 0; padding-left: 0; }

.hero-stats .stat-num {
    font-family: var(--cv-font-mono);
    font-size: var(--cv-fs-1000);
    font-weight: 700;
    color: var(--cv-gold);
    letter-spacing: -.02em;
    line-height: var(--cv-lh-tight);
    font-variant-numeric: tabular-nums;
}
/* The "+" in "99+ countries" rides the figure but is not part of the
   counted number, so it sits in its own span at a lighter weight. */
.hero-stats .stat-plus {
    color: var(--cv-gold-light);
    margin-left: 1px;
}
.hero-stats .stat-label {
    font-size: var(--cv-fs-200);
    /* Was var(--cv-on-dark-6), which is the muted footer tone on a dark band and
       measured ~4.0:1 against the hero. --cv-gold-light is brighter on
       this background and still reads as secondary next to the gold
       number above it. */
    color: var(--cv-on-dark-1);
    text-transform: uppercase;
    letter-spacing: var(--cv-ls-label);
    margin-top: var(--cv-sp-1);
}

/* Hero tracking widget: reads as a console input, not a rounded card. */
.track-widget {
    background: var(--cv-surface);
    color: var(--cv-ink-soft);
    border-radius: var(--cv-r-md);
    border: 1px solid var(--cv-line);
    box-shadow: var(--cv-shadow-lg);
    padding: var(--cv-sp-5);
}
.track-widget .input-group-text {
    background: var(--cv-surface-2);
    border-color: var(--cv-line);
    color: var(--cv-ink-muted);
    font-size: var(--cv-fs-400);
}
.track-widget .form-control {
    font-family: var(--cv-font-mono);
    letter-spacing: .04em;
    text-transform: uppercase;
}
.track-widget .form-control:focus { box-shadow: none; border-color: var(--cv-gold); }
/* The widget sits inside the dark hero but the form controls are light.
   Bootstrap's focus ring is a pale blue that disappears against the
   white field, so the focus state is restated in the brand gold. */
.track-widget .form-control:focus-visible,
.track-widget .btn:focus-visible {
    box-shadow: var(--cv-ring);
    outline: 2px solid var(--cv-gold-dark);
    outline-offset: 1px;
}
/* 320px: the input-group puts an icon, an input and a button on one row,
   which overflows below about 380px. Stacking keeps the tap targets full
   width instead of squeezing the field to a few characters. */
@media (max-width: 380px) {
    .track-widget .input-group { flex-wrap: wrap; }
    .track-widget .input-group-text { flex: 0 0 auto; }
    .track-widget .input-group .form-control { flex: 1 1 100%; order: -1; border-radius: var(--cv-r-sm); }
    .track-widget .input-group .btn { width: 100%; }
}

/* ---------------- Sections ---------------- */
.section-title .eyebrow {
    /* --cv-gold-ink, not --cv-gold-dark: at 11px this is ordinary body
       text, so it has to clear 4.5:1, and gold-dark only managed 3.44:1
       on white. The dark bands override this back to --cv-gold below. */
    color: var(--cv-gold-ink);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--cv-ls-label);
    font-size: var(--cv-fs-100);
    display: inline-flex;
    align-items: center;
    gap: var(--cv-sp-2);
}
/* Short rule before the eyebrow: a fine gold accent instead of a big fill. */
.section-title .eyebrow::before {
    content: '';
    width: 20px; height: 2px;
    background: var(--cv-gold);
    flex: none;
}
.section-title h2 {
    font-size: var(--cv-fs-1100);
    font-weight: 700;
    color: var(--cv-primary);
    margin-top: var(--cv-sp-2);
}
.section-title p { color: var(--cv-ink-muted); max-width: 60ch; }

.bg-light-cv { background: var(--cv-surface-2); }

.section {
    padding: var(--cv-sp-16) 0;
}

/* ---------------- AOS offsets ---------------- */
/* AOS hard-codes a 100px offset for every fade direction and exposes no
   option to change the distance. Two things went wrong with that here:
   the horizontal offset parked not-yet-animated elements outside the
   viewport, so document.scrollWidth exceeded window.innerWidth at
   768/1024/1280/1440 and the page got a horizontal scrollbar; and the
   vertical offset put fade-up cards 100px below their final position, which
   .how-work-band and .testimonials-band then clipped with overflow:hidden.
   Re-declared here at 24px: still clearly directional, but small enough to
   stay inside the layout and inside the bands' padding.
   Same specificity as AOS's own rule and later in the cascade, so it wins.
   assets/js/main.js records the same constraint. */
[data-aos='fade-left'] { transform: translate3d(-24px, 0, 0); }
[data-aos='fade-right'] { transform: translate3d(24px, 0, 0); }
[data-aos='fade-up'] { transform: translate3d(0, 24px, 0); }
[data-aos='fade-down'] { transform: translate3d(0, -24px, 0); }
[data-aos='fade-left'].aos-animate,
[data-aos='fade-right'].aos-animate,
[data-aos='fade-up'].aos-animate,
[data-aos='fade-down'].aos-animate { transform: translate3d(0, 0, 0); }

/* ---------------- Cards ---------------- */
.card {
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-r);
    box-shadow: var(--cv-shadow);
}
.card-header {
    background: var(--cv-surface);
    border-bottom: 1px solid var(--cv-line);
    color: var(--cv-primary);
    font-weight: 600;
}

.icon-box {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: var(--cv-r-sm);
    font-size: var(--cv-fs-600);
    background: rgba(var(--cv-accent-rgb), .12);
    color: var(--cv-gold-dark);
    flex: none;
}
.icon-box.navy { background: rgba(var(--cv-primary-rgb), .08); color: var(--cv-primary); }

.card-hover {
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-r);
    background: var(--cv-surface);
    transition: transform var(--cv-dur) var(--cv-ease),
                box-shadow var(--cv-dur) var(--cv-ease),
                border-color var(--cv-dur) var(--cv-ease);
    height: 100%;
}
.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--cv-shadow-lg);
    border-color: var(--cv-line-strong);
}

/* ---------------- Service cards ---------------- */
/* The card is the link. Anchor styling is reset here because the previous
   markup wrapped a <div> in an <a> and inherited link colours into the
   title and body, which is why the service grid read as loose text on a
   white box rather than as six finished cards. */
.service-card {
    width: 100%;
    padding: var(--cv-sp-6);
    text-decoration: none;
    color: var(--cv-ink-soft);
    /* Equal-height columns. height:100% comes from .card-hover; the
       description is the only flexible part so the CTAs align across a
       row regardless of copy length. No fixed height is used - a long
       translation grows the card instead of clipping. */
}
.service-card:hover,
.service-card:focus-visible {
    color: var(--cv-ink-soft);
    text-decoration: none;
}
.service-card:focus-visible {
    outline: 2px solid var(--cv-gold-dark);
    outline-offset: 3px;
}
.service-card .icon-box {
    /* Fixed box, larger glyph, and a soft tint that deepens on hover so
       the icon reads as the card's anchor point. */
    width: 52px;
    height: 52px;
    font-size: var(--cv-fs-700);
    background: rgba(var(--cv-accent-rgb), .14);
    transition: background var(--cv-dur) var(--cv-ease);
}
.service-card:hover .icon-box,
.service-card:focus-visible .icon-box {
    background: rgba(var(--cv-accent-rgb), .24);
}
.service-title {
    font-size: var(--cv-fs-700);
    font-weight: 700;
    color: var(--cv-primary);
    margin: 0 0 var(--cv-sp-2);
    line-height: var(--cv-lh-snug);
}
/* Muted body text was #5A6B84 on white, which is the footer tone; card
   copy is smaller than that, so it is set one step darker. */
.service-desc {
    font-size: var(--cv-fs-400);
    color: var(--cv-ink-muted);
    line-height: var(--cv-lh-base);
    margin: 0;
    /* Descriptions run to three lines in the Global Coverage card and two
       in most others; reserving the tallest keeps the row even without a
       fixed card height. */
    margin-bottom: var(--cv-sp-4);
}
.service-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--cv-sp-2);
    font-size: var(--cv-fs-300);
    font-weight: 600;
    letter-spacing: .01em;
    /* Text-safe gold; see .section-title .eyebrow for the measurement. */
    color: var(--cv-gold-ink);
    text-decoration: none;
    align-self: flex-start;
    /* 20px of text in a 20px box. Padded out to a comfortable target and
       pulled back with a negative margin so the visual gap between the
       excerpt and the CTA is unchanged. */
    padding: var(--cv-sp-2) 0;
    margin-top: calc(-1 * var(--cv-sp-1));
    min-height: 40px;
    transition: color var(--cv-dur-fast) var(--cv-ease);
}
.service-cta i { transition: transform var(--cv-dur-fast) var(--cv-ease); }
.service-card:hover .service-cta,
.service-card:focus-visible .service-cta,
.post-card:hover .post-cta,
.post-card:focus-within .post-cta { color: var(--cv-primary); }
.service-card:hover .service-cta i,
.service-card:focus-visible .service-cta i { transform: translateX(3px); }

/* ---------------- Post cards ---------------- */
.post-card .post-media {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--cv-surface-2);
    border-bottom: 1px solid var(--cv-line);
}
.post-meta {
    display: flex;
    align-items: center;
    gap: var(--cv-sp-2);
    font-size: var(--cv-fs-200);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--cv-ls-label);
    /* Text-safe gold; see .section-title .eyebrow for the measurement. */
    color: var(--cv-gold-ink);
}
.post-title {
    font-size: var(--cv-fs-700);
    font-weight: 700;
    color: var(--cv-primary);
    line-height: var(--cv-lh-snug);
    margin: 0 0 var(--cv-sp-2);
}
.post-excerpt {
    font-size: var(--cv-fs-400);
    color: var(--cv-ink-muted);
    line-height: var(--cv-lh-base);
    margin: 0;
}

/* ---------------- Steps ---------------- */
/* The three-step process. Previously three independent cards with a
   34px number box inside each, which read as three unrelated boxes rather
   than a sequence. Now the <ol> is the sequence: the numbers sit on the
   connector, so the progression is visible at a glance.
   Desktop is a row joined by a rule; below lg it becomes a stacked flow
   with a vertical rail. No fixed heights anywhere. */
.steps-flow {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--cv-sp-8) var(--cv-sp-6);
    position: relative;
}
/* The connector. Sits behind the markers, so it is inset from the row
   edges and stopped short of the last one. */
.steps-flow::before {
    content: '';
    position: absolute;
    top: 19px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg,
        rgba(var(--cv-accent-rgb), .15),
        rgba(var(--cv-accent-rgb), .55) 50%,
        rgba(var(--cv-accent-rgb), .15));
}
.steps-flow-item {
    position: relative;
    text-align: center;
    padding: 0 var(--cv-sp-3);
}
.step-marker {
    display: block;
    width: 38px;
    height: 38px;
    margin: 0 auto var(--cv-sp-4);
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--cv-primary);
    /* --cv-gold-light, not --cv-gold: the digits sit on --cv-primary
       (#071A49), where the plain accent only reaches 2.86:1 and these are
       13px bold, so they need 4.5:1. accent-light measures 8.05:1 on the
       same background. The border is non-text and clears 3:1 either way. */
    border: 2px solid var(--cv-gold-light);
    color: var(--cv-gold-light);
    font-family: var(--cv-font-mono);
    font-size: var(--cv-fs-300);
    font-weight: 700;
    position: relative;
    z-index: 1;
}
.steps-flow-item .icon-box {
    background: rgba(255, 255, 255, .1);
    color: var(--cv-gold);
    margin-left: auto;
    margin-right: auto;
}
.step-title {
    font-size: var(--cv-fs-700);
    font-weight: 700;
    color: #fff;
    line-height: var(--cv-lh-snug);
    margin: var(--cv-sp-3) 0 var(--cv-sp-2);
}
.step-desc {
    font-size: var(--cv-fs-400);
    /* --cv-ink-muted (#5A6B84) on the dark band measured ~2.9:1. The
       existing band copy colour is used instead. */
    color: var(--cv-on-dark-4);
    line-height: var(--cv-lh-base);
    margin: 0;
    max-width: 34ch;
    margin-inline: auto;
}

/* Stacked flow on mobile and tablet: the horizontal connector becomes a
   vertical rail down the left, and the marker aligns to it. */
@media (max-width: 991.98px) {
    .steps-flow {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--cv-sp-6);
        max-width: 520px;
        margin-inline: auto;
    }
    .steps-flow::before {
        top: 0;
        bottom: 0;
        left: 27px;
        right: auto;
        width: 1px;
        height: auto;
        background: linear-gradient(180deg,
            rgba(var(--cv-accent-rgb), .15),
            rgba(var(--cv-accent-rgb), .55) 50%,
            rgba(var(--cv-accent-rgb), .15));
    }
    .steps-flow-item {
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr);
        grid-template-areas:
            'marker icon'
            'marker title'
            'marker desc';
        column-gap: var(--cv-sp-4);
        row-gap: var(--cv-sp-1);
        text-align: left;
        padding: 0;
    }
    .step-marker {
        grid-area: marker;
        margin: 0;
        /* Spans all three rows so the rail passes behind one marker
           rather than three separate boxes. */
        align-self: start;
        margin-bottom: var(--cv-sp-6);
    }
    .steps-flow-item .icon-box {
        grid-area: icon;
        margin: 0;
        width: 40px;
        height: 40px;
        font-size: var(--cv-fs-600);
    }
    .step-title {
        grid-area: title;
        margin: 0 0 var(--cv-sp-1);
    }
    .step-desc {
        grid-area: desc;
        margin: 0;
        max-width: none;
    }
}

/* Booking wizard stepper, distinct from the homepage flow above. */
.step-card { padding: var(--cv-sp-5); }
.step-card .step-num {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: var(--cv-r-sm);
    background: var(--cv-primary);
    color: #fff;
    font-family: var(--cv-font-mono);
    font-size: var(--cv-fs-300);
    font-weight: 600;
    margin-bottom: var(--cv-sp-3);
}
/* Alternate step marker used by the booking wizard. */
.step-badge {
    width: 26px; height: 26px;
    display: inline-grid; place-items: center;
    border-radius: var(--cv-r-xs);
    background: var(--cv-primary);
    color: #fff;
    font-family: var(--cv-font-mono);
    font-size: var(--cv-fs-200);
    font-weight: 600;
}
.step-badge.done { background: var(--cv-status-delivered); }
.step-badge.active { background: var(--cv-gold-dark); }
.booking-step { border-left: 2px solid var(--cv-line); padding-left: var(--cv-sp-4); }
.booking-step.is-active { border-left-color: var(--cv-gold); }
.booking-step.is-complete { border-left-color: var(--cv-status-delivered); }

/* ---------------- Stats / counters ---------------- */
.counter {
    font-family: var(--cv-font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    letter-spacing: -.02em;
}

/* Booking wizard stepper (book-shipment.php). This used to live in a
   page-level <style> block, which overrode the shared layer; it is here
   now so the wizard matches the rest of the system. */
.steps-nav { gap: var(--cv-sp-2); }
.steps-nav .nav-item { flex: 1 1 0; }
.steps-nav .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--cv-sp-2);
    background: var(--cv-surface);
    border: 1px solid var(--cv-line);
    color: var(--cv-ink-muted);
    border-radius: var(--cv-r-sm);
    padding: var(--cv-sp-2) var(--cv-sp-3);
    font-size: var(--cv-fs-300);
    font-weight: 600;
    cursor: default;
    transition: background var(--cv-dur-fast) var(--cv-ease),
                border-color var(--cv-dur-fast) var(--cv-ease),
                color var(--cv-dur-fast) var(--cv-ease);
}
.steps-nav .nav-link.active {
    background: var(--cv-primary);
    border-color: var(--cv-primary);
    color: #fff;
}
.steps-nav .nav-link.active .step-badge { background: var(--cv-gold); color: var(--cv-primary-dark); }
.steps-nav .nav-link.is-done { border-color: var(--cv-status-delivered); color: var(--cv-status-delivered); }
.steps-nav .nav-link.is-done .step-badge { background: var(--cv-status-delivered); color: #fff; }

@media (max-width: 575.98px) {
    .steps-nav { gap: var(--cv-sp-1); }
    .steps-nav .nav-link { font-size: var(--cv-fs-100); padding: var(--cv-sp-2) var(--cv-sp-1); }
    .steps-nav .nav-link .badge-text { display: none; }
}

/* ---------------- Testimonials ---------------- */
.testimonial-card {
    background: var(--cv-surface);
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-r);
    padding: var(--cv-sp-5);
    width: 100%;
}
/* Text is on white inside a dark band, so these do not inherit the band
   colours that .how-work-band h2 sets for its own headings. */
.testimonial-card .stars { color: var(--cv-gold); letter-spacing: .1em; font-size: var(--cv-fs-300); }
.testimonial-quote {
    font-size: var(--cv-fs-400);
    color: var(--cv-ink-soft);
    font-style: italic;
    line-height: var(--cv-lh-base);
    margin: 0 0 var(--cv-sp-4);
    /* The quote marks moved into CSS so they always pair with the text
       and cannot end up as a stray character when a quote is edited. */
    quotes: '\201C' '\201D' '\2018' '\2019';
}
.testimonial-quote::before { content: open-quote; }
.testimonial-quote::after { content: close-quote; }
.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--cv-sp-3);
    margin-top: auto;
    padding-top: var(--cv-sp-3);
    border-top: 1px solid var(--cv-line);
}
.testimonial-meta { display: flex; flex-direction: column; min-width: 0; }
.testimonial-name {
    font-weight: 700;
    color: var(--cv-primary);
    font-size: var(--cv-fs-400);
}
.testimonial-role {
    font-size: var(--cv-fs-200);
    color: var(--cv-ink-muted);
}

/* ---------------- Video bands ---------------- */
.section-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.section-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(90deg, rgba(var(--cv-primary-dark-rgb), .95) 0%, rgba(var(--cv-primary-dark-rgb), .82) 50%, rgba(var(--cv-primary-dark-rgb), .6) 100%);
}
.how-work-band, .testimonials-band {
    position: relative;
    overflow: hidden;
    color: #fff;
    isolation: isolate;
}
.how-work-band .container, .testimonials-band .container { position: relative; z-index: 1; }
.how-work-band h2, .testimonials-band h2 { color: #fff; }
.how-work-band .section-title p, .testimonials-band .section-title p { color: var(--cv-on-dark-4); }
.how-work-band .section-title .eyebrow { color: var(--cv-gold); }

/* ---------------- CTA band ---------------- */
.cta-band {
    background: var(--cv-primary);
    color: #fff;
    padding: var(--cv-sp-12) 0;
    position: relative;
    overflow: hidden;
    border-top: 2px solid var(--cv-gold);
}
.cta-band .container { position: relative; z-index: 1; }
.cta-band h2 { color: #fff; font-weight: 700; }

/* The two marketing clips are decorative full-bleed backgrounds, and they are
   the only autoplaying motion on a public page, so an OS-level request for
   less motion has to reach them: .auth-bg is handled above and these two were
   missed, which left the whole homepage moving regardless of the setting.

   They are hidden outright rather than paused. Every band paints its own solid
   background first (.home-hero and .cta-band on the navy and the primary), so
   hiding the element drops the section back to a designed flat colour instead
   of leaving a gap - the same treatment .auth-bg gets.

   The hero is the one case where a still is the right answer rather than a
   flat colour, because it has one: .home-hero::before paints the poster frame
   underneath, so a reduced-motion visitor gets the composition without the
   motion instead of losing the hero's imagery to a navy rectangle.

   This is a floor, not the whole fix: hiding an element stops it painting but
   not downloading. main.js is what actually withholds the fetch - it strips a
   markup <source> before the browser can act on it, never mounts a
   data-bg-src clip while the preference is on, and stops one already running if
   the visitor switches it on mid-visit. tests/mainjs_render_test.js runs that
   gate against a DOM shim and asserts the behaviour. */
@media (prefers-reduced-motion: reduce) {
    .hero-video, .section-video { display: none; }
}

/* ---------------- Footer ---------------- */
.site-footer {
    background: var(--cv-primary-dark);
    color: var(--cv-on-dark-6);
    font-size: var(--cv-fs-300);
    position: relative;
    overflow: hidden;
}
.site-footer .container { position: relative; z-index: 1; }
.footer-bottom { position: relative; z-index: 1; }
.site-footer .brand-text { color: #fff; }
.footer-title {
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: var(--cv-fs-100);
    letter-spacing: var(--cv-ls-label);
    margin-bottom: var(--cv-sp-3);
    display: flex;
    align-items: center;
    gap: var(--cv-sp-2);
}
/* Fine gold rule under each footer heading. */
.footer-title::after {
    content: '';
    width: 16px; height: 1px;
    background: var(--cv-gold);
    opacity: .8;
}
.footer-links, .footer-contact { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: var(--cv-sp-1); }
/* Footer links were 16px tall text nodes: comfortable to read, awkward to
   tap. The vertical padding gives each one a ~32px hit area without
   changing the visual rhythm, and the negative margin keeps the list
   from growing. */
.footer-links a {
    color: var(--cv-on-dark-5);
    text-decoration: none;
    display: inline-block;
    padding: var(--cv-sp-2) 0;
    min-height: 32px;
    transition: color var(--cv-dur-fast) var(--cv-ease);
}
.footer-links a:hover { color: var(--cv-gold); }
.footer-contact li {
    display: flex; gap: var(--cv-sp-2);
    margin-bottom: var(--cv-sp-2);
    align-items: flex-start;
}
.footer-contact i { color: var(--cv-gold); margin-top: 4px; font-size: var(--cv-fs-300); }
.footer-about { line-height: var(--cv-lh-loose); }
.footer-social { display: flex; gap: var(--cv-sp-2); }
.footer-social a {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: var(--cv-r-sm);
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    color: var(--cv-on-dark-3);
    transition: all var(--cv-dur-fast) var(--cv-ease);
}
.footer-social a:hover {
    background: var(--cv-gold);
    border-color: var(--cv-gold);
    color: var(--cv-primary-dark);
}
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: var(--cv-fs-200);
}
/* Same tap-target reasoning as .footer-links a above: these three links
   sit next to each other with no gap, so the vertical padding is what
   gives them a usable hit area. The horizontal padding is deliberately
   zero because that would visibly space the group apart. */
.footer-bottom a {
    color: var(--cv-on-dark-5);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: var(--cv-sp-2) 0;
}
.footer-bottom a:hover { color: var(--cv-gold); }

/* ---------------- Back to top ---------------- */
.back-to-top {
    position: fixed;
    right: var(--cv-sp-5); bottom: var(--cv-sp-5);
    border-radius: var(--cv-r-sm);
    width: 40px; height: 40px;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--cv-dur) var(--cv-ease), visibility var(--cv-dur) var(--cv-ease);
    box-shadow: var(--cv-shadow-lg);
}
.back-to-top.show { opacity: 1; visibility: visible; }

/* ---------------- Page hero ---------------- */
.page-hero {
    background: var(--cv-primary-dark);
    color: #fff;
    padding: var(--cv-sp-12) 0;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid var(--cv-gold);
    isolation: isolate;
}
.page-hero::after {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 48px 48px;
    z-index: 0;
    mask-image: linear-gradient(90deg, #000, transparent 70%);
    -webkit-mask-image: linear-gradient(90deg, #000, transparent 70%);
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { color: #fff; font-weight: 700; }
.page-hero .breadcrumb { --bs-breadcrumb-divider-color: rgba(255, 255, 255, .35); margin-bottom: 0; }
.page-hero .breadcrumb a { color: var(--cv-on-dark-4); text-decoration: none; }
.page-hero .breadcrumb a:hover { color: var(--cv-gold); }
.page-hero .breadcrumb-item.active { color: var(--cv-gold); }

/* ---------------- Tracking ---------------- */
.tracking-result { display: none; }

.timeline { position: relative; padding-left: 26px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 7px; top: 6px; bottom: 6px;
    width: 2px;
    background: var(--cv-line);
}
.timeline-item { position: relative; padding-bottom: var(--cv-sp-4); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item .dot {
    position: absolute;
    left: -26px; top: 2px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--cv-surface);
    border: 2px solid var(--cv-line-strong);
    display: grid; place-items: center;
    transition: transform var(--cv-dur-fast) var(--cv-ease);
}
.timeline-item.current .dot { border-color: var(--cv-gold); box-shadow: 0 0 0 3px rgba(var(--cv-accent-rgb), .25); }
.timeline-item.current .dot i { font-size: .5rem; color: var(--cv-gold-dark); }
.timeline-item.done .dot { border-color: var(--cv-status-delivered); background: var(--cv-status-delivered); }
.timeline-item.done .dot i { font-size: .5rem; color: #fff; }
.timeline-item .time {
    font-family: var(--cv-font-mono);
    font-size: var(--cv-fs-200);
    color: var(--cv-ink-muted);
}

/* current/done are applied dynamically by tracking.php and shipments.php. */
.timeline-item.focusable { cursor: pointer; }
.timeline-item.focusable:hover .dot { transform: scale(1.12); }
/* accent-dark, not the plain accent: this outline sits on a white card,
   where the accent only reaches 3.04:1. accent-dark measures 5.62:1. */
.timeline-item.focusable:focus-visible { outline: 2px solid var(--cv-accent-dark); outline-offset: 3px; border-radius: var(--cv-r-sm); }

#shipmentMap { height: 320px; border-radius: var(--cv-r); z-index: 0; }

.tracking-map {
    height: clamp(300px, 46vh, 560px);
    border-radius: var(--cv-r);
    z-index: 0;
    background: #EDF1F5;
}
.tracking-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--cv-sp-1) var(--cv-sp-3);
    font-size: var(--cv-fs-300);
}
.tracking-map-legend i { margin-right: var(--cv-sp-1); color: var(--cv-gold-dark); }

.track-progress { height: 6px; border-radius: var(--cv-r-xs); }
.track-progress .progress-bar {
    background: var(--cv-primary-light);
    font-family: var(--cv-font-mono);
    font-size: var(--cv-fs-100);
    font-weight: 600;
}

@media (max-width: 575.98px) {
    .tracking-map-legend { font-size: var(--cv-fs-200); gap: var(--cv-sp-1) var(--cv-sp-2); }
}

/* ---------------- Auth ---------------- */
.auth-wrap {
    position: relative;
    overflow: hidden;
    min-height: calc(100vh - 200px);
    display: flex; align-items: center;
    padding: var(--cv-sp-10) 0;
    /* The brand green, not the old light surface: it is what shows
       through before the clip loads and what is left behind when the
       clip is suppressed for reduced motion. */
    background: var(--cv-primary-dark);
    border-top: 1px solid var(--cv-line);
}
.auth-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.auth-bg-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(120% 90% at 50% 45%, rgba(var(--cv-primary-dark-rgb), .58) 0%, rgba(var(--cv-primary-dark-rgb), .30) 55%, rgba(var(--cv-primary-dark-rgb), .18) 100%),
        linear-gradient(180deg, rgba(var(--cv-primary-dark-rgb), .40) 0%, transparent 30%);
}
.auth-wrap > .container {
    position: relative;
    z-index: 1;
}

/* The clip is decoration. A visitor who has asked the system to reduce
   motion gets the brand green .auth-wrap already paints underneath, which is
   also what shows before the clip arrives - not the poster, which belongs to
   the element being hidden and therefore goes with it. */
@media (prefers-reduced-motion: reduce) {
    .auth-bg { display: none; }
}
.auth-card {
    background: var(--cv-surface);
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-r-md);
    box-shadow: var(--cv-shadow-lg);
    padding: var(--cv-sp-8);
    max-width: 440px;
    margin: 0 auto;
}
.auth-card h1, .auth-card h3, .auth-card h4 { font-weight: 700; }

/* ---------------- Tables ---------------- */
.table-cv th {
    background: var(--cv-surface-2);
    color: var(--cv-primary);
    font-weight: 600;
    font-size: var(--cv-fs-200);
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
    border-bottom: 1px solid var(--cv-line);
}
.table-cv td {
    vertical-align: middle;
    font-size: var(--cv-fs-400);
    border-color: var(--cv-line);
}
.table-cv tbody tr:hover td { background: var(--cv-surface-2); }
.table-cv tbody tr:last-child td { border-bottom: 0; }

/* ---------------- Forms ---------------- */
.form-control, .form-select {
    border-radius: var(--cv-r-sm);
    border-color: var(--cv-line-strong);
    font-size: var(--cv-fs-400);
}
.form-control:focus, .form-select:focus {
    border-color: var(--cv-gold);
    box-shadow: var(--cv-ring);
}
.form-label {
    font-size: var(--cv-fs-300);
    font-weight: 600;
    color: var(--cv-ink-soft);
}
.form-text { font-size: var(--cv-fs-200); }
.input-group-text { border-radius: var(--cv-r-sm); font-size: var(--cv-fs-300); }

/* Password reveal toggle rendered next to the field. */
.toggle-password {
    background: none;
    border: 0;
    color: var(--cv-ink-muted);
    cursor: pointer;
    padding: 0 var(--cv-sp-2);
}
.toggle-password:hover, .toggle-password:focus-visible { color: var(--cv-primary); }

/* ---------------- Status / metadata chips ---------------- */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--cv-sp-1);
    padding: 2px var(--cv-sp-2);
    border-radius: var(--cv-r-xs);
    font-size: var(--cv-fs-100);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    border: 1px solid transparent;
}
.status-chip::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}
.status-chip.is-pending   { color: var(--cv-status-pending);   background: var(--cv-status-pending-bg);   border-color: rgba(184, 134, 11, .2); }
.status-chip.is-transit   { color: var(--cv-status-transit);   background: var(--cv-status-transit-bg);   border-color: rgba(31, 111, 178, .2); }
.status-chip.is-delivered { color: var(--cv-status-delivered); background: var(--cv-status-delivered-bg); border-color: rgba(27, 127, 82, .2); }
.status-chip.is-failed    { color: var(--cv-status-failed);    background: var(--cv-status-failed-bg);    border-color: rgba(179, 38, 30, .2); }
.status-chip.is-info      { color: var(--cv-status-info);      background: var(--cv-status-info-bg);      border-color: rgba(90, 107, 132, .2); }

/* ---------------- Permissions ---------------- */
.perm-all, .perm-check {
    display: inline-grid;
    place-items: center;
    width: 20px; height: 20px;
    border-radius: var(--cv-r-xs);
    font-size: var(--cv-fs-100);
}
.perm-all { background: rgba(var(--cv-accent-rgb), .14); color: var(--cv-accent-dark); }
.perm-check { background: rgba(27, 127, 82, .1); color: var(--cv-status-delivered); }
/* .perm-none removed: nothing emits it, and stacking opacity on top of
   --cv-ink-faint put it at 1.63:1. Keep .perm-none and .perm-check in sync
   if it ever comes back. */

.notification-count {
    position: absolute;
    top: -2px; right: -2px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    display: inline-grid; place-items: center;
    border-radius: var(--cv-r-pill);
    background: var(--cv-status-failed);
    color: #fff;
    font-family: var(--cv-font-mono);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    border: 2px solid var(--cv-surface);
}

/* ---------------- Review / order detail rows ---------------- */
.review-sender-name, .review-receiver-name { font-weight: 600; color: var(--cv-primary); }
.review-sender-phone, .review-receiver-phone,
.review-sender-email, .review-receiver-email {
    font-family: var(--cv-font-mono);
    font-size: var(--cv-fs-300);
    color: var(--cv-ink-muted);
}
.review-sender-address, .review-receiver-address { color: var(--cv-ink-muted); font-size: var(--cv-fs-300); }
.review-service, .review-parcel-type { font-weight: 500; }
.review-weight, .review-pieces, .review-total {
    font-family: var(--cv-font-mono);
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.review-total { font-weight: 700; color: var(--cv-primary); }

.item-row {
    display: flex;
    align-items: center;
    gap: var(--cv-sp-3);
    padding: var(--cv-sp-3) 0;
    border-bottom: 1px solid var(--cv-line);
}
.item-row:last-child { border-bottom: 0; }

/* ---------------- Blog ---------------- */
.blog-content { color: var(--cv-ink-soft); line-height: var(--cv-lh-loose); }
.blog-content h2, .blog-content h3, .blog-content h4 {
    font-weight: 700; margin-top: var(--cv-sp-6); margin-bottom: var(--cv-sp-3);
}
.blog-content p { margin-bottom: var(--cv-sp-4); }
.blog-content img { border-radius: var(--cv-r); max-width: 100%; height: auto; }
.blog-content blockquote {
    border-left: 2px solid var(--cv-gold);
    padding-left: var(--cv-sp-4);
    color: var(--cv-ink-muted);
    font-style: italic;
}
.blog-content ul, .blog-content ol { padding-left: var(--cv-sp-5); }
.blog-content li { margin-bottom: var(--cv-sp-2); }
.blog-content a { color: var(--cv-primary); text-decoration: underline; text-underline-offset: 3px; }
.blog-content a:hover { color: var(--cv-gold-ink); }
.blog-content pre {
    background: var(--cv-surface-2);
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-r-sm);
    padding: var(--cv-sp-3);
    overflow-x: auto;
    font-size: var(--cv-fs-300);
}

/* ---------------- Certificates ---------------- */
.cert-card {
    background: var(--cv-surface);
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-r);
    overflow: hidden;
    height: 100%;
    transition: transform var(--cv-dur) var(--cv-ease), box-shadow var(--cv-dur) var(--cv-ease);
}
.cert-card:hover { transform: translateY(-3px); box-shadow: var(--cv-shadow-lg); }
.cert-image {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--cv-surface-2);
    border-bottom: 1px solid var(--cv-line);
}
.cert-card .card-body { padding: var(--cv-sp-4); }
.cert-card h3 { font-size: var(--cv-fs-700); font-weight: 600; }
.cert-card p { font-size: var(--cv-fs-300); color: var(--cv-ink-muted); margin-bottom: 0; }
.cert-frame {
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-r);
    padding: var(--cv-sp-3);
    background: var(--cv-surface);
    box-shadow: var(--cv-shadow);
}
.cert-frame img { max-height: 80vh; width: auto; max-width: 100%; }

/* ---------------- Avatars ---------------- */
/* The initials fallback used to render as a single bare letter with a
   4px radius, sitting next to a full name. At 36px with a circular shape
   and two initials it reads as an avatar rather than as a stray glyph. */
.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--cv-primary);
    color: #fff;
    display: inline-grid;
    place-items: center;
    font-family: var(--cv-font-mono);
    font-weight: 600;
    font-size: var(--cv-fs-200);
    letter-spacing: .02em;
    flex: none;
    overflow: hidden;
    text-transform: uppercase;
}
.avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar-lg { width: 56px; height: 56px; font-size: var(--cv-fs-500); }

/* Photo-plus-initials wrapper from avatar(). The fallback is stacked
   under the image and revealed when the image is removed by its onerror
   handler, so a deleted file shows initials instead of a broken icon. */
.avatar-wrap {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 36px;
    flex: none;
}
.avatar-wrap.avatar-sm { width: 28px; height: 28px; }
.avatar-wrap.avatar-lg { width: 56px; height: 56px; }
.avatar-wrap .avatar { position: absolute; inset: 0; width: 100%; height: 100%; }
.avatar-img { z-index: 1; }
/* Once the <img> is removed there is nothing above it, so the initials
   underneath become the visible face. */
.avatar-fallback {
    z-index: 0;
    background: linear-gradient(135deg, var(--cv-primary), var(--cv-primary-light));
}

/* ---------------- Misc ---------------- */
/* ---------------- About / feature media ---------------- */
.about-media {
    position: relative;
    border-radius: var(--cv-r-lg);
}
/* The delivered-parcels figure. It was d-none d-md-block, so on a phone
   the section showed a bare image with no supporting number at all. Now
   shown at every width, as a band overlapping the image edge rather than
   a box floated over the middle of it. */
.about-stat-card {
    margin-top: -3.25rem;
    margin-left: var(--cv-sp-4);
    margin-right: var(--cv-sp-4);
    position: relative;
    z-index: 2;
    background: var(--cv-gold);
    color: var(--cv-primary-dark);
    border-radius: var(--cv-r-md);
    padding: var(--cv-sp-4) var(--cv-sp-5);
    box-shadow: var(--cv-shadow-lg);
    max-width: 20rem;
}
.about-stat-value {
    font-family: var(--cv-font-mono);
    font-size: var(--cv-fs-900);
    font-weight: 700;
    line-height: var(--cv-lh-tight);
    font-variant-numeric: tabular-nums;
}
.about-stat-label {
    font-size: var(--cv-fs-300);
    line-height: var(--cv-lh-snug);
    margin-top: var(--cv-sp-1);
}

.text-navy { color: var(--cv-primary); }
.bg-navy { background: var(--cv-primary); }
.fw-700 { font-weight: 700; }

.alert { border-radius: var(--cv-r-sm); border-width: 1px; font-size: var(--cv-fs-400); }
.badge { font-weight: 600; letter-spacing: .02em; }

.qr-box, .barcode-box {
    background: var(--cv-surface);
    border: 1px dashed var(--cv-line-strong);
    border-radius: var(--cv-r);
    padding: var(--cv-sp-4);
    text-align: center;
}
.qr-box img { width: 150px; height: 150px; image-rendering: pixelated; }
.barcode-box img { max-width: 100%; height: 64px; }

/* ---------------- Print ---------------- */
@media print {
    .no-print, .topbar, .main-nav, .site-footer, .cta-band, .back-to-top { display: none !important; }
    body { background: #fff; color: #000; }
    .card, .cert-frame { border: 1px solid #ccc !important; box-shadow: none !important; }
    a { text-decoration: none; color: #000; }
}

/* ---------------- Motion opt-out ---------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
    .card-hover:hover, .cert-card:hover { transform: none; }
}

/* ------------------------------------------------------------
   Skip link
   ------------------------------------------------------------
   The first focusable element on every page. It is moved off-screen
   rather than hidden, so it stays in the tab order, and is only
   brought back when it takes focus - which is exactly when a keyboard
   user needs to see it. display:none or visibility:hidden would take
   it out of the tab order and defeat the whole point.
   ------------------------------------------------------------ */
.skip-link {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2000;
    padding: 0.75rem 1.25rem;
    background: var(--cv-accent);
    color: var(--cv-primary-dark);
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-120%);
    transition: transform 0.15s ease-in-out;
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
    outline: 3px solid var(--cv-primary-dark);
    outline-offset: 2px;
}

/* The skip target takes focus programmatically, and the default focus
   ring around a whole page region is noise rather than information. */
#main-content:focus {
    outline: none;
}

  /* Reduced motion: the slide is the animation, so drop it rather than
     leaving a transition that delays the link appearing. */
  @media (prefers-reduced-motion: reduce) {
      .skip-link { transition: none; }
  }

  /* =====================================================================
     Homepage redesign
     ---------------------------------------------------------------------
     Scoped under .home-* so these rules cannot leak into about, pricing,
     the dashboard or admin. Colours come from the existing token set
     rather than literals, so the palette check that guards tokens.css
     keeps covering the homepage too.
     ===================================================================== */

  /* ---------------- Hero layout ---------------- */
  .home-hero {
      background: var(--cv-primary-dark);
      color: #fff;
      position: relative;
      overflow: hidden;
      isolation: isolate;
      display: flex;
      flex-direction: column;

      /* "The rest of the first screen", derived from the real header height.
         --cv-header-h is written by assets/js/main.js from the measured
         .topbar + .main-nav stack; tokens.css ships the static fallback for
         the first frame and for visitors with no JavaScript. The earlier
         ladder of fixed min-heights (640 / 760 / 820px) was a guess at the
         same thing and was wrong on every screen that was not one of the three
         it was written for - a 1366x768 laptop got 760px of hero under a 100px
         header, so the fold cut the tracking form in half.

         The vh line is first and the svh line second so a browser without
         svh keeps the older unit rather than dropping the declaration: dvh
         would collapse to almost nothing the moment the mobile URL bar
         retracts, which is exactly when the hero is being looked at. */
      min-height: clamp(560px, calc(100vh - var(--cv-header-h)), 860px);
      min-height: clamp(560px, calc(100svh - var(--cv-header-h)), 860px);

      /* A floor, not a target: the column below is taller than 560px on a
         narrow screen, and min-height never clips, so the copy simply grows
         the section instead of being cut off. The ceiling matters more - past
         ~860px the clip is being scaled so far up that the truck loses its
         framing and the hero starts costing a screen and a half. */
  }

  /* The poster, painted underneath the clip rather than only as its poster
     attribute. This is what makes every fallback work with one image: under
     reduced motion the clip is display:none and the element carrying the
     poster goes away with it, and on a phone the clip still preloads nothing
     (preload="none") so the frame beneath is what paints while it loads.
     Painting the frame here means the hero keeps its imagery in every state
     instead of dropping to flat navy.

     z-index -1 is deliberate. .home-hero sets isolation:isolate, so it is a
     stacking context: a negative child paints above the section's own navy
     background and below everything at z-index 0 and up, which puts it under
     the video (z-index 0) without needing a value that fights the other
     layers. */
  .home-hero::before {
      content: '';
      position: absolute;
      inset: 0;
      z-index: -1;
      background-image: var(--home-hero-poster);
      background-position: 68% 50%;
      background-size: cover;
      background-repeat: no-repeat;
  }

  /* Content column. Top-anchored on purpose rather than centred: the hero is
     sized to the viewport, so centring the copy puts the headline at the
     vertical midpoint of the screen, which is the least useful place for it -
     a visitor reads the headline while the fold is still in their eye. Top
     anchoring lands the overline, headline, lead, chips and both CTAs above
     the fold at every height the hero supports, and leaves the slack at the
     bottom where the tracking form and the status card can breathe.

     Deliberately not justify-content:center: this is a column flex box inside
     an overflow:hidden section, so centring a column taller than its box
     pushes the top out of the scrollable area and silently crops the
     headline. Top-anchoring has no such failure mode. */
  .home-hero-inner {
      position: relative;
      z-index: 3;
      flex: 1 1 auto;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      padding-top: clamp(var(--cv-sp-8), 3.5vh, var(--cv-sp-12));
      padding-bottom: var(--cv-sp-10);
  }

  /* Route network, over the clip and under the overlay. Full bleed so the
     lanes cross the whole hero, and at a fraction of its former opacity: it
     was built to be the focal illustration when the clip did not exist, and at
     full strength on top of moving footage it is a second picture competing
     with the first. Its truck is gone from the SVG for the same reason - see
     assets/images/hero-fleet.svg. */
  .home-hero-visual {
      position: absolute;
      inset: 0;
      z-index: 1;
      pointer-events: none;
      opacity: .22;
      overflow: hidden;
  }
  .home-hero-visual img {
      position: absolute;
      right: -6%;
      bottom: -8%;
      width: 118%;
      max-width: none;
      height: auto;
  }
  @media (min-width: 992px) {
      .home-hero-visual { opacity: .28; }
      .home-hero-visual img { right: -2%; width: 104%; bottom: -4%; }
  }

  /* The overlay stack. Two gradients, because they answer two different
     questions and one gradient cannot do both.

     The horizontal one carries the copy. This clip is bright enough to wreck a
     headline on its own - hero_scene_check.php measures mean luminance 97
     across the frame, 124 on the open right half against 59 on the left - so
     the navy has to be near-opaque where the type is and gone by the time the
     rig appears. The stops below are set against the clip's own composition:
     the trailer's left edge is measured at 0.505w and the bright mass is
     centred at 0.682w, so the ramp reaches zero at 68% and the rig is never
     dimmed. It used to bottom out at 0.25 at 65% and only reach zero at the
     far edge, which put a 25% veil over the cab.

     Holding to .84 at 44% is not decoration. The copy column is col-lg-6, so it
     ends at exactly 0.50w, and hero_media_probe.php composites these stops over
     five decoded frames and reads the worst contrast of the body region: at the
     old 42%/56% stops the right edge of the column sat at .55 alpha and the lead
     measured 4.49:1, under AA. .74 at 50% buys 5.6:1 there.

     The vertical one is the opposite job and deliberately edge-only: it stops
     the top of the frame competing with the nav and keeps the road from
     flaring into the stat band. It has no business shading the middle, and it
     used to - .12 at 34% running to .18 at the floor multiplied with the
     horizontal ramp across the whole body region and was most of what dragged
     that 4.49:1 down. */
  .home-hero-scrim {
      position: absolute;
      inset: 0;
      z-index: 2;
      pointer-events: none;
      background:
          linear-gradient(180deg,
              rgba(var(--cv-primary-dark-rgb), .46) 0%,
              rgba(var(--cv-primary-dark-rgb), .14) 11%,
              rgba(var(--cv-primary-dark-rgb), 0) 19%,
              rgba(var(--cv-primary-dark-rgb), 0) 84%,
              rgba(var(--cv-primary-dark-rgb), .13) 100%),
          linear-gradient(90deg,
              rgba(var(--cv-primary-dark-rgb), .96) 0%,
              rgba(var(--cv-primary-dark-rgb), .94) 20%,
              rgba(var(--cv-primary-dark-rgb), .90) 36%,
              rgba(var(--cv-primary-dark-rgb), .84) 44%,
              rgba(var(--cv-primary-dark-rgb), .74) 50%,
              rgba(var(--cv-primary-dark-rgb), .50) 56%,
              rgba(var(--cv-primary-dark-rgb), .18) 62%,
              rgba(var(--cv-primary-dark-rgb), 0) 68%);
  }
  @media (max-width: 767.98px) {
      /* One axis at a time. Below md the copy is the full width of the frame,
         so there is no open right half to leave uncovered and a horizontal
         ramp would only wash out the middle of the text. The clip runs at
         this width too; this is grading it for the phone layout. */
      .home-hero-scrim {
          background:
              linear-gradient(180deg,
                  rgba(var(--cv-primary-dark-rgb), .62) 0%,
                  rgba(var(--cv-primary-dark-rgb), .30) 30%,
                  rgba(var(--cv-primary-dark-rgb), .55) 72%,
                  rgba(var(--cv-primary-dark-rgb), .88) 100%);
      }
  }

  .home-hero-overline {
      display: inline-flex;
      align-items: center;
      gap: var(--cv-sp-2);
      font-size: var(--cv-fs-300);
      font-weight: 600;
      text-transform: uppercase;
      color: var(--cv-gold);
      background: rgba(var(--cv-gold-rgb), .1);
      border: 1px solid rgba(var(--cv-gold-rgb), .35);
      border-radius: var(--cv-r-pill);
      padding: var(--cv-sp-1) var(--cv-sp-3);
  }
  .home-hero-overline .dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--cv-gold);
      flex: none;
  }
  /* ---------------- Hero typography ---------------- */
  /* One dominant element, one supporting line, one quiet label. The previous
     pass weighted the overline, headline, lead and chips at 600/800/500/400,
     which is four medium-bolds in a row and reads as noise. Now: 700 headline,
     400 lead, 600 micro-label. */
  .home-hero h1 {
      color: #fff;
      font-weight: 700;
      /* Requested range was clamp(42px, 5vw, 72px) at line-height .98.
         The floor is lifted from 32px to 42px so the headline is still the
         largest thing on a 320px screen, and the ceiling matches the
         requested 72px. */
      font-size: clamp(42px, 1.5rem + 3.9vw, 72px);
      line-height: .98;
      letter-spacing: -0.03em;
      /* Two short lines. Capping at 15ch stops a longer translation from
         wrapping the headline into four lines and pushing the tracking form
         below the fold. */
      max-width: 15ch;
      margin-bottom: var(--cv-sp-3);
  }
  .home-hero h1 .accent { color: var(--cv-accent); }
  .home-hero-lead {
      color: var(--cv-on-dark-4);
      /* 18px / 1.6 as specified. The floor is 16px rather than 18px because a
         fixed 18px lead next to a 42px headline overflows on a 320px screen. */
      font-size: clamp(16px, .95rem + .2vw, 18px);
      line-height: 1.6;
      font-weight: 400;
      max-width: 48ch;
  }
  /* Micro-label: 12-14px, wide tracking, uppercase. */
  .home-hero-overline {
      font-size: clamp(12px, 11px + .2vw, 14px);
      letter-spacing: .08em;
  }

  .home-hero-chips { display: flex; flex-wrap: wrap; gap: var(--cv-sp-2) var(--cv-sp-3); }
  .home-hero-chips .chip {
      display: inline-flex;
      align-items: center;
      gap: var(--cv-sp-2);
      font-size: var(--cv-fs-300);
      color: var(--cv-on-dark-3);
      background: rgba(255, 255, 255, .06);
      border: 1px solid rgba(var(--cv-accent-rgb), .3);
      border-radius: var(--cv-r-pill);
      padding: var(--cv-sp-1) var(--cv-sp-3);
  }
  .home-hero-chips .chip i { color: var(--cv-accent); }

  /* ---------------- Trust row ---------------- */
  /* Sits directly under the CTA. Figures come from queries, so they are real
     or they are an em dash; there is no hardcoded "150+ countries" here. */
  .home-trust {
      display: flex;
      flex-wrap: wrap;
      gap: var(--cv-sp-2) var(--cv-sp-4);
      padding-top: var(--cv-sp-1);
  }
  .home-trust-item {
      display: inline-flex;
      align-items: baseline;
      gap: var(--cv-sp-1);
      font-size: var(--cv-fs-300);
      color: var(--cv-on-dark-5);
  }
  .home-trust-item i { color: var(--cv-accent); font-size: var(--cv-fs-200); }
  .home-trust-item .value {
      font-family: var(--cv-font-display);
      font-weight: 700;
      color: #fff;
  }

  /* ---------------- Inline tracking form ---------------- */
  .home-track {
      background: rgba(255, 255, 255, .07);
      border: 1px solid rgba(var(--cv-accent-rgb), .3);
      border-radius: var(--cv-r-md);
      padding: var(--cv-sp-3);
  }
  .home-track .form-control {
      background: rgba(255, 255, 255, .95);
      border-color: transparent;
      color: var(--cv-ink);
  }
  .home-track .form-control:focus {
      background: #fff;
      border-color: var(--cv-gold);
      box-shadow: 0 0 0 3px rgba(var(--cv-gold-rgb), .3);
  }
  .home-track .input-group-text {
      background: var(--cv-gold);
      color: var(--cv-gold-ink);
      border-color: transparent;
      font-weight: 600;
  }
  .home-track-hint { font-size: var(--cv-fs-300); color: var(--cv-on-dark-5); }

  /* ---------------- Live fleet status card ---------------- */
  /* Glass over the clip. This was an opaque #fff panel, which was right while the
     hero behind it was flat navy and wrong the moment there was footage: a
     solid rectangle over a video is a hole in it. So the fill is the house
     frosted-on-navy idiom - a low-alpha white over a navy base, a hairline, an
     inset highlight along the top edge - with a real blur on top.

     Everything inside has to move with it. The labels were --cv-ink-muted on
     white and the value was --cv-primary, both near-black-on-white, and
     neither survives a translucent navy card. The replacements are the on-dark
     ramp, whose measured headroom on --cv-primary-dark starts at 12.24:1, so
     the worst case is a blurred bright patch rather than text that fails.
     tools/palette_contrast.php guards that ramp; the composited card
     background is checked by tools/hero_media_probe.php. */
  .home-fleet-card {
      --cv-fleet-fill: linear-gradient(180deg,
          rgba(255, 255, 255, .08), rgba(255, 255, 255, .04));
      position: relative;
      background: var(--cv-fleet-fill), rgba(var(--cv-primary-dark-rgb), .90);
      border: 1px solid rgba(255, 255, 255, .20);
      border-radius: var(--cv-r-lg);
      box-shadow: var(--cv-shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .18);
      backdrop-filter: blur(14px) saturate(140%);
      -webkit-backdrop-filter: blur(14px) saturate(140%);
      color: #fff;
      overflow: hidden;
  }
  /* No blur, no glass. Without this the card is rgba(255,255,255,.06) over a
     moving image, which is how the 12px labels and the capacity bars end up
     fighting the footage behind them. The navy base is opaque enough to read
     against anything the clip does.

     That is also why the base is .90 and the sheen is only .08/.04, rather than
     the .58 / .15 / .06 they were authored at against an assumed dark backdrop.
     The right half of this clip is bright everywhere - the sky above the rig
     peaks at luminance .78 and the road below it at 1.00 - so there is no dark
     corner to put a card on and the base has to do the work by itself. A blur
     cannot lighten past the brightest thing it is blurring, so hero_media_probe
     .php composites the stack over the brightest pixel the card actually covers
     rather than over a flat guess: at .58 the 12px labels sat at 3.13:1 and the
     footnote at 2.92:1. At .90/.08/.04 the probe measures 6.69:1 on the labels
     and 6.23:1 on the footnote. The blur, the hairline and the inset highlight
     are what make it look like glass; the base only has to make it legible. */
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
      .home-fleet-card {
          background: rgba(var(--cv-primary-dark-rgb), .92);
          border-color: rgba(var(--cv-accent-rgb), .34);
      }
  }
  /* Floats over the clip's top corner from lg up. It was pinned to the bottom
     right, which put it straight across the rig: the bright mass in the scene
     sits at 0.54h-0.74h, so the bottom corner was the one place it could not
     go. Top right clears the subject, and what it now reads as sitting on is
     sky and the container terminal.

     right is half a gutter rather than 0, because an absolutely positioned
     child is placed against its containing block's padding box, so 0 hangs the
     card a half gutter outside the copy's right edge.

     Below lg it returns to normal flow: an absolutely positioned card at 320px
     either overflows the viewport or covers the copy behind it. */
  @media (min-width: 992px) {
      .home-fleet-card {
          position: absolute;
          top: clamp(var(--cv-sp-5), 4vh, var(--cv-sp-10));
          right: calc(var(--bs-gutter-x, 1.5rem) * .5);
          z-index: 4;
          width: min(340px, 34%);
      }
  }
  .home-fleet-card-head {
      background: rgba(var(--cv-primary-dark-rgb), .42);
      color: #fff;
      padding: var(--cv-sp-2) var(--cv-sp-3);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: var(--cv-sp-2);
      border-bottom: 1px solid rgba(255, 255, 255, .12);
  }
  .home-fleet-card-head .eyebrow {
      font-size: var(--cv-fs-200);
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: var(--cv-ls-label);
  }
  .home-fleet-card-head .pulse {
      display: inline-flex;
      align-items: center;
      gap: var(--cv-sp-1);
      font-size: var(--cv-fs-200);
      color: var(--cv-on-dark-3);
  }
  .pulse-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--cv-status-delivered);
      flex: none;
  }
  /* The ring is animation, not information: it is suppressed entirely
     under prefers-reduced-motion below, leaving a plain filled dot. */
  .pulse-dot::after {
      content: '';
      position: absolute;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: inherit;
      animation: homePulse 2.4s var(--cv-ease) infinite;
  }
  @keyframes homePulse {
      0%   { transform: scale(1); opacity: .7; }
      100% { transform: scale(3.4); opacity: 0; }
  }

  /* Metrics are now stacked rows rather than a 2x2 tile grid, so each one
     carries a label, a figure and a capacity bar. A tile grid gave the label
     and the number equal weight and had nowhere to put the bar. */
  .home-fleet-metrics { display: block; }
  .home-fleet-metric {
      padding: var(--cv-sp-3);
      border-top: 1px solid rgba(255, 255, 255, .12);
  }
  .home-fleet-metric:first-child { border-top: 0; }
  .home-fleet-metric-head {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: var(--cv-sp-2);
      margin-bottom: var(--cv-sp-1);
  }
  .home-fleet-metric-label {
      font-size: var(--cv-fs-200);
      color: var(--cv-on-dark-2);
      text-transform: uppercase;
      letter-spacing: var(--cv-ls-label);
      display: inline-flex;
      align-items: center;
      gap: var(--cv-sp-1);
  }
  .home-fleet-metric-value {
      font-family: var(--cv-font-display);
      font-size: var(--cv-fs-700);
      font-weight: 700;
      line-height: var(--cv-lh-tight);
      color: #fff;
      font-variant-numeric: tabular-nums;
  }

  /* Capacity bar. The track is always drawn; the fill is only as wide as the
     measured share. When there is no measurement the fill is absent, which
     reads as "not measured" rather than "measured, and the answer is zero".
     Width is set inline from a query-derived percentage, never hardcoded. */
  .home-fleet-bar {
      height: 6px;
      border-radius: var(--cv-r-pill);
      background: rgba(255, 255, 255, .16);
      overflow: hidden;
  }
  .home-fleet-bar > span {
      display: block;
      height: 100%;
      border-radius: var(--cv-r-pill);
      background: var(--cv-status-delivered);
      transition: width var(--cv-dur-slow) var(--cv-ease);
  }
  /* Each metric keeps its own status hue so the bar colour matches the row. */
  .home-fleet-bar.is-transit > span   { background: var(--cv-status-transit); }
  .home-fleet-bar.is-delivered > span { background: var(--cv-status-delivered); }
  .home-fleet-bar.is-ontime > span    { background: var(--cv-accent-light); }
  /* The unmeasured case. index.php has always emitted .is-empty when a figure
     has no reading behind it, but nothing ever styled the class, so it rendered
     as a full-width solid track and read as "measured, and the answer is zero"
     - which is a different claim from "nothing to report". Outlined and
     unfilled, so the row still lines up but cannot be misread as a value. */
  .home-fleet-bar.is-empty {
      background: none;
      border: 1px dashed rgba(255, 255, 255, .3);
      box-sizing: border-box;
  }
  /* A long thin bar is hard to see, so it also carries a visible minimum.
     Below 4% the fill would otherwise render sub-pixel. */
  .home-fleet-bar > span { min-width: 4px; }

  .home-fleet-card-foot {
      padding: var(--cv-sp-2) var(--cv-sp-3);
      border-top: 1px solid rgba(255, 255, 255, .12);
      font-size: var(--cv-fs-200);
      color: var(--cv-on-dark-3);
      background: rgba(var(--cv-primary-dark-rgb), .34);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: var(--cv-sp-2);
  }

  /* ---------------- Feature bar ---------------- */
  /* The bar sits directly under the stat band and was previously tight
     against both, which is what made it read as a fourth element of the stat
     block instead of a section of its own. Vertical padding is doubled and
     the columns are centred on their own axis. */
  .home-feature-bar {
      background: var(--cv-surface-2);
      border-top: 1px solid var(--cv-line);
      border-bottom: 1px solid var(--cv-line);
      padding: var(--cv-sp-10) 0;
  }
  .home-feature-bar .row { align-items: center; }
  .home-feature-bar .feature {
      display: flex;
      gap: var(--cv-sp-3);
      align-items: flex-start;
      max-width: 30ch;
  }
  .home-feature-bar .feature i {
      font-size: var(--cv-fs-400);
      color: var(--cv-primary);
      flex: none;
      width: 1.5em;
      text-align: center;
      /* The icon is the only thing in the row that is not text, so it gets
         the surface tint rather than a colour of its own. */
      line-height: 1.9;
  }
  .home-feature-bar .feature h3 {
      font-size: var(--cv-fs-500);
      font-weight: 700;
      margin-bottom: var(--cv-sp-2);
      letter-spacing: -0.01em;
  }
  .home-feature-bar .feature p {
      font-size: var(--cv-fs-300);
      color: var(--cv-ink-muted);
      line-height: 1.55;
      margin-bottom: 0;
  }

  /* ---------------- Section rhythm ---------------- */
  .home-section { padding: var(--cv-sp-12) 0; }
  .home-section-sm { padding: var(--cv-sp-10) 0; }
  .home-section-alt { background: var(--cv-surface-2); }

  /* ---------------- Network route list ---------------- */
  .home-route-list { display: grid; gap: var(--cv-sp-3); }
  .home-route {
      display: flex;
      align-items: center;
      gap: var(--cv-sp-3);
      padding: var(--cv-sp-3);
      background: #fff;
      border: 1px solid var(--cv-line);
      border-radius: var(--cv-r-md);
      transition: border-color var(--cv-dur-fast) var(--cv-ease),
                  box-shadow var(--cv-dur-fast) var(--cv-ease);
  }
  .home-route:hover, .home-route:focus-within {
      border-color: rgba(var(--cv-primary-rgb), .5);
      box-shadow: var(--cv-shadow-md);
  }
  .home-route-icon {
      width: 44px;
      height: 44px;
      border-radius: var(--cv-r-sm);
      background: rgba(var(--cv-primary-rgb), .1);
      color: var(--cv-primary);
      display: grid;
      place-items: center;
      font-size: var(--cv-fs-400);
      flex: none;
  }
  .home-route h3 { font-size: var(--cv-fs-500); font-weight: 700; margin-bottom: 2px; }
  .home-route p { font-size: var(--cv-fs-300); color: var(--cv-ink-muted); margin-bottom: 0; }

  /* ---------------- Numbers band ---------------- */
  /* Named for the numbers band it actually styles. It was .home-sustain-metric,
     left over from a sustainability section that no longer exists, and the
     mismatch made it look like a dark-section accent colour when it renders
     on the light background. */
  .home-number-metric {
      border-left: 3px solid var(--cv-accent);
      padding-left: var(--cv-sp-3);
  }
  .home-number-metric .value {
      font-family: var(--cv-font-display);
      font-size: var(--cv-fs-900);
      font-weight: 700;
      line-height: var(--cv-lh-tight);
      color: var(--cv-primary);
      font-variant-numeric: tabular-nums;
  }
  .home-number-metric .label { font-size: var(--cv-fs-300); color: var(--cv-ink-muted); }

/* ---------------- Tablet: keep the network out of the copy's way ---------- */
  /* Between 576px and 991px the copy is nearly the full width of the frame, so
     the route network has almost nowhere to go without crossing it. It stays,
     because it is the only thing here that reads as a network, but it drops
     back towards the texture opacity rather than trying to be a scene. */
  @media (max-width: 991.98px) {
      .home-hero-visual { opacity: .18; }
      .home-hero-visual img { width: 130%; right: -14%; }
  }

  /* ---------------- Mobile: a different composition, not a shrunk one ------- */
  /* The desktop hero carries a headline, a subline, four chips, two CTAs, a
     tracking form and a status card. Scaled down, that is unreadable and
     pushes the fold to about 1200px. So on mobile the order changes and the
     decoration is culled rather than reduced: chips are dropped, the network is
     pushed behind the copy at low opacity, and the status card moves below the
     tracking form. What is kept is what someone can actually act on. */
  @media (max-width: 575.98px) {
      /* min-height is dropped entirely rather than shrunk to a smaller clamp.
         The header-derived figure is a viewport measurement, and on a phone in
         portrait it is taller than the interesting part of the hero, so
         honouring it would pad the section with empty navy below the tracking
         form. Content height is the right answer here. */
      .home-hero { min-height: 0; }
      .home-hero-inner { padding-top: var(--cv-sp-6); padding-bottom: var(--cv-sp-8); }
      /* Two pill buttons side by side at 320px leave room for about four
         characters each, so they stack full width instead. */
      .home-hero .btn { width: 100%; }
      .home-hero h1 { font-size: clamp(34px, 10vw, 42px); max-width: none; }
      .home-hero-lead { max-width: none; }
      /* The chip row is supporting detail on desktop; on a phone it is three
         extra lines of competing text above the fold. Hidden entirely. */
      .home-hero-chips { display: none; }
      /* The poster is the hero's whole imagery at this width - the clip is
         display:none and never fetched - so the network layer is competing with
         a photograph rather than tinting one. At 12% it is a texture. */
      .home-hero-visual { opacity: .12; }
      .home-hero-visual img { width: 160%; right: -28%; bottom: -4%; }
      /* The md rule already replaced the horizontal ramp with a vertical one
         because there is no open right half here. This tightens it: the copy is
         the full width of the frame on a phone, so the wash has to hold for the
         headline and the lead at every width, and the band from 30% to 72% is
         where the tracking form sits. */
      .home-hero-scrim {
          background:
              linear-gradient(180deg,
                  rgba(var(--cv-primary-dark-rgb), .72) 0%,
                  rgba(var(--cv-primary-dark-rgb), .62) 22%,
                  rgba(var(--cv-primary-dark-rgb), .72) 60%,
                  rgba(var(--cv-primary-dark-rgb), .90) 100%);
      }
      /* Only the blur changes here. The fill does not: the backdrop is the same
         clip's poster at the same corner, so the base that has to carry the
         12px labels over the sky is the same base. A lighter one here would have
         been right if the card sat over flat navy, and wrong on this footage. */
      .home-fleet-card {
          backdrop-filter: blur(10px);
          -webkit-backdrop-filter: blur(10px);
      }
      .home-track { padding: var(--cv-sp-3) var(--cv-sp-2); }
      /* input-group with a 44px-tall button overflows at 320px, so the button
         drops to its own full-width row under the field. */
      .home-track .input-group { flex-wrap: wrap; }
      .home-track .input-group .form-control { flex: 1 1 100%; }
      .home-track .input-group .btn { width: 100%; margin-top: var(--cv-sp-2); }
      .home-track .input-group-text { display: none; }
      .home-feature-bar .feature { margin-bottom: var(--cv-sp-4); }
      .home-feature-bar .feature:last-child { margin-bottom: 0; }
      .home-trust { gap: var(--cv-sp-1) var(--cv-sp-3); }
  }

  /* ---------------- Reduced motion ---------------- */
  @media (prefers-reduced-motion: reduce) {
      .pulse-dot::after { animation: none; display: none; }
      .home-fleet-bar > span { transition: none; }
      .home-route, .home-track, .home-hero-chips .chip { transition: none; }
  }
