/* ============================================================
   FourOneSix IT — "flair" layer
   Loaded after site.css. Pairs with scripts/flair.js.
   ============================================================ */

/* ---------- Old watermark drawings replaced by the motion pieces ---------- */
.hero__watermark,
.hero__mark,
.approach__watermark,
.cta-band__watermark,
.about-hero__watermark,
.disciplines-hero__watermark,
.contact-hero__watermark { display: none; }

/* Shared: canvases fill their section, sit behind content */
.fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
}
.page-hero > .container { z-index: 2; }

/* ============================================================
   Home hero — orbit trails
   ============================================================ */
.fx-orbits {
  opacity: 0.75;
  -webkit-mask-image: linear-gradient(90deg, transparent 8%, rgba(0,0,0,.35) 38%, #000 62%);
          mask-image: linear-gradient(90deg, transparent 8%, rgba(0,0,0,.35) 38%, #000 62%);
}
:root[data-theme="dark"] .fx-orbits { opacity: 0.6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fx-orbits { opacity: 0.6; } }
.hero__bigtype { z-index: 0; }
.hero__inner { z-index: 2; }
@media (max-width: 720px) {
  .fx-orbits {
    opacity: 0.6;
    -webkit-mask-image: linear-gradient(180deg, #000 0, #000 220px, transparent 360px);
            mask-image: linear-gradient(180deg, #000 0, #000 220px, transparent 360px);
  }
}

/* ============================================================
   Home "How we think" — topographic contours
   ============================================================ */
.fx-contours {
  -webkit-mask-image: linear-gradient(90deg, transparent 18%, rgba(0,0,0,.5) 42%, #000 64%);
          mask-image: linear-gradient(90deg, transparent 18%, rgba(0,0,0,.5) 42%, #000 64%);
}
@media (max-width: 720px) {
  .fx-contours {
    opacity: 0.55;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 35%, #000 100%);
            mask-image: linear-gradient(180deg, transparent 0, #000 35%, #000 100%);
  }
}

/* ============================================================
   Horizon — CTA bands
   ============================================================ */
.fx-horizon {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(720px, 56%);
  height: auto;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
  fill: none;
  stroke-linecap: round;
}
.fx-horizon--band { color: var(--c-ink-on-dark); bottom: 8%; }
.fx-hz-line { stroke-width: 1.2; opacity: 0.45; }
.fx-hz-arc {
  stroke: var(--c-accent);
  stroke-width: 1.5;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  opacity: calc(0.95 - var(--i) * 0.17);
}
.fx-hz-sun {
  transform: translateY(70px);
  transition: transform 2.4s var(--ease-out);
}
.fx-hz-node circle { fill: var(--c-accent); stroke: none; }
.fx-hz-node { opacity: 0; transform: rotate(-40deg); }

.fx-horizon.is-risen .fx-hz-sun { transform: none; }
.fx-horizon.is-risen .fx-hz-arc {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.8s var(--ease-out) calc(0.2s + var(--i) * 0.16s);
}
.fx-horizon.is-risen .fx-hz-node {
  opacity: 1;
  transition: opacity 0.6s var(--ease-out) 1.4s;
  animation: fx-hz-drift 16s ease-in-out 1.4s infinite alternate;
}
@keyframes fx-hz-drift {
  from { transform: rotate(-40deg); }
  to   { transform: rotate(-140deg); }
}
.cta-band > .container { position: relative; z-index: 1; }
@media (max-width: 720px) {
  .fx-horizon--band { width: 92%; opacity: 0.5; bottom: 0; }
}

/* ============================================================
   Contact hero — meeting point
   ============================================================ */
.fx-meet {
  position: absolute;
  top: 50%;
  right: -4%;
  width: min(660px, 44%);
  height: auto;
  transform: translateY(-50%);
  overflow: visible;
  pointer-events: none;
  z-index: 0;
  fill: none;
  stroke-linecap: round;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, transparent 12%, #000 42%);
          mask-image: linear-gradient(90deg, transparent 0, transparent 12%, #000 42%);
}
.fx-meet__a, .fx-meet__j--a { stroke: var(--c-ink-4); stroke-width: 1.4; }
.fx-meet__b, .fx-meet__j--b { stroke: var(--c-accent); stroke-width: 1.6; }
.fx-meet__a, .fx-meet__b, .fx-meet__j { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.fx-meet__node { fill: var(--c-accent); stroke: none; opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(0.2); }
.fx-meet__halo { stroke: var(--c-accent); stroke-width: 1; opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(0.4); }
.fx-meet__pulse--a { fill: var(--c-ink-3); }
.fx-meet__pulse--b { fill: var(--c-accent); }
.fx-meet.is-met .fx-meet__a,
.fx-meet.is-met .fx-meet__b { stroke-dashoffset: 0; transition: stroke-dashoffset 1.8s var(--ease-out) 0.2s; }
.fx-meet.is-met .fx-meet__node { opacity: 1; transform: none; transition: opacity 0.4s var(--ease-out) 1.7s, transform 0.6s var(--ease-pop) 1.7s; }
.fx-meet.is-met .fx-meet__halo { opacity: 0.4; transform: none; transition: opacity 0.8s var(--ease-out) 1.9s, transform 0.8s var(--ease-out) 1.9s; }
.fx-meet.is-met .fx-meet__j { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s var(--ease-out) 2s; }
.page-hero--contact > .container { position: relative; z-index: 2; }
@media (max-width: 720px) {
  .fx-meet { width: 100%; right: -30%; opacity: 0.5; }
}

/* ============================================================
   About — drafting table
   ============================================================ */
.fx-draft {
  position: absolute;
  top: 50%;
  right: -3%;
  width: min(720px, 52%);
  height: auto;
  transform: translateY(-54%);
  overflow: visible;
  pointer-events: none;
  z-index: 0;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--c-ink-3);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 30%);
          mask-image: linear-gradient(90deg, transparent 0, #000 30%);
}
.fx-d {
  stroke: currentColor;
  stroke-width: 1;
  opacity: 0.55;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}
.fx-d--dash { stroke-dasharray: 0.004 0.008; stroke-dashoffset: 0; opacity: 0; }
.fx-d--faint { opacity: 0.3; }
.fx-d--tick { stroke-dasharray: none; stroke-dashoffset: 0; opacity: 0; }
.fx-d-arc {
  stroke: var(--c-accent);
  stroke-width: 2;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}
.fx-d-node { fill: var(--c-accent); stroke: none; opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(0.2); }

.fx-draft.is-drawn .fx-d {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.1s var(--ease-out) calc(var(--i) * 0.11s), opacity 0.9s var(--ease-out) calc(var(--i) * 0.11s);
}
.fx-draft.is-drawn .fx-d--dash,
.fx-draft.is-drawn .fx-d--tick { opacity: 0.45; }
.fx-draft.is-drawn .fx-d--faint { opacity: 0.3; }
.fx-draft.is-drawn .fx-d-arc {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.6s var(--ease-out) calc(var(--n) * 0.11s + 0.4s);
}
.fx-draft.is-drawn .fx-d-node {
  opacity: 1;
  transform: none;
  transition: opacity 0.4s var(--ease-out) calc(var(--n) * 0.11s + 1.6s), transform 0.6s var(--ease-pop) calc(var(--n) * 0.11s + 1.6s);
}
.fx-draft.is-drawn .fx-prot { animation: fx-prot 120s linear 3s infinite; }
@keyframes fx-prot { to { transform: rotate(360deg); } }
.page-hero--about > .container { position: relative; z-index: 2; }
@media (max-width: 720px) {
  .fx-draft { width: 110%; right: -30%; top: 0; transform: none; opacity: 0.5; }
}

/* ============================================================
   Disciplines — tangle to line
   ============================================================ */
.fx-tangle {
  -webkit-mask-image: linear-gradient(90deg, transparent 52%, #000 66%);
          mask-image: linear-gradient(90deg, transparent 52%, #000 66%);
}
@media (max-width: 720px) {
  .fx-tangle {
    opacity: 0.7;
    -webkit-mask-image: linear-gradient(180deg, #000 0, #000 140px, transparent 220px);
            mask-image: linear-gradient(180deg, #000 0, #000 140px, transparent 220px);
  }
}

/* ============================================================
   Health Check — order from chaos
   ============================================================ */
.fx-dots {
  -webkit-mask-image: linear-gradient(90deg, transparent 52%, #000 70%);
          mask-image: linear-gradient(90deg, transparent 52%, #000 70%);
}
@media (max-width: 720px) {
  .fx-dots {
    opacity: 0.6;
    -webkit-mask-image: linear-gradient(180deg, #000 0, transparent 45%);
            mask-image: linear-gradient(180deg, #000 0, transparent 45%);
  }
}

/* ============================================================
   Case studies — roadmap thread
   ============================================================ */
.section.stories > .container { position: relative; }
.fx-road {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
  fill: none;
  stroke-linecap: round;
}
.fx-road__guide { stroke: var(--c-ink-4); stroke-width: 1; stroke-dasharray: 2 7; opacity: 0.55; }
.fx-road__line { stroke: var(--c-accent); stroke-width: 1.6; }
.fx-road__dot {
  fill: var(--c-bg);
  stroke: var(--c-ink-4);
  stroke-width: 1.4;
  transition: fill var(--dur-slow) var(--ease-out), stroke var(--dur-slow) var(--ease-out);
}
.fx-road__halo {
  fill: none;
  stroke: var(--c-accent);
  stroke-width: 1;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.5);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-pop);
}
.fx-road__node.is-lit .fx-road__dot { fill: var(--c-accent); stroke: var(--c-accent); }
.fx-road__node.is-lit .fx-road__halo { opacity: 0.45; transform: none; }
@media (max-width: 840px) { .fx-road { display: none; } }

/* ============================================================
   Scroll cue (home hero, from in.transit)
   ============================================================ */
.flair-cue {
  position: absolute;
  left: 50%;
  bottom: var(--sp-5);
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: none;
  border: 0;
  color: var(--c-ink-3);
  cursor: pointer;
  opacity: 0;
  transition: opacity 600ms var(--ease-out), color var(--dur-base) var(--ease-out);
}
html.has-anim .flair-cue { animation: flair-cue-in 600ms var(--ease-out) 1.6s forwards; }
html:not(.has-anim) .flair-cue { opacity: 0.8; }
html.flair-scrolled .flair-cue { opacity: 0 !important; animation: none; pointer-events: none; }
.flair-cue:hover { color: var(--c-accent-ink); }
@keyframes flair-cue-in { to { opacity: 0.85; } }
.flair-cue__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  padding-left: 0.32em;
  text-transform: uppercase;
}
.flair-cue__line {
  position: relative;
  width: 1px;
  height: 48px;
  overflow: hidden;
  background: color-mix(in srgb, var(--c-accent) 22%, transparent);
}
.flair-cue__line::after {
  content: "";
  position: absolute;
  left: 0;
  top: -16px;
  width: 1px;
  height: 16px;
  background: var(--c-accent);
  animation: flair-cue-drop 2.4s cubic-bezier(.55, 0, .35, 1) infinite;
}
@keyframes flair-cue-drop {
  0%   { top: -16px; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { top: 48px; opacity: 0; }
}
@media (max-width: 720px) { .flair-cue { display: none; } }

/* ============================================================
   Scroll gauge — the Orbit mark fills as you read
   ============================================================ */
.flair-gauge {
  position: fixed;
  right: clamp(16px, 2.4vw, 32px);
  bottom: clamp(16px, 2.4vw, 32px);
  z-index: 50;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--c-line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--c-bg) 86%, transparent);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  color: var(--c-ink-3);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
}
.flair-gauge.is-on { opacity: 1; transform: none; pointer-events: auto; }
.flair-gauge:hover { border-color: var(--c-accent); color: var(--c-ink); }
.flair-gauge svg { width: 100%; height: 100%; display: block; fill: none; stroke-linecap: round; }
.flair-gauge__track { stroke: var(--c-line); stroke-width: 2; }
.flair-gauge__fill {
  stroke: var(--c-accent);
  stroke-width: 2.4;
  stroke-dasharray: 100 100;
  stroke-dashoffset: 100;
}
.flair-gauge__node { fill: var(--c-accent); stroke: none; }
.flair-gauge__up {
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.flair-gauge:hover .flair-gauge__up,
.flair-gauge:focus-visible .flair-gauge__up { opacity: 1; transform: none; }

/* ============================================================
   Home "How we work" — opens up as you scroll into it
   (Edge/Chrome/Safari 26+; others see the full-width section)
   ============================================================ */
@supports (animation-timeline: view()) {
  html.has-anim .how {
    animation: flair-open linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 38%;
  }
}
@keyframes flair-open {
  from { clip-path: inset(0 5vw round 28px); }
  to   { clip-path: inset(0 0 round 0); }
}
@media (max-width: 720px) {
  @keyframes flair-open {
    from { clip-path: inset(0 16px round 20px); }
    to   { clip-path: inset(0 0 round 0); }
  }
}

/* ============================================================
   Reduced motion: everything shows in its finished state
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .fx-hz-sun, .fx-hz-arc, .fx-hz-node, .fx-meet__a, .fx-meet__b, .fx-meet__j, .fx-meet__node, .fx-meet__halo, .fx-d, .fx-d-arc, .fx-d-node, .fx-road__halo, .fx-road__dot { transition: none !important; }
  .fx-hz-node, .fx-prot { animation: none !important; }
  .fx-hz-node { transform: rotate(-70deg); }
}

/* ============================================================
   Easter eggs — generative pieces that replace static watermarks
   ============================================================ */
.fx-egg-src { visibility: hidden !important; }
.fx-egg-host { isolation: isolate; }
.fx-egg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: -1;
}
/* Wordmarks: brighten a touch while they flip to 416 */
.hero__bigtype, .bigtype-wordmark { transition: opacity 600ms var(--ease-out); }
.hero__bigtype.is-awake { opacity: 0.14; }
.bigtype-wordmark.is-awake { opacity: 0.1; }
