/* Aimlink | Start page "Built for": three lanes, not three cards (styles for assets/home-builtfor.js).
   The idea is the site's own movement language (DESIGNDIRECTION 0.1, point 6): scroll AIMS, a threshold FIRES, the result LANDS.
     aim      each lane opens like an iris as it scrolls in, and a lime reticle closes on the subject
     fire     one soft flash when the reticle locks
     land     the lane's name and the gain arrive in turn, once, on a short timer
   Then it is yours: the lane you aim at (pointer or keyboard) grows, the others step back, and a scope (Magic UI Lens) shows
   the photo in colour where you look. Magic UI BorderBeam rides the aimed lane's edge.
   Scroll-driven in CSS (animation-timeline: view()); browsers without it get the same sequence on a timer (class is-in from the script).
   Reduced motion: finished state, no iris, no reticle, no flash, no scope. The lanes are real links and read as one. */

/* ───────────── the section ───────────── */
.bfh-wrap { display: grid; gap: var(--gap-group); }
.bfh-head .lede { max-width: 46ch; }   /* Aimlink's own sentence (it stood under the landing's H1 until 18 Oct 2026) and "Start with what you do" share one measure */

.bfh-lanes { display: grid; gap: var(--space-4); }
.bfh-lane {
  --dim: 0.5;
  --bfh-r: 0px;
  position: relative; display: block; overflow: hidden; isolation: isolate;
  min-height: clamp(26rem, 70svh, 32rem); border-radius: var(--radius-panel);
  background: var(--color-night); color: var(--color-snow);
  clip-path: circle(150% at 50% 46%);   /* the iris: animated below, 150% is "all open" */
  -webkit-tap-highlight-color: transparent;
}
.bfh-lane:focus-visible { outline: 2px solid var(--color-lime); outline-offset: 4px; }

/* two lanes that share the place of one (defence, law enforcement; 23 Oct 2026) */
.bfh-pair { display: grid; gap: var(--space-4); }
.bfh-pair .bfh-lane { min-height: clamp(16rem, 38svh, 20rem); }
.bfh-pair .bfh-title { font-size: clamp(1.9rem, 1.4rem + 1vw, 2.5rem); }

@media (min-width: 1000px) {
  .bfh-lanes { display: flex; gap: var(--space-3); height: clamp(32rem, 76svh, 43rem); }
  .bfh-lane { flex: 1 1 0; min-width: 0; min-height: 0; transition: flex-grow 800ms var(--ease-out); }
  .bfh-lane.is-aimed { flex-grow: 1.5; }
  .bfh-pair { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: var(--space-3); transition: flex-grow 800ms var(--ease-out); }
  .bfh-pair:has(.bfh-lane.is-aimed) { flex-grow: 1.5; }
  .bfh-pair .bfh-lane { min-height: 0; }
  .bfh-pair .bfh-lane.is-aimed { flex-grow: 1.4; }
}

