/* Shared polish for every page, loaded after each page's own <style>:
   page-to-page transitions, smoother scrolling and hovers, the cyan Contact
   button in the nav, and the closing call-to-action band. Colours are literal
   because the static pages and the React pages name their tokens differently. */

/* ─── Page-to-page transitions ───
   Chrome, Edge and Safari 18+ cross-fade between pages; other browsers simply
   navigate as before. Whole-page fade only: the React pages build their nav
   after first paint, so a separately named nav would have nothing to match. */
@view-transition { navigation: auto; }
/* The plain-text search copy inside #root is replaced by React within a moment;
   hold it back briefly so visitors never see it flash during the fade. Crawlers
   read the HTML, and no-JS visitors still get it after 1.2s. */
#root > .seo-fallback { animation: seo-hold 0s 1.2s backwards; }
@keyframes seo-hold { from { visibility: hidden; } }
::view-transition-old(root) { animation: 160ms ease-out both pt-out; }
::view-transition-new(root) { animation: 240ms ease-out both pt-in; }
@keyframes pt-out { to { opacity: 0; } }
@keyframes pt-in { from { opacity: 0; } }

html { scroll-behavior: smooth; scrollbar-gutter: stable; }

/* ─── Nav ─── */
.nav { transition: background-color .35s ease, box-shadow .35s ease, border-color .35s ease; }
html[data-scrolled] .nav {
  background: rgba(8, 15, 36, 0.92) !important;
  box-shadow: 0 12px 30px -20px rgba(0, 0, 0, 0.9);
}
.nav-wm { white-space: nowrap; }
.nav-links a {
  white-space: nowrap;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.nav .nav-links a.nav-cta {
  margin-left: 10px; padding: 8px 18px;
  background: #5AB7D8; color: #0B1733; border: 1px solid #5AB7D8; border-radius: 999px;
  font-weight: 600;
}
.nav .nav-links a.nav-cta:hover,
.nav .nav-links a.nav-cta.on { background: #7DCDE8; border-color: #7DCDE8; color: #0B1733; }
/* Six links + the button fit on one line down to tablet width */
@media (max-width: 1100px) {
  .nav { padding-left: 24px; padding-right: 24px; }
  .nav-links { gap: 4px; }
  .nav-tag { display: none; }
  .nav .nav-links a { padding: 7px 10px; font-size: 9px; letter-spacing: 0.14em; }
  .nav .nav-links a.nav-cta { padding: 7px 14px; margin-left: 6px; }
}
.nav-mobile-menu a { transition: color .2s ease, background-color .2s ease, padding-left .25s cubic-bezier(.2, .7, .2, 1); }
.nav-mobile-menu a:hover { padding-left: 30px; }

/* ─── Hovers ─── */
.btn-primary, .btn-ghost, .cf-submit, .cta-band-btn { transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .3s ease; }
.btn-primary:hover, .cf-submit:hover, .cta-band-btn.primary:hover { box-shadow: 0 10px 26px -14px rgba(90, 183, 216, 0.75); }
/* The React cards already lift via GSAP; add only a soft glow so the two don't fight */
.service-card, .practice-card, .value-card, .candidate-card, .diff-card { transition: border-color .3s ease, box-shadow .4s ease; }
.service-card:hover, .practice-card:hover, .value-card:hover, .candidate-card:hover, .diff-card:hover {
  box-shadow: 0 22px 44px -28px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(90, 183, 216, 0.22);
}
.post-card { transition: transform .35s cubic-bezier(.2, .7, .2, 1), border-color .25s ease, background-color .25s ease, box-shadow .35s ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -28px rgba(0, 0, 0, 0.95); }
.sc-cta .arr, .btn-primary .arr, .cta-band-btn .arr { display: inline-block; transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.sc-cta:hover .arr, .service-card:hover .sc-cta .arr, .btn-primary:hover .arr, .cta-band-btn:hover .arr { transform: translateX(4px); }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #5AB7D8; outline-offset: 3px;
}

/* ─── Gentle rise-in as blocks scroll into view (CSS only, where supported).
   "backwards" fill hands the element back once it has arrived, so hovers work. */
@supports (animation-timeline: view()) {
  .post-card, .cta-band-inner, .post h2, .jb-notes {
    animation: pr-rise linear backwards;
    animation-timeline: view();
    animation-range: entry 0% entry 35%;
  }
}
@keyframes pr-rise { from { opacity: 0; transform: translateY(22px); } }

/* Candidates page: "See live jobs" right under the intro */
.candidates-top-cta { margin: 32px 0 8px; }

/* ─── Contact page on phones: the form comes straight after the heading ─── */
@media (max-width: 900px) {
  .engage-figure { display: none; }
}

/* ─── Closing call-to-action band ─── */
.cta-band {
  position: relative; overflow: hidden;
  background: #0F1C3F; border-top: 1px solid rgba(242, 244, 248, 0.08);
}
.cta-band::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 50% 90% at 88% 50%, rgba(90, 183, 216, 0.14), transparent 65%),
    linear-gradient(rgba(90, 183, 216, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 183, 216, 0.04) 1px, transparent 1px);
  background-size: auto, 64px 64px, 64px 64px;
}
.cta-band-inner {
  position: relative; max-width: 1320px; margin: 0 auto; padding: 80px 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 48px; flex-wrap: wrap;
}
.cta-band-eyebrow {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.28em;
  text-transform: uppercase; color: #5AB7D8;
}
.cta-band-eyebrow::before { content: ''; width: 24px; height: 1px; background: #5AB7D8; }
.cta-band-h {
  font-family: 'Fraunces', Georgia, serif; font-weight: 300;
  font-size: clamp(34px, 4.2vw, 56px); line-height: 1.05; letter-spacing: -0.03em;
  color: #F2F4F8; margin: 16px 0 14px;
}
.cta-band-p {
  font-family: 'Sora', system-ui, sans-serif; font-size: 16px; line-height: 1.65;
  color: rgba(242, 244, 248, 0.68); margin: 0; max-width: 560px;
}
.cta-band-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.cta-band-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 16px 26px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; text-decoration: none; border: 1px solid transparent;
}
.cta-band-btn.primary { background: #5AB7D8; color: #0B1733; }
.cta-band-btn.primary:hover { background: #7DCDE8; }
.cta-band-btn.ghost { color: #F2F4F8; border-color: rgba(242, 244, 248, 0.22); }
.cta-band-btn.ghost:hover { border-color: #5AB7D8; color: #5AB7D8; }
@media (max-width: 720px) {
  .cta-band-inner { padding: 56px 24px; gap: 28px; }
}

/* ─── Readability ───
   Faint grey text was 3.8:1 contrast (minimum is 4.5:1): lift it to about 6:1.
   Labels and footer lines under 11px get an 11px floor. */
:root, .site, .site[data-mood] { --faint: rgba(242, 244, 248, 0.6); }
.bp-logo-tag, .bp-role, .cc-num, .cf-lab, .diff-eyebrow, .dl-lead, .foot-h, .foot-tag, .foot-tag-line,
.hf-counter, .pc-role-chip, .pc-sub, .referral-eyebrow, .sc-cta, .sc-tag, .track-tag, .vc-num,
.bt-link span, .foot-social span, .legal-body th, .cform p, .cform label[for="sms-consent"] { font-size: 11px !important; }
.foot-bottom, .foot-rule, .foot-rule span { font-size: 11px !important; color: rgba(242, 244, 248, 0.6) !important; letter-spacing: 0.1em !important; }
.nav-tag { font-size: 11px !important; letter-spacing: 0.1em !important; color: rgba(242, 244, 248, 0.62) !important; }
.nav .nav-links a { font-size: 11px; letter-spacing: 0.14em; }
@media (max-width: 1100px) {
  .nav .nav-links a, .nav .nav-links a.nav-cta { font-size: 10.5px; letter-spacing: 0.05em; }
}

/* Hero stat source line */
.hf-src { margin-top: 12px; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.06em; line-height: 1.5; color: rgba(242, 244, 248, 0.6); }

/* ─── Skip link: first Tab on any page jumps past the menu ─── */
.skip-link {
  position: absolute; left: 16px; top: -64px; z-index: 100; padding: 10px 18px;
  background: #5AB7D8; color: #0B1733; font: 600 14px 'Sora', system-ui, sans-serif;
  border-radius: 999px; text-decoration: none; transition: top .2s ease;
}
.skip-link:focus { top: 12px; }
#content:focus { outline: none; }

/* ─── Respect reduced-motion settings ─── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .post-card, .cta-band-inner, .post h2, .jb-notes { animation: none !important; }
  .post-card:hover { transform: none; }
}

/* Footer rule: the copyright line wraps instead of running off narrower screens */
.foot-rule, .foot-rule span { white-space: normal !important; }
@media (max-width: 760px) {
  .foot-rule { flex-direction: column; align-items: flex-start; }
}

/* ─── Smooth wheel scrolling (Lenis, started in polish.js; touch stays native) ─── */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto !important; }
html.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
html.lenis-stopped { overflow: hidden; }
html.lenis-scrolling iframe { pointer-events: none; }

/* ─── Rounded cards and pill buttons, matching the job board ─── */
.service-card, .practice-card, .value-card, .candidate-card, .diff-card, .form-card, .referral { border-radius: 14px; }
.practice-grid, .candidate-grid, .values-grid { gap: 20px; background: none !important; border: 0 !important; }
.practice-card, .candidate-card, .value-card { border: 1px solid rgba(242, 244, 248, 0.08); }
.btn-primary, .btn-ghost, .cta-band-btn, .referral-cta, .cf-submit, .sc-tag { border-radius: 999px; }
.sc-tag { padding: 6px 12px; }
.form-tabs { border-radius: 13px 13px 0 0; overflow: hidden; } /* tab bar follows the card corners */
.form-tabs .ft-tab:focus-visible { outline-offset: -3px; } /* keep the focus ring inside the rounded bar */
/* Soft cyan light in the corner of each card, brighter on hover */
.site:not([data-mood="paper"]) .service-card,
.site:not([data-mood="paper"]) .practice-card,
.site:not([data-mood="paper"]) .value-card,
.site:not([data-mood="paper"]) .candidate-card {
  background-image: radial-gradient(90% 70% at 100% 0%, rgba(90, 183, 216, 0.09), transparent 60%);
}
.site:not([data-mood="paper"]) .service-card:hover,
.site:not([data-mood="paper"]) .practice-card:hover,
.site:not([data-mood="paper"]) .value-card:hover,
.site:not([data-mood="paper"]) .candidate-card:hover {
  background-image: radial-gradient(90% 70% at 100% 0%, rgba(90, 183, 216, 0.17), transparent 60%);
}

/* ─── Text beside a photo at the top of a section ─── */
.split-head { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: center; margin: 0 0 64px; }
.split-head .section-label { margin-bottom: 32px; }
.split-head .practice-intro, .split-head .candidates-intro { margin: 0; max-width: none; }
.split-head .candidates-top-cta { margin: 28px 0 0; }
.photo-frame {
  position: relative; margin: 0; overflow: hidden; isolation: isolate;
  border-radius: 18px; border: 1px solid rgba(242, 244, 248, 0.10); background: #0F1C3F;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9);
}
.photo-frame img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.85) contrast(1.04) brightness(0.9); transform: scale(1.12);
}
.photo-frame::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(11, 23, 51, 0) 50%, rgba(11, 23, 51, 0.6) 100%),
    radial-gradient(ellipse 70% 55% at 100% 0%, rgba(90, 183, 216, 0.2), transparent 70%);
}
@media (max-width: 900px) {
  .split-head { grid-template-columns: 1fr; gap: 36px; margin-bottom: 48px; }
}

