
/* ---------- Tokens ---------- */
:root,
:root[data-theme="dark"] {
  --bg: #04060D;
  --band: #070B16;
  --surface: #0B1120;
  --surface-2: #101829;
  --line: rgba(226, 234, 250, .12);
  --line-strong: rgba(226, 234, 250, .24);
  --fg: #F3F7FF;
  --body: #D3DBEA;          /* 14.6 : 1 on --bg */
  --muted: #9AA6BC;         /* 8.3 : 1 on --bg, 7.7 : 1 on --surface */
  --accent: #38BDF8;        /* cyan — 9.5 : 1 on --bg */
  --accent-soft: rgba(56, 189, 248, .10);
  --accent-line: rgba(56, 189, 248, .55);
  --link: #38BDF8;
  --return: #9AA6BC;        /* the second route line */
  --red: #E42C24;           /* SFI red — graphics, the maple leaf, rules */
  --action: #D0261F;        /* buttons — 5.3 : 1 with white text (#E42C24 is 4.48 : 1) */
  --action-hover: #B8221B;
  --on-action: #FFFFFF;
  --dot: rgba(226, 234, 250, .09);
  --header-bg: rgba(4, 6, 13, .86);
  --footer-bg: #02040A;
  --cta-bg: #0A1426;
  --cta-fg: #F3F7FF;
  --cta-body: #D3DBEA;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset;
  --card-hover: rgba(56, 189, 248, .45);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #FFFFFF;
  --band: #F3F6FA;
  --surface: #FFFFFF;
  --surface-2: #F3F6FA;
  --line: #DCE3EC;
  --line-strong: #B9C6D6;
  --fg: #0B1B33;            /* 17.2 : 1 on white */
  --body: #2B3B53;          /* 11.3 : 1 */
  --muted: #56657C;         /* 5.9 : 1 on white, 5.5 : 1 on --band */
  --accent: #0053A0;        /* SFI blue — 7.65 : 1 on white */
  --accent-soft: rgba(0, 83, 160, .07);
  --accent-line: rgba(0, 83, 160, .5);
  --link: #0053A0;
  --return: #E42C24;
  --red: #E42C24;
  --action: #D0261F;
  --action-hover: #B8221B;
  --on-action: #FFFFFF;
  --dot: rgba(0, 83, 160, .12);
  --header-bg: rgba(255, 255, 255, .9);
  --footer-bg: #F3F6FA;
  --cta-bg: #0053A0;
  --cta-fg: #FFFFFF;
  --cta-body: #E8F0F9;      /* 6.6 : 1 on the blue */
  --shadow: 0 1px 2px rgba(11, 27, 51, .05), 0 8px 24px -12px rgba(11, 27, 51, .12);
  --card-hover: rgba(0, 83, 160, .45);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 18px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  transition: background-color .25s ease, color .25s ease;
}
@media (min-width: 1024px) { body { font-size: 19px; } }

h1, h2, h3 { color: var(--fg); font-weight: 600; letter-spacing: -.02em; line-height: 1.12; margin: 0; }
h1 { font-size: clamp(2.15rem, 1.4rem + 3vw, 3.5rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.7rem, 1.25rem + 1.6vw, 2.4rem); }
h3 { font-size: 1.18rem; letter-spacing: -.01em; line-height: 1.3; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
ul { margin: 0; padding: 0; }
b, strong { color: var(--fg); font-weight: 600; }

.mono {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
@media (min-width: 720px) { .wrap { width: min(1200px, 100% - 64px); } }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 8px 14px; background: var(--surface); color: var(--fg); }
.skip:focus { left: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  min-height: 48px; padding: .7em 1.35em;
  border-radius: 999px; border: 1px solid transparent;
  font: 600 1rem/1.2 'Space Grotesk', system-ui, sans-serif;
  letter-spacing: -.005em; text-decoration: none; cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.btn svg { width: 18px; height: 18px; flex: none; transition: transform .2s ease; }
.btn:hover svg { transform: translateX(3px); }
.btn-action { background: var(--action); color: var(--on-action); }
.btn-action:hover { background: var(--action-hover); }
.btn-line { border-color: var(--line-strong); color: var(--fg); background: transparent; }
.btn-line:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Header ---------- */
.topbar { border-bottom: 1px solid var(--line); font-size: .9rem; }
.topbar .wrap { display: flex; justify-content: flex-end; align-items: center; gap: 22px; min-height: 40px; }
.topbar a { color: var(--muted); text-decoration: none; }
.topbar a:hover { color: var(--fg); }
.topbar .talk {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px; background: var(--action); color: #fff; font-weight: 600;
}
.topbar .talk:hover { background: var(--action-hover); color: #fff; }
.topbar .talk svg { width: 12px; height: 12px; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(140%) blur(12px); backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 24px; }
.logo { display: block; width: 188px; flex: none; }
.logo img { display: block; width: 100%; height: auto; }
.logo .on-light { display: none; }
:root[data-theme="light"] .logo .on-dark { display: none; }
:root[data-theme="light"] .logo .on-light { display: block; }

.nav { display: flex; align-items: center; }
.nav > ul { display: flex; list-style: none; gap: 4px; }
.nav li { position: relative; list-style: none; }
.nav .top {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 10px 12px; border-radius: 8px; border: 0; background: none; cursor: pointer;
  color: var(--fg); font: 500 .95rem/1.4 'Space Grotesk', system-ui, sans-serif; text-decoration: none; white-space: nowrap;
}
.nav .top svg { width: 14px; height: 14px; opacity: .6; transition: transform .2s ease; }
.nav .top:hover, .nav li:focus-within > .top { background: var(--accent-soft); }
.nav .current > .top { color: var(--accent); }
.nav .current > .top::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--accent);
}
.nav .sub {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px;
  padding: 8px; border-radius: 12px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .45);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}
