/* ============ TOKENS ============ */
:root {
    --primary: #3783C5;
    --primary-deep: #1D5C94;
    --primary-soft: #6FB3E8;
    --secondary: #979797;
    --dark: #0D2540;
    --tint: #EBF4FC;
    --bg: #FFFFFF;
    --border: rgba(13, 37, 64, 0.15);
    --accent: var(--primary-soft); /* legacy alias — ported logistics SVG uses var(--accent) */
    /* legacy aliases used by ported logistics CSS (css/logistics.css) */
    --light-tint: var(--tint);
    --font-display: var(--font-head);
    --weight-heading: 700;
    --weight-bold: 700;
    --text-h3: 1.5rem;
    --text-body: 1rem;
    --text-tiny: 0.75rem;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --section-pad: clamp(4rem, 10vw, 8rem);
    --gutter: clamp(1rem, 4vw, 3rem);
    --font-head: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --nav-h: 72px;
}

/* ============ RESET / BASE ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 80px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--tint);
}
html::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-track { background: var(--tint); }
html::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 999px;
    border: 2px solid var(--tint);
}
html::-webkit-scrollbar-thumb:hover { background: var(--primary-deep); }
body {
    background: var(--bg);
    color: var(--dark);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
p { color: rgba(13, 37, 64, 0.72); }

/* ============ LAYOUT ============ */
.container { max-width: 1600px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-pad); }
.section--tint { background: var(--tint); }

/* Numbered section header: <div class="section-head"><span class="num">01</span><span class="micro-label">ABOUT</span></div> */
.section-head { display: flex; align-items: center; gap: 1rem; margin-bottom: clamp(2rem, 5vw, 4rem); }
.section-head .num { font: 700 0.85rem/1 var(--font-head); color: var(--primary); }
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.micro-label { font: 600 0.72rem/1 var(--font-body); letter-spacing: 0.2em; text-transform: uppercase; color: var(--secondary); }

.section-title {
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    text-transform: uppercase;
    letter-spacing: -0.03em;
    margin-top: clamp(1rem, 2vw, 3rem); /* consistent spacing between section-head and section-title */
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 1rem 2.25rem;
    border-radius: 999px;
    font: 600 0.8rem/1 var(--font-body);
    letter-spacing: 0.12em; text-transform: uppercase;
    cursor: pointer; border: 1px solid transparent;
    transition: background-color .3s, color .3s, border-color .3s, transform .3s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-deep); transform: translateY(-2px); }
.btn-secondary { background: transparent; border-color: var(--dark); color: var(--dark); }
.btn-secondary:hover { background: var(--dark); color: #fff; }
.btn-secondary.on-dark { border-color: #fff; color: #fff; }
.btn-secondary.on-dark:hover { background: #fff; color: var(--dark); }

/* ============ CARDS + CORNER BRACKETS ============ */
.card { position: relative; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); }
.bk { position: absolute; width: 18px; height: 18px; border: 0 solid var(--border); transition: border-color .3s; pointer-events: none; z-index: 2; }
.bk-tl { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: var(--radius-sm); }
.bk-tr { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: var(--radius-sm); }
.bk-bl { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: var(--radius-sm); }
.bk-br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: var(--radius-sm); }
.card:hover .bk, .bracket-host:hover .bk, .product-card:hover .bk { border-color: var(--primary); }

/* ============ REVEAL STATES ============ */
.js [data-reveal] { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
    .js [data-reveal] { visibility: visible; }
}

/* ============ PRELOADER ============ */
/* Rendered whenever the inline head script adds .is-preloading (every page load). */
#preloader { display: none; }
/* overflow:hidden on html alone doesn't reliably block scroll in every browser —
   body needs it too. This still isn't sufficient by itself: Lenis drives scroll
   from its own JS loop independent of overflow, so it's also explicitly
   stopped/started around the loader in initPreloader() below. */
html.is-preloading, html.is-preloading body { overflow: hidden; }
.is-preloading #preloader {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: fixed; inset: 0; z-index: 10000;
    background: var(--bg);
    padding: clamp(1.25rem, 3vw, 2.5rem) var(--gutter) clamp(1.5rem, 4vw, 3rem);
    overflow: hidden;
    /* failsafe: if JS dies entirely, stop blocking the page after 10s */
    animation: preloader-failsafe 0s linear 10s forwards;
}
@keyframes preloader-failsafe { to { visibility: hidden; } }
.preloader-head { display: flex; justify-content: space-between; align-items: center; }
.preloader-brand { display: flex; align-items: center; gap: 0.6rem; }
.preloader-logo { height: 22px; width: auto; }
.preloader-count {
    align-self: flex-end;
    display: flex; align-items: baseline;
    font: 700 clamp(6rem, 18vw, 14rem)/0.85 var(--font-head);
    letter-spacing: -0.04em;
    color: var(--dark);
    font-variant-numeric: tabular-nums;
}
.preloader-pct { font-size: 0.32em; color: var(--primary); }
.preloader-rule {
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 4px; background: rgba(13, 37, 64, 0.12);
}
#preloader-bar {
    display: block; height: 100%; width: 100%;
    background: var(--primary);
    box-shadow: 0 0 8px rgba(55, 131, 197, 0.6);
    transform: scaleX(0); transform-origin: left;
}

/* ============ MARQUEE (CSS keyframes, reused) ============ */
@keyframes marquee-left { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.marquee { overflow: hidden; white-space: nowrap; }
.marquee-track { display: inline-flex; gap: 2rem; animation: marquee-left 40s linear infinite; will-change: transform; }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }
