/* CSL Trading — tokens and base. Values from DESIGN.md (Stone). */
:root {
  --bg: #f5f6f4; --surface: #ebedea; --ink: #1e2424; --muted: #5b6868; --line: #d9dddb; --accent: #55696a;
  --dark: #1e2424; --on-dark: #eef2f2; --on-dark-muted: #a9b6b6; --panel: #3a4545; --btn: #1e2424; --btn-ink: #ffffff;
  --font-display: Kanit, "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --gutter: 16px;
  --section: clamp(72px, 9vw, 128px);
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 20px;
  --shadow-card: 0 0 0 1px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-card-hover: 0 0 0 1px rgba(0, 0, 0, .06), 0 12px 28px rgba(0, 0, 0, .1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --nav-h: 84px;
}
@media (min-width: 521px) { :root { --gutter: clamp(24px, 4.5vw, 64px); } }
*, *::before, *::after { box-sizing: border-box; }
/* the scrollbar's room is always kept, so locking the scroll (preloader, phone menu) never shifts the page sideways */
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.65 var(--font-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* on the dark footer the ring is on-dark, so it keeps 3:1 against the ground */
.foot :focus-visible { outline-color: var(--on-dark); }
.skip { position: absolute; left: var(--s4); top: -60px; z-index: 100; padding: var(--s3) var(--s4); background: var(--ink); color: var(--btn-ink); font: 400 13px/1.2 var(--font-display); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; }
.skip:focus { top: var(--s4); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Preloader (home page, once per visit): the mark assembles as it reads, C, S, S, L, each piece rising along the
   logo's slant; the wordmark follows; a hairline like the hero's ticks fills as the page really loads. Then the ground
   lifts away like a sheet, uncovering the hero. */
.loader { display: none; position: fixed; inset: 0; z-index: 200; place-items: center; color: var(--ink); }
.loading .loader, .loader.leaving { display: grid; }
.loader.leaving { pointer-events: none; }
.loading { overflow: hidden; }
.loader-bg { position: absolute; inset: 0; background: var(--bg); box-shadow: 0 1px 0 var(--line); }   /* the hairline edges the sheet as it lifts */
.loader-in { position: relative; display: grid; justify-items: center; gap: var(--s7); }
.loader svg { display: block; width: clamp(200px, 22vw, 300px); height: auto; overflow: visible; fill: currentColor; transform-origin: 0 0; }
.loader .m { animation: loader-rise 1s var(--ease-out) both; animation-delay: calc(var(--i) * 110ms + 150ms); }
.loader .t { animation: loader-word .7s var(--ease-out) both; animation-delay: calc(var(--i) * 45ms + 650ms); }
@keyframes loader-rise { from { opacity: 0; translate: -36px 90px; } }   /* along the slant, in the logo's own units */
@keyframes loader-word { from { opacity: 0; translate: 0 26px; } }
.loader-tag { margin: calc(var(--s7) * -1 + var(--s4)) 0 0; font: 300 18px/1.3 var(--font-display); letter-spacing: .01em; color: var(--muted); animation: loader-word .7s var(--ease-out) 1s both; }
.loader-bar { position: relative; width: 96px; height: 2px; background: var(--line); overflow: hidden; animation: loader-word .5s var(--ease-out) .9s both; }
.loader-bar::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform-origin: left; scale: var(--p, 0) 1; transition: scale .5s var(--ease-out); }

/* Layout */
.wrap { max-width: 1280px; margin-inline: auto; padding-inline: var(--gutter); }
.band { padding-block: var(--section); }
.band.bg { background: var(--bg); }
.band.surface { background: var(--surface); }

/* Type */
.eyebrow { display: block; margin: 0 0 var(--s4); font: 400 13px/1.2 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.h2 { margin: 0; font: 300 clamp(30px, 3.2vw, 44px)/1.1 var(--font-display); letter-spacing: -.015em; max-width: 20ch; text-wrap: balance; }
.h3 { margin: 0 0 var(--s2); font: 400 20px/1.3 var(--font-display); }
.lead { margin: 0; font-size: 18px; line-height: 1.55; color: var(--muted); max-width: 52ch; text-wrap: pretty; }
@media (max-width: 520px) { .lead { font-size: 17px; } }
.body { margin: 0; color: var(--muted); max-width: 65ch; text-wrap: pretty; }
.head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); gap: var(--s4) var(--s8); align-items: end; margin-bottom: clamp(48px, 5vw, 64px); }
@media (max-width: 900px) { .head { grid-template-columns: 1fr; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 var(--s5); font: 400 13px/1.2 var(--font-display); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; white-space: nowrap; background: var(--btn); color: var(--btn-ink); border: 1px solid var(--btn); cursor: pointer; transition: background-color .15s ease-out, color .15s ease-out, scale .15s ease-out; }
.btn:hover { background: var(--panel); border-color: var(--panel); }
.btn:active { scale: .96; }
.btn.line { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.line:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.link-arrow { font: 400 13px/1.2 var(--font-display); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; color: var(--ink); display: inline-flex; gap: var(--s2); align-items: center; min-height: 44px; }
.link-arrow span { transition: translate .2s ease-out; }
.link-arrow:hover span { translate: 4px 0; }
.link-arrow:hover { color: var(--accent); }

/* Navbar: transparent over the hero, solid with a hairline after scrolling */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--nav-h); --logo-w: calc(40px * 74 / 34); }
.nav .wrap { display: flex; align-items: center; gap: var(--s6); height: 100%; }
/* Turning solid is one move, all transform and opacity: the bar slides down from the top edge, the links glide right
   to make room, and the logo fades in from the left into the space they left. Going back up, it all reverses a little faster. */
.nav::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--bg); box-shadow: 0 1px 0 var(--line); translate: 0 -100%; transition: translate .25s ease-in; }
.nav.solid::before, .nav.flat::before, .nav.open::before { translate: 0 0; transition: translate .4s var(--ease-out); }
/* At the top of the page the hero carries the big logo, so the nav logo is out of sight and the links sit where it would be, in line with the headline */
.nav-logo { display: flex; align-items: center; min-height: 44px; opacity: 0; visibility: hidden; translate: -12px 0; transition: opacity .2s ease-in, translate .25s ease-in, visibility 0s .25s; }
.nav-logo img { height: 40px; width: auto; }
.nav-links { margin-inline-end: auto; translate: calc(-1 * (var(--logo-w) + var(--s6))) 0; transition: translate .3s ease-in; }
.nav.solid .nav-logo, .nav.flat .nav-logo { opacity: 1; visibility: visible; translate: 0 0; transition: opacity .35s ease-out .12s, translate .5s var(--ease-out) .12s; }
.nav.solid .nav-links, .nav.flat .nav-links { translate: 0 0; transition: translate .5s var(--ease-out) .05s; }
.nav.flat::before, .nav.flat .nav-logo, .nav.flat .nav-links { transition: none; }
/* the Contact button, like the logo, appears once the hero (which has its own Contact us) scrolls away */
.nav .wrap > .btn { opacity: 0; visibility: hidden; transition: opacity .2s ease-out, visibility 0s .2s, background-color .15s ease-out, color .15s ease-out; }
.nav.solid .wrap > .btn, .nav.flat .wrap > .btn { opacity: 1; visibility: visible; transition: opacity .2s ease-out, background-color .15s ease-out, color .15s ease-out; }
.nav-links { display: flex; gap: var(--s6); font: 400 13px/1.2 var(--font-display); letter-spacing: .14em; text-transform: uppercase; }
.nav-links a { position: relative; text-decoration: none; padding-block: var(--s3); color: var(--muted); transition: color .15s ease-out; }
.nav-links a:hover, .nav-links a.on { color: var(--ink); }
/* Glide: one hairline marks the section you are in and glides to whichever link the pointer rests on, then back.
   It is anchored to the current link (anchor positioning); without that support each link draws its own rule instead. */