/* ───────────── the photo: dark and grey until you look at it ───────────── */
.bfh-media, .bfh-media picture, .bfh-media img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.bfh-media img { object-fit: cover; }
.bfh-base img { filter: grayscale(0.9) brightness(var(--dim)) contrast(1.05); transform: scale(1.07); transition: transform 1600ms var(--ease-out), filter 900ms var(--ease-out); }
.bfh-lane.is-aimed .bfh-base img { transform: scale(1); }
/* a lane stepping back while the other one is aimed */
.bfh-lanes:has(.bfh-lane.is-aimed) .bfh-lane:not(.is-aimed) .bfh-base img { filter: grayscale(1) brightness(calc(var(--dim) * 0.72)) contrast(1.05); }
/* the colour layer is visible only inside the scope (a circle of --bfh-r px at the pointer, or all of it when the lane is aimed by scroll) */
@property --bfh-r { syntax: '<length>'; inherits: true; initial-value: 0px; }
.bfh-color {
  -webkit-mask-image: radial-gradient(circle at var(--mx, 50%) var(--my, 58%), #000 calc(var(--bfh-r) - 1px), transparent var(--bfh-r));
          mask-image: radial-gradient(circle at var(--mx, 50%) var(--my, 58%), #000 calc(var(--bfh-r) - 1px), transparent var(--bfh-r));
  transition: --bfh-r 600ms var(--ease-out);
}
.bfh-lane.is-aimed { --bfh-r: 170px; }
.bfh-touch .bfh-lane.is-aimed { --bfh-r: 150vmax; --mx: 50%; --my: 60%; }
.bfh-touch .bfh-color { transition-duration: 1100ms; }
.bfh-lane::before {   /* the ground the words stand on */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgb(12 20 28 / 0.94) 0%, rgb(12 20 28 / 0.72) 30%, rgb(12 20 28 / 0.18) 62%, transparent 82%);
}

/* ───────────── the scope (Magic UI Lens): a ring with four ticks and a lime centre, the same drawing the site has always used for a sight ───────────── */
.bfh-scope, .bfh-reticle {
  position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--color-snow) 90%, transparent), 0 0 0 1px color-mix(in srgb, var(--color-night) 35%, transparent);
}
.bfh-scope::before, .bfh-reticle::before, .bfh-scope::after, .bfh-reticle::after { content: ""; position: absolute; background: color-mix(in srgb, var(--color-snow) 90%, transparent); }
.bfh-scope::before, .bfh-reticle::before {
  left: 50%; top: -9px; bottom: -9px; width: 1.5px; margin-left: -0.75px;
  -webkit-mask: linear-gradient(#000 0 9px, transparent 9px calc(100% - 9px), #000 calc(100% - 9px)); mask: linear-gradient(#000 0 9px, transparent 9px calc(100% - 9px), #000 calc(100% - 9px));
}
.bfh-scope::after, .bfh-reticle::after {
  top: 50%; left: -9px; right: -9px; height: 1.5px; margin-top: -0.75px;
  -webkit-mask: linear-gradient(90deg, #000 0 9px, transparent 9px calc(100% - 9px), #000 calc(100% - 9px)); mask: linear-gradient(90deg, #000 0 9px, transparent 9px calc(100% - 9px), #000 calc(100% - 9px));
}
.bfh-dot { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--color-lime); }
.bfh-scope { display: none; width: calc(var(--bfh-r) * 2); height: calc(var(--bfh-r) * 2); transform: translate(calc(var(--mx) - 50%), calc(var(--my) - 50%)); }
.bfh-pointer .bfh-scope { display: block; opacity: 0; transition: opacity 200ms var(--ease-out); }
.bfh-pointer .bfh-lane.is-aimed .bfh-scope { opacity: 1; }
.bfh-touch .bfh-scope { display: none !important; }
.bfh-ping { position: absolute; z-index: 3; left: 0; top: 0; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; border: 1.5px solid var(--color-lime); pointer-events: none; animation: bfh-ping 760ms var(--ease-out) both; }
@keyframes bfh-ping { from { opacity: 0.9; transform: scale(0.4); } to { opacity: 0; transform: scale(2.8); } }

/* ───────────── the words ───────────── */
.bfh-copy {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: grid; gap: var(--space-3);
  padding: clamp(1.25rem, 2.4vw, 2.25rem); padding-right: clamp(5rem, 7vw, 6.25rem); pointer-events: none;
}
.bfh-title {
 font: var(--type-display-m-weight) clamp(2.25rem, 1.4rem + 2.2vw, 3.5rem)/0.94 var(--font-display);
 letter-spacing: var(--type-display-m-tracking); text-wrap: balance;
}
.bfh-title em { font-style: italic; color: var(--color-lime); padding-right: 0.06em; }
.bfh-gain { font: var(--type-body-weight) var(--type-body-size)/1.5 var(--font-text); color: var(--color-snow); max-width: 34ch; text-wrap: pretty; }
.bfh-go {
  position: absolute; z-index: 2; right: clamp(1.25rem, 2.4vw, 2.25rem); bottom: clamp(1.25rem, 2.4vw, 2.25rem);
  display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 50%;
  border: 1px solid rgb(244 246 248 / 0.5); color: var(--color-snow); pointer-events: none;
  transition: background-color 350ms var(--ease-out), color 350ms var(--ease-out), border-color 350ms var(--ease-out), transform 500ms var(--ease-out);
}
.bfh-go svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 500ms var(--ease-out); }
.bfh-lane.is-aimed .bfh-go { background: var(--color-lime); border-color: var(--color-lime); color: var(--color-night); transform: scale(1.08); }
.bfh-lane.is-aimed .bfh-go svg { transform: translateX(3px); }