/* ─── Room above each homepage heading that follows a row of cards ─── */
.services-grid + .section-label, .insight-all + .section-label { margin-top: 120px; }
@media (max-width: 900px) {
  .services-grid + .section-label, .insight-all + .section-label { margin-top: 88px; }
}

/* Contact: the photo under the heading keeps its rounded frame, not the old fade-out mask */
.engage-figure { margin-top: 36px; }
.engage-figure .photo-frame img { -webkit-mask-image: none; mask-image: none; }

/* ─── Homepage hero: moving network (network.js), strongest on the right,
   fading out behind the headline ─── */
.hero-net {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 70% 85% at 80% 40%, #000 25%, transparent 80%);
          mask-image: radial-gradient(ellipse 70% 85% at 80% 40%, #000 25%, transparent 80%);
}

/* ─── Animated line icons (icons.js) ─── */
.ai-icon { display: inline-flex; width: 52px; height: 52px; flex: 0 0 auto; }
.ai-icon svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ai-icon .b { stroke: #F2F4F8; }
.ai-icon .a { stroke: #5AB7D8; }
.ai-icon .f { fill: #5AB7D8; stroke: none; transform-box: fill-box; transform-origin: center; }
/* Draw in: hidden until the icon scrolls into view ("html" lifts the drawn
   state above the hidden one) */
html.ic-anim .ai-icon svg { opacity: 0; }
html .ai-icon.is-drawn svg { opacity: 1; transition: opacity .15s ease; }
html.ic-anim .ai-icon .b, html.ic-anim .ai-icon .a { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
html.ic-anim .ai-icon .f { opacity: 0; transform: scale(0.3); }
html .ai-icon.is-drawn .b { stroke-dashoffset: 0; transition: stroke-dashoffset .9s cubic-bezier(.65, 0, .35, 1); }
html .ai-icon.is-drawn .a { stroke-dashoffset: 0; transition: stroke-dashoffset .8s cubic-bezier(.65, 0, .35, 1) .35s; }
html .ai-icon.is-drawn .f { opacity: 1; transform: none; transition: opacity .3s ease .8s, transform .5s cubic-bezier(.34, 1.56, .64, 1) .8s; }
/* The infinity loop carries a short cyan dash that travels round it */
html.ic-anim .ai-icon .a.trace, .ai-icon .a.trace { stroke-dasharray: .16 .84; stroke-dashoffset: 0; }
html.ic-anim .ai-icon .a.trace { opacity: 0; }
html .ai-icon.is-drawn .a.trace { opacity: 1; transition: opacity .4s ease .9s; }
/* The move each icon makes once drawn, and again on hover */
.ai-icon[data-m="shackle"].is-playing .mv { animation: ic-shackle .9s cubic-bezier(.3, .7, .3, 1); }
.ai-icon[data-m="spin"].is-playing .mv { animation: ic-spin 1.4s cubic-bezier(.5, 0, .2, 1); }
.ai-icon[data-m="swing"].is-playing .mv { animation: ic-swing 1.5s ease-in-out; }
.ai-icon[data-m="tilt"].is-playing .mv { animation: ic-tilt 1.4s ease-in-out; }
.ai-icon[data-m="ring"].is-playing .mv { animation: ic-ring .8s ease-in-out; }
.ai-icon[data-m="scan"].is-playing .mv { animation: ic-scan 1.3s ease-in-out; }
.ai-icon[data-m="thud"].is-playing .mv { animation: ic-thud .8s cubic-bezier(.3, .7, .3, 1); }
.ai-icon[data-m="redraw"].is-playing .mv .a { animation: ic-redraw .9s cubic-bezier(.65, 0, .35, 1); }
.ai-icon[data-m="pulse"].is-playing .mv { animation: ic-core 1s ease-in-out; }
.ai-icon[data-m="twinkle"].is-playing .f, .ai-icon[data-m="pulse"].is-playing .f { animation: ic-pop .7s ease-in-out; }
.ai-icon[data-m="dots"].is-playing .f { animation: ic-hop .6s ease-in-out; }
.ai-icon[data-m="gather"].is-playing .ml { animation: ic-gl 1s ease-in-out; }
.ai-icon[data-m="gather"].is-playing .mr { animation: ic-gr 1s ease-in-out; }
.ai-icon[data-m="trace"].is-playing .a.trace { animation: ic-trace 1.8s cubic-bezier(.45, 0, .55, 1); }
.ai-icon.is-playing .f + .f { animation-delay: .12s; }
.ai-icon.is-playing .f + .f + .f { animation-delay: .24s; }
.ai-icon.is-playing .f + .f + .f + .f { animation-delay: .36s; }
@keyframes ic-shackle { 0%, 100% { transform: none; } 35% { transform: translateY(-3.5px); } 65% { transform: translateY(.8px); } }
@keyframes ic-spin { to { transform: rotate(360deg); } }
@keyframes ic-swing { 0%, 100% { transform: none; } 25% { transform: rotate(50deg); } 50% { transform: rotate(-28deg); } 75% { transform: rotate(12deg); } }
@keyframes ic-tilt { 0%, 100% { transform: none; } 25% { transform: rotate(-9deg); } 55% { transform: rotate(6deg); } 80% { transform: rotate(-2deg); } }
@keyframes ic-ring { 0%, 100% { transform: none; } 15%, 45%, 75% { transform: rotate(-11deg); } 30%, 60% { transform: rotate(11deg); } }
@keyframes ic-scan { 0%, 100% { transform: none; } 30% { transform: translate(-3px, -2px) rotate(-6deg); } 65% { transform: translate(3px, 1px) rotate(5deg); } }
@keyframes ic-thud { 0% { transform: translate(7px, -7px); opacity: 0; } 40% { transform: translate(-1px, 1px); opacity: 1; } 70% { transform: translate(.5px, -.5px); } 100% { transform: none; } }
@keyframes ic-redraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes ic-core { 0%, 100% { transform: none; } 45% { transform: scale(1.2); } }
@keyframes ic-pop { 0%, 100% { transform: none; } 45% { transform: scale(1.6); } }
@keyframes ic-hop { 0%, 100% { transform: none; } 40% { transform: translateY(-3px); } }
@keyframes ic-gl { 0%, 100% { transform: none; } 40% { transform: translateX(-3.5px); } }
@keyframes ic-gr { 0%, 100% { transform: none; } 40% { transform: translateX(3.5px); } }
@keyframes ic-trace { to { stroke-dashoffset: -1; } }