.nav-links { position: relative; }
.nav-links a.on, .nav-links:has(a:hover) a:hover { anchor-name: --nav-cur; }
.nav-links:has(a:hover) a.on:not(:hover) { anchor-name: none; }
.nav-glide { position: absolute; position-anchor: --nav-cur; left: anchor(left, 0); width: anchor-size(width, 0); top: calc(anchor(bottom, 0) - 4px); height: 1px; background: var(--ink); pointer-events: none;
  transition: left .32s var(--ease-out), width .32s var(--ease-out), opacity .2s ease-out; }
.nav-links:not(:has(a.on, a:hover)) .nav-glide { opacity: 0; transition: opacity .2s ease-out; }
@supports not (anchor-name: --a) {
  .nav-glide { display: none; }
  .nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px; background: var(--ink); transform-origin: left; scale: 0 1; transition: scale .25s var(--ease-out); }
  .nav-links a.on::after { scale: 1 1; }
}
.nav-menu { display: none; }
@media (max-width: 820px) {
  :root { --nav-h: 68px; }
  .nav-links, .nav .btn { display: none; }
  .nav-menu { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0; background: none; border: 0; font: 400 13px/1.2 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); cursor: pointer; }
  .nav-logo img { height: 34px; }
  /* The icon: two equal lines that turn straight into a cross when the menu opens, and back when it closes */
  .nav-menu i { position: relative; width: 20px; height: 12px; }
  /* no box around the button: keyboard focus underlines the label instead */
  .nav-menu:focus-visible { outline: none; }
  .nav-menu:focus-visible [data-menu-label] { text-decoration: underline; text-underline-offset: 4px; }
  .nav-menu i::before, .nav-menu i::after { content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: translate .3s var(--ease-out), rotate .3s var(--ease-out); }
  .nav-menu i::before { top: 2.75px; }
  .nav-menu i::after { top: 7.75px; }
  .nav.open .nav-menu i::before { translate: 0 2.5px; rotate: 45deg; }
  .nav.open .nav-menu i::after { translate: 0 -2.5px; rotate: -45deg; }
  .nav-logo { display: flex; margin-inline-end: auto; opacity: 1; visibility: visible; translate: none; transition: none; }
  /* The menu is a full-height sheet on bg under the bar: the page behind is covered and stops scrolling,
     the four links sit large on hairlines, and the address and social links wait at the foot */
  .nav-panel { position: fixed; inset: var(--nav-h) 0 0; overflow-y: auto; overscroll-behavior: contain; background: var(--bg);
    padding: var(--s3) var(--gutter) calc(var(--s6) + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
  .nav-panel[hidden] { display: none; }
  .nav-panel > a { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); min-height: 72px; border-bottom: 1px solid var(--line);
    font: 300 32px/1.15 var(--font-display); letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
  .nav-panel > a::after { content: "→"; font: 400 18px/1 var(--font-display); color: var(--muted); transition: translate .2s ease-out, color .2s ease-out; }
  .nav-panel > a:hover::after, .nav-panel > a:focus-visible::after { translate: 4px 0; color: var(--ink); }
  .nav-panel-foot { margin-top: auto; padding-top: var(--s7); display: grid; gap: var(--s3); font-size: 14px; line-height: 1.5; color: var(--muted); }
  .nav-panel-foot a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--line); display: inline-flex; align-items: center; min-height: 44px; }
  .nav-panel-foot .nav-panel-mail { font: 400 20px/1.3 var(--font-display); }
  .nav-panel-foot span { display: flex; gap: var(--s5); }
  .menu-open, .menu-open body { overflow: hidden; }
  .nav.open .nav-menu { color: var(--ink); }
  /* the sheet fades in whole (nothing shows through it for long), the rows rise 8px in turn; it leaves faster than it came */
  .nav-panel { opacity: 0; transition: opacity .15s ease-in; }
  .nav-panel > a, .nav-panel-foot { opacity: 0; translate: 0 8px; transition: opacity .15s ease-in, translate .15s ease-in; }
  .nav-panel.shown { opacity: 1; transition: opacity .2s ease-out; }
  .nav-panel.shown > a, .nav-panel.shown .nav-panel-foot { opacity: 1; translate: 0 0; transition: opacity .35s var(--ease-out), translate .4s var(--ease-out); }
  .nav-panel.shown > a:nth-child(1) { transition-delay: 60ms; }
  .nav-panel.shown > a:nth-child(2) { transition-delay: 100ms; }
  .nav-panel.shown > a:nth-child(3) { transition-delay: 140ms; }
  .nav-panel.shown > a:nth-child(4) { transition-delay: 180ms; }
  .nav-panel.shown .nav-panel-foot { transition-delay: 260ms; }
  .still .nav-panel > a, .still .nav-panel-foot { translate: none; }
}
@media (min-width: 821px) { .nav-panel { display: none; } }

