/* ============================================================
   FIELD — persistent generative background + footer controller
   (assets/js/field.js)

   The canvas is fixed behind every page and painted in the body's own
   `color`, so it inverts with the dark toggle without a second palette.
   Page content sits above it on z-index 1.
   ============================================================ */
.nm-field { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .5; }
body.dark .nm-field { opacity: .38; }

/* Everything the page already draws must sit above the field.
   CRITICAL: only z-index is set here. These elements carry their own
   positioning — the nav, cursor, glass pane and signal panel are all
   `position: fixed`, and forcing `relative` onto them detaches them from
   the viewport and makes them scroll away with the document. Only the
   statically-positioned page wrapper needs a position at all. */
#nm-loop { position: relative; z-index: 1; }
body > nav, body > main, body > footer, body > header { z-index: 1; }
.nm-nav { z-index: 100; }
.nm-pre { z-index: 200; }
.nm-cursor, .nm-cursor-ring { z-index: 9999; }
.nm-signal { z-index: 999; }
.nm-glass { z-index: 90; }

/* ---- the rail ---------------------------------------------- */
.nm-fieldbar { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
  z-index: 120; display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border: 1px solid currentColor; border-radius: 2px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--fg);
  max-width: calc(100vw - 24px); }
.nm-fieldbar.is-off { opacity: .5; }
.nm-fieldbar:hover, .nm-fieldbar:focus-within { opacity: 1; }

.nm-fieldbar button { background: none; border: none; color: inherit; cursor: pointer;
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  padding: 4px 7px; opacity: .5; transition: opacity .22s var(--ease), background .22s var(--ease); }
.nm-fieldbar button:hover, .nm-fieldbar button:focus-visible { opacity: 1; }
.nm-fieldbar .fb-pow { border: 1px solid currentColor; opacity: .75; }
.nm-fieldbar .fb-states { display: flex; gap: 1px; }
.nm-fieldbar .fb-s.on { opacity: 1; background: currentColor; color: var(--bg); }
.nm-fieldbar .fb-ln { border-left: 1px solid currentColor; padding-left: 11px; }

.nm-fieldbar .fb-d { -webkit-appearance: none; appearance: none; width: 62px; height: 1px;
  background: currentColor; opacity: .45; cursor: pointer; }
.nm-fieldbar .fb-d::-webkit-slider-thumb { -webkit-appearance: none; width: 9px; height: 9px;
  border-radius: 50%; background: currentColor; cursor: pointer; }
.nm-fieldbar .fb-d::-moz-range-thumb { width: 9px; height: 9px; border: none;
  border-radius: 50%; background: currentColor; cursor: pointer; }

@media (max-width: 720px) {
  .nm-fieldbar { font-size: 8.5px; gap: 6px; padding: 6px 7px; bottom: 8px; }
  .nm-fieldbar .fb-d { display: none; }
  .nm-fieldbar .fb-s { padding: 4px 5px; }
}

/* The rail is fixed, so it will sit on whatever the viewport bottom holds.
   Reserve room for it rather than letting it cover the hero's descriptor
   line on short screens. */
.nm-hero { padding-bottom: clamp(84px, 12vh, 120px); }
.nm-corners { bottom: 52px; }
@media (max-width: 720px) { .nm-corners { bottom: 44px; } }

/* ============================================================
   CASE-STUDY FRAME — clickable media
   The copy card holds the real link; the frame is a mouse convenience,
   so it only signals when a route genuinely exists.
   ============================================================ */
.wframe.is-openable { cursor: pointer; }
.wframe.is-openable::after {
  content: "View case study ↗";
  position: absolute; right: 14px; bottom: 14px; z-index: 6;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: #fff;
  padding: 8px 12px; border: 1px solid rgba(255,255,255,.55);
  background: rgba(0,0,0,.42); backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(6px);
  transition: opacity .32s var(--ease), transform .32s var(--ease);
  pointer-events: none; }
.wframe.is-openable:hover::after { opacity: 1; transform: none; }
/* On touch this pill was pinned permanently visible over the media — a
   translucent, backdrop-blurred slab sitting inside the frame, which read as
   a blurred overlay the sharp image poked out of. Stacked mode now renders a
   real "Read the full case study" link under each frame, so the hover hint is
   redundant there and is removed rather than left floating. */
@media (max-width: 900px) {
  .wframe.is-openable::after { display: none; }
}

/* ============================================================
   UTILITY RAIL — menu + contact, above every layer
   ============================================================ */
.nm-util { position: fixed; right: clamp(12px, 2vw, 22px); bottom: clamp(12px, 2vw, 22px);
  z-index: 500; display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; }

.nm-util .nu-menu, .nm-util .nu-talk {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 15px; border: 1px solid currentColor; border-radius: 2px;
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  color: var(--fg); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  cursor: pointer; text-decoration: none;
  transition: background .26s var(--ease), color .26s var(--ease); }