.nav > ul > li:nth-last-child(-n+3) > .sub { left: auto; right: 0; }
.nav li:hover > .sub, .nav li:focus-within > .sub {
  opacity: 1; visibility: visible; transform: none; transition: opacity .16s ease, transform .16s ease;
}
.nav li:hover > .top svg, .nav li:focus-within > .top svg { transform: rotate(180deg); }
.nav .sub a {
  display: block; padding: 9px 12px; border-radius: 8px;
  color: var(--body); font-size: .93rem; line-height: 1.35; text-decoration: none;
}
.nav .sub a:hover { background: var(--accent-soft); color: var(--fg); }
.menu-btn {
  display: none; width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--fg); cursor: pointer;
}
.menu-btn svg { width: 20px; height: 20px; }

@media (max-width: 1080px) {
  .menu-btn { display: inline-grid; place-items: center; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    max-height: calc(100vh - 72px); overflow: auto;
    background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.open { display: block; }
  .nav > ul { flex-direction: column; gap: 0; padding: 8px 16px 20px; }
  .nav .top { padding: 14px 4px; font-size: 1.05rem; width: 100%; }
  .nav .top svg { display: none; }
  .nav .current > .top::after { display: none; }
  .nav .sub {
    position: static; opacity: 1; visibility: visible; transform: none; min-width: 0;
    padding: 0 0 10px 12px; border: 0; border-left: 1px solid var(--line); border-radius: 0;
    background: none; box-shadow: none; margin-left: 4px;
  }
  .nav .sub a { padding: 7px 10px; }
}
@media (max-width: 560px) {
  .topbar .wrap { justify-content: space-between; gap: 12px; }
  .logo { width: 150px; }
}

/* ---------- Breadcrumbs ---------- */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; color: var(--muted); }
.crumbs li { display: inline-flex; align-items: center; gap: 8px; }
.crumbs li + li::before { content: "/"; opacity: .5; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--fg); }
.crumbs [aria-current] { color: var(--accent); }

/* ---------- Sections ---------- */
.section { padding-block: clamp(64px, 5vw + 40px, 112px); position: relative; }
.section.band { background: var(--band); }
.section + .section:not(.band):not(.flush) { border-top: 1px solid var(--line); }
.idx { display: flex; align-items: center; gap: 14px; color: var(--muted); margin-bottom: 22px; }
.idx::after { content: ""; height: 1px; flex: 0 1 72px; background: var(--accent-line); }
.lede { font-size: 1.12em; color: var(--fg); }
.measure { max-width: 680px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); border-top: 1px solid var(--line); padding: 64px 0 28px; font-size: .95rem; }
.offices { display: grid; gap: 40px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.office .name { font-weight: 600; letter-spacing: .02em; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.office .name a { color: var(--fg); text-decoration: none; }
.office .name a:hover { color: var(--accent); }
.office .name img { width: 28px; height: 16px; border-radius: 2px; flex: none; }
.office p { margin: 0 0 10px; color: var(--body); }
.office .row { display: flex; gap: 10px; align-items: baseline; }
.office .row svg { width: 15px; height: 15px; color: var(--red); flex: none; transform: translateY(2px); }
.office .hours { color: var(--muted); }
.office .hours span { color: var(--fg); display: block; }
.legal {
  margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--muted);
}
.legal a { color: var(--muted); }
.legal p { margin: 0; }

/* ---------- Motion — one animation per section, once, short, none for reduced motion ---------- */
.js:not(.reduce) [data-reveal="fade"] { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js:not(.reduce) [data-reveal="fade"].in { opacity: 1; transform: none; }
.js:not(.reduce) [data-reveal="stagger"] > * { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 80ms); }
.js:not(.reduce) [data-reveal="stagger"].in > * { opacity: 1; transform: none; }
.js:not(.reduce) [data-reveal="draw"] .draw { transition: stroke-dashoffset 1.5s cubic-bezier(.45, .05, .25, 1); transition-delay: calc(var(--d, 0) * 1ms); }
.js:not(.reduce) [data-reveal="draw"] .after { opacity: 0; transform: scale(.6); transform-box: fill-box; transform-origin: center; transition: opacity .4s ease, transform .4s cubic-bezier(.2, .9, .3, 1.4); transition-delay: calc(var(--d, 0) * 1ms); }
.js:not(.reduce) [data-reveal="draw"].in .after { opacity: 1; transform: none; }

/* ---------- Mock-up switch (not part of the page) ---------- */
.mockbar {
  position: fixed; right: 16px; bottom: 16px; z-index: 90;
  display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px;
  border-radius: 999px; background: #111827; color: #E5E7EB;
  border: 1px solid rgba(255, 255, 255, .16); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
  font: 500 12px/1 'IBM Plex Mono', ui-monospace, monospace; letter-spacing: .06em;
}
.mockbar span { padding-right: 6px; opacity: .7; text-transform: uppercase; }
.mockbar button {
  border: 0; border-radius: 999px; padding: 8px 12px; cursor: pointer;
  background: transparent; color: #E5E7EB; font: inherit; text-transform: uppercase;
}
.mockbar button[aria-pressed="true"] { background: #F9FAFB; color: #111827; }
@media print { .mockbar { display: none; } }