/* Animated Content (React Bits, adapted): fade + 16px rise when 15% visible; staggered within [data-stagger] */
.js .rv { opacity: 0; translate: 0 16px; transition: opacity .7s var(--ease-out), translate .7s var(--ease-out); transition-delay: calc(var(--d, 0) * 80ms); }
.js .rv.in { opacity: 1; translate: 0 0; }
/* modifiers: .fade only fades; .focus comes into focus from blur(10px) and 1.02 scale, like the hero headline */
.js .rv.fade { translate: none; }
.js .rv.focus { translate: none; filter: blur(10px); scale: 1.02; transition: opacity 1.1s var(--ease-out), filter 1.1s var(--ease-out), scale 1.1s var(--ease-out); }
.js .rv.focus.in { filter: blur(0); scale: 1; }

/* Blur Text (React Bits, adapted): words come into focus */
.js .bt-w { display: inline-block; opacity: 0; filter: blur(8px); translate: 0 12px; transition: opacity .7s var(--ease-out), filter .7s var(--ease-out), translate .7s var(--ease-out); transition-delay: calc(var(--i) * 70ms + 150ms); }
.js .bt.in .bt-w { opacity: 1; filter: blur(0); translate: 0 0; }

/* Scroll Reveal (React Bits, adapted): word opacity follows scroll */
.sr-w { opacity: var(--o, 1); transition: opacity .12s linear; }

/* Static / reduced motion: final state, nothing moves */
.still .rv, .still .bt-w { opacity: 1 !important; translate: none !important; scale: none !important; filter: none !important; transition: none !important; }
.still .sr-w { opacity: 1 !important; }
/* Reduced motion: no loops and nothing travels, but fades and colour changes that report a state stay */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; }
  .btn:active { scale: none; }
  .link-arrow:hover span { translate: none; }
  .nav-glide { transition: opacity .2s ease-out; }
  .nav::before { translate: none; opacity: 0; transition: opacity .2s ease-out; }
  .nav.solid::before, .nav.flat::before, .nav.open::before { opacity: 1; transition: opacity .2s ease-out; }
  .nav-logo, .nav.solid .nav-logo { translate: none; }
  .nav-links, .nav.solid .nav-links { transition: none; }
}