.nm-util .nu-talk { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.nm-util .nu-menu:hover, .nm-util .nu-menu:focus-visible { background: var(--fg); color: var(--bg); }
.nm-util .nu-talk:hover, .nm-util .nu-talk:focus-visible { background: transparent; color: var(--fg); }

.nu-bars { display: inline-flex; flex-direction: column; gap: 3px; width: 13px; }
.nu-bars i { display: block; height: 1.5px; background: currentColor; transition: transform .3s var(--ease), opacity .3s var(--ease); }
.nm-util.is-open .nu-bars i:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.nm-util.is-open .nu-bars i:nth-child(2) { opacity: 0; }
.nm-util.is-open .nu-bars i:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

.nu-sheet { position: fixed; right: clamp(12px, 2vw, 22px); bottom: clamp(62px, 8vh, 78px);
  z-index: 499; min-width: 232px;
  border: 1px solid currentColor; border-radius: 2px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  opacity: 0; transform: translateY(10px) scale(.98);
  transition: opacity .34s var(--ease), transform .34s var(--ease); }
.nu-sheet.on { opacity: 1; transform: none; }
.nu-sheet ul { list-style: none; margin: 0; padding: 6px; }
.nu-sheet a { display: block; padding: 11px 13px; color: var(--fg); text-decoration: none;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  transition: background .2s var(--ease), color .2s var(--ease); }
.nu-sheet a:hover, .nu-sheet a:focus-visible { background: var(--fg); color: var(--bg); }

/* The field rail moves off-centre so the two clusters never collide. */
.nm-fieldbar { left: clamp(12px, 2vw, 22px); transform: none; }
@media (max-width: 900px) {
  .nm-fieldbar { left: 8px; right: auto; bottom: 8px; }
  .nm-util { bottom: 8px; right: 8px; }
  .nm-util .nu-menu .nu-lab { display: none; }
  .nm-util .nu-menu, .nm-util .nu-talk { padding: 10px 12px; }
}

/* ============================================================
   COMING-SOON WINDOW
   A project with no route lifts its own loop into a floating pane for
   five seconds instead of doing nothing when clicked. Dismissible by
   the button, Escape, or clicking away.
   ============================================================ */
.nm-soon { position: fixed; inset: 0; z-index: 520;
  display: grid; place-items: center; padding: 5vw;
  background: rgba(6,6,6,.62); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .42s var(--ease); }
.nm-soon.on { opacity: 1; }

.nm-soon-in { position: relative; width: min(880px, 92vw); aspect-ratio: 16/9;
  overflow: hidden; border-radius: 6px; border: 1px solid rgba(255,255,255,.28);
  background: #0b0b0a;
  box-shadow: 0 40px 110px -40px rgba(0,0,0,.8);
  transform: scale(.965) translateY(10px);
  transition: transform .52s cubic-bezier(.22,1,.36,1); }
.nm-soon.on .nm-soon-in { transform: none; }

.nm-soon-media, .nm-soon-in .cyc { position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; opacity: .55; }

.nm-soon-cap { position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; gap: 7px;
  padding: clamp(18px,3vw,34px);
  background: linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,0)); }
.nm-soon-k { font-family: var(--font-mono); font-size: 10px; letter-spacing: .24em;
  text-transform: uppercase; color: rgba(255,255,255,.66); }
.nm-soon-t { font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(20px,3.4vw,46px); line-height: .96; letter-spacing: -.02em; color: #fff; }

.nm-soon-x { position: absolute; top: 12px; right: 12px; z-index: 2;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: #fff; cursor: pointer;
  background: rgba(0,0,0,.42); border: 1px solid rgba(255,255,255,.5);
  padding: 8px 13px; backdrop-filter: blur(6px);
  transition: background .24s var(--ease), color .24s var(--ease); }
.nm-soon-x:hover, .nm-soon-x:focus-visible { background: #fff; color: #0b0b0a; }

/* drains over the five seconds so the auto-close is visible, not abrupt */
.nm-soon-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: #fff; transform-origin: left; transform: scaleX(1); }
.nm-soon.on .nm-soon-bar { transition: transform 5s linear; transform: scaleX(0); }

@media (prefers-reduced-motion: reduce) {
  .nm-soon-in { transition: none; transform: none; }
  .nm-soon.on .nm-soon-bar { transition: none; transform: scaleX(0); }
}

/* ============================================================
   PROCESS STACK — four approved frames, one per step
   ============================================================ */
.how-stack { position: relative; overflow: hidden; }
.how-f { position: absolute; inset: 0; opacity: 0;
  transition: opacity .7s var(--ease), transform 1.1s var(--ease);
  transform: scale(1.05); }
.how-f.is-on { opacity: 1; transform: scale(1); }
.how-f img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* the first frame holds the box open — the rest are absolutely positioned */
.how-f:first-of-type { position: relative; }

.how-cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: clamp(14px,2vw,24px);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,0)); }

/* the step you're reading takes the accent */
.nm-how-item { transition: opacity .45s var(--ease); }
.nm-how-item.is-current { opacity: 1; }
.nm-how-item:not(.is-current) { opacity: .42; }

@media (prefers-reduced-motion: reduce) {
  .how-f { transition: opacity .2s linear; transform: none; }
  .how-f.is-on { transform: none; }
  .nm-how-item:not(.is-current) { opacity: 1; }
}