/* the aimed lane's edge: Magic UI BorderBeam (built by the script, runs only while the lane is aimed) */
.bfh-lane > .mu-fx-beam { z-index: 4; opacity: 0; transition: opacity 500ms var(--ease-out); }
.bfh-lane.is-aimed > .mu-fx-beam { opacity: 1; }
.bfh-lane:not(.is-aimed) > .mu-fx-beam .mu-fx-beam-dot { animation-play-state: paused; }

/* ───────────── aim, fire, land: the arrival ───────────── */
.bfh-reticle { display: none; top: 42%; left: 50%; width: min(10.5rem, 44%); aspect-ratio: 1; transform: translate(-50%, -50%); opacity: 0; }
.bfh-flash { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(circle at 50% 42%, rgb(244 246 248 / 0.34), transparent 62%); opacity: 0; display: none; }
@keyframes bfh-open { from { clip-path: circle(0% at 50% 46%); } to { clip-path: circle(150% at 50% 46%); } }
@keyframes bfh-lock {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(2.7); }
  40%  { opacity: 1; }
  72%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}
@keyframes bfh-flash { 0%, 55% { opacity: 0; } 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bfh-land { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes bfh-img { from { transform: scale(1.18); } to { transform: scale(1.07); } }

@media (prefers-reduced-motion: no-preference) {
  /* A. scrolled: the sequence is tied to the lane's entry into the viewport, so it can be scrubbed backwards */
  @supports (animation-timeline: view()) {
    .bfh-reticle, .bfh-flash { display: block; }
    /* the lane owns the timeline (an overflow:hidden ancestor would otherwise be its children's scroller). The ranges are in "cover" terms:
       0% = the lane's top edge reaches the bottom of the screen, about 43% = it has fully come in. The words land at 40 to 50%, when they are well on screen. */
    .bfh-lane { view-timeline: --bfh-lane block; animation: bfh-open linear both; animation-timeline: --bfh-lane; animation-range: cover calc(0% + var(--off, 0%)) cover calc(30% + var(--off, 0%)); }
    .bfh-lane .bfh-base img { animation: bfh-img linear both; animation-timeline: --bfh-lane; animation-range: cover 0% cover 60%; }
    .bfh-reticle { animation: bfh-lock linear both; animation-timeline: --bfh-lane; animation-range: cover calc(4% + var(--off, 0%)) cover calc(41% + var(--off, 0%)); }
    .bfh-flash { animation: bfh-flash linear both; animation-timeline: --bfh-lane; animation-range: cover calc(33% + var(--off, 0%)) cover calc(43% + var(--off, 0%)); }
    /* The words are not scrubbed: a scroll that stops part way left them half landed (faded and soft, worst in the later
       lanes, 19 Oct 2026). They land once, on a short timer, when the script sees the lane's words on screen (bfh-words, is-landed). */
    .bfh-words .bfh-lane:not(.is-landed) :is(.bfh-title, .bfh-gain, .bfh-go) { opacity: 0; }
    .bfh-words .bfh-lane.is-landed .bfh-title { animation: bfh-land 600ms var(--ease-out) both; }
    .bfh-words .bfh-lane.is-landed .bfh-gain { animation: bfh-land 600ms var(--ease-out) 90ms both; }
    .bfh-words .bfh-lane.is-landed .bfh-go { animation: bfh-land 600ms var(--ease-out) 170ms both; }
  }
  /* B. no scroll timelines: the same sequence on a timer once the lanes are in view (the script sets bfh-armed, then is-in) */
  .bfh-armed .bfh-reticle, .bfh-armed .bfh-flash { display: block; }
  .bfh-armed:not(.is-in) .bfh-lane { clip-path: circle(0% at 50% 46%); }
  .bfh-armed:not(.is-in) .bfh-title, .bfh-armed:not(.is-in) .bfh-gain, .bfh-armed:not(.is-in) .bfh-go { opacity: 0; }
  /* (where scroll timelines do exist, as in a test that forces this path, the timer must win over them) */
  .bfh-armed.is-in :is(.bfh-lane, .bfh-reticle, .bfh-flash, .bfh-title, .bfh-gain, .bfh-go) { animation-timeline: auto; animation-range: normal; }
  .bfh-armed.is-in .bfh-lane { animation: bfh-open 1000ms var(--ease-out) calc(var(--n, 0) * 180ms) both; }
  .bfh-armed.is-in .bfh-reticle { animation: bfh-lock 1100ms ease-in-out calc(var(--n, 0) * 180ms + 100ms) both; }
  .bfh-armed.is-in .bfh-flash { animation: bfh-flash 900ms linear calc(var(--n, 0) * 180ms + 700ms) both; }
  .bfh-armed.is-in .bfh-title { animation: bfh-land 700ms var(--ease-out) calc(var(--n, 0) * 180ms + 920ms) both; }
  .bfh-armed.is-in .bfh-gain { animation: bfh-land 700ms var(--ease-out) calc(var(--n, 0) * 180ms + 1040ms) both; }
  .bfh-armed.is-in .bfh-go { animation: bfh-land 700ms var(--ease-out) calc(var(--n, 0) * 180ms + 1160ms) both; }
}
@media (prefers-reduced-motion: reduce) {
  .bfh-lane, .bfh-base img, .bfh-color, .bfh-go, .bfh-go svg { transition-duration: 0.01ms; }
  .bfh-scope, .bfh-reticle, .bfh-flash, .bfh-ping, .bfh-lane > .mu-fx-beam { display: none !important; }
}

/* ───────────── defence | law enforcement: one lane's place, cut by a slanted line (23 Oct 2026) ─────────────
   Two clipped halves fill the same box: defence above the line, law enforcement below it, a thin gap along the cut. Each half is a whole lane
   (its own iris, scope and words); the clip sits on the half, so the lane's own clip-path animation is untouched. Defence's words stand
   at the top, law enforcement's at the bottom. Unused since 2 Nov 2026: defence has its own lane, with its words at the bottom like the others. */
.bfh-split { position: relative; min-height: clamp(34rem, 86svh, 40rem); overflow: hidden; border-radius: var(--radius-panel); }
.bfh-half { position: absolute; inset: 0; }
.bfh-half--a { clip-path: polygon(0 0, 100% 0, 100% calc(36% - 5px), 0 calc(56% - 5px)); }
.bfh-half--b { clip-path: polygon(0 calc(56% + 5px), 100% calc(36% + 5px), 100% 100%, 0 100%); }
.bfh-half .bfh-lane { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; border-radius: 0; flex: none; }
.bfh-split .bfh-title { font-size: clamp(2rem, 1.3rem + 1.5vw, 2.9rem); }
.bfh-split .bfh-gain { font-size: var(--type-small-size); line-height: 1.5; }
@media (min-width: 1000px) {
  .bfh-split { flex: 1 1 0; min-width: 0; min-height: 0; transition: flex-grow 800ms var(--ease-out); }
  .bfh-split:has(.bfh-lane.is-aimed) { flex-grow: 1.5; }
}