/* Mineral variant: square line art, not photography. It sits inside the frame
   rather than filling it, and inverts on the light theme the same way the hero
   field does — one asset set, both themes. */
/* Transparent: the line work sits on the page, not on a plate. currentColor
   means one asset set serves both themes with no inversion filter. */
.how-stack--geo { background: none; display: grid; place-items: center; color: var(--ink); }
.how-stack--geo .how-f { display: grid; place-items: center; padding: 7%; transform: none; }
.how-stack--geo .how-f.is-on { transform: none; }
.how-stack--geo .how-f img { width: 100%; height: 100%; object-fit: contain; }
/* The process frames are <img>-referenced SVGs too, so they render black
   whatever the theme. Invert them on dark, same as the hero and loader. */
body.dark .how-stack--geo .how-f img { filter: invert(1); }

.how-stack--geo .how-cap { color: var(--ink); background: none;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; }

/* The process heading is an H1 in the heading system now, so it needs the
   display scale to match — an h1 at the old h2 size would read as a demotion. */
.nm-how .story h1 { font-family: var(--font-display); font-weight: 900;
  text-transform: uppercase; margin: 0 0 clamp(22px,3vh,36px);
  font-size: clamp(38px,7vw,110px); line-height: .88; letter-spacing: -.04em; }

/* ---- process steps as buttons ---- */
/* .nm-how-item is a two-column grid built for `.num` + a div. The button is
   now its only child, so it has to span both tracks — otherwise it lands in
   the 40px number column and its own grid collapses to one word per line. */
.nm-how-item .how-btn { grid-column: 1 / -1; }
.how-btn { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px;
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  color: inherit; font: inherit; padding: 10px 0;
  transition: opacity .4s var(--ease); }
.how-btn .tx { min-width: 0; }
.how-btn .tx { display: block; }
.how-btn .h3 { display: block; font-weight: 700; text-transform: uppercase;
  letter-spacing: -.01em; font-size: clamp(15px,1.6vw,19px); margin-bottom: 5px; }
.how-btn .p { display: block; font-size: clamp(13px,1.3vw,15px); line-height: 1.55;
  color: var(--quiet); }
.how-btn:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.nm-how-item.is-current .how-btn .h3 { text-decoration: underline;
  text-underline-offset: 6px; text-decoration-thickness: 1px; }

/* Blending In and No Buzzwords became H1s to join the heading system, so they
   need the display scale their old h2 rules carried — an h1 at h2 size reads
   as a demotion. Matches the How We Work heading. */
.nm-blend h1 { font-family: var(--font-display); font-weight: 900;
  text-transform: uppercase; margin: 0;
  font-size: clamp(40px,8vw,132px); line-height: .88; letter-spacing: -.04em; }
.nm-buzz .head h1 { font-family: var(--font-display); font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(38px,7.4vw,120px); line-height: .88; letter-spacing: -.04em; }

/* ============================================================
   MOBILE · the two fixed rails
   The field controller and the utility rail both pin to the bottom and
   were overlapping each other on a phone. The field controller is a
   power-user toy; the way home and the way to contact are not. So on
   small screens the utility rail keeps the bottom edge and the field
   controller collapses to a single toggle above it.
   ============================================================ */
/* The field button lives in the rail; on desktop the full controller has it,
   so it only appears where the controller is hidden. */
.nu-field { display: none; }
.nm-util .nu-field { font: inherit; letter-spacing: inherit; text-transform: inherit;
  border: 1px solid currentColor; border-radius: 2px; padding: 11px 14px;
  color: var(--fg); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: pointer;
  transition: background .26s var(--ease), color .26s var(--ease), opacity .26s var(--ease); }
.nm-util .nu-field.is-off { opacity: .5; }
.nm-util .nu-field:hover, .nm-util .nu-field:focus-visible { background: var(--fg); color: var(--bg); }

@media (max-width: 640px) {
  /* one row along the bottom edge: FIELD · MENU · LET'S TALK */
  .nm-fieldbar { display: none; }
  .nu-field { display: inline-flex; }
  .nm-util { bottom: 10px; right: 8px; left: 8px; gap: 6px;
    justify-content: space-between; }
  .nm-util .nu-field, .nm-util .nu-menu, .nm-util .nu-talk {
    padding: 12px 10px; font-size: 9.5px; letter-spacing: .1em; flex: 1 1 auto;
    justify-content: center; }
  .nu-sheet { bottom: 60px; left: 8px; right: 8px; min-width: 0; }
}

/* ============================================================
   MOBILE · the top nav
   Six links wrapped onto three lines and covered the hero. On a phone
   the persistent utility rail already carries the full menu, so the top
   bar keeps only the wordmark and the theme toggle.
   ============================================================ */
@media (max-width: 720px) {
  .nm-nav .r a:not(.nm-cta), .nm-nav .c { display: none; }
  .nm-nav .r { gap: 10px; }
  .nm-nav .r .nm-cta { font-size: 10px; padding: 8px 12px; }
  .nav .r a:not(:last-child) { display: none; }
}
