/* ---------- strip / list switch ---------- */

/* On the home page and the list view, beside the plus. Both views named, the
   one you are on at full ink on a sliding highlight, the other at the list
   view's resting 40%. It shows where you are AND where else you can go, so
   there is nothing to decode (Anthony's pick, 2026-09-13). History: a three-line
   icon that turned 90 degrees read backwards; so did a single word pill, whichever
   word it showed — half of the people it was shown to read it the other way.

   The highlight is one step LIGHTER than the chip in both themes (--seg-glide),
   so dark mode stays as tonal as light.

   There is no Back button beside it on the list: from the list, Back and this
   are the same action, and Back appearing would push it out of place. */
.view-seg{
  position:relative;
  display:flex;
  height:var(--chip-h);
  padding:3px;
  border-radius:var(--chip-r);
  background-color:var(--chip);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  order:-1;
  transition:opacity 260ms var(--ease),visibility 0s linear 260ms,
             order 0s linear 260ms,filter 520ms var(--ease);
}
/* EVERY `:not()` HERE COSTS A CLASS OF SPECIFICITY (2026-09-17). Adding
   .doc-open and .nf-open to this list once made it outrank the `html body…
   .view-seg.page-seg` rule below, which is what keeps About · Services off the
   home page — and the hidden switch, parked at order:-1, reappeared over the
   wordmark on a phone. The two new pages are held out underneath instead, at a
   specificity that beats this rule without touching it. */
body:not(.project-open):not(.about-open):not(.services-open) .view-seg{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  order:0;
  transition:opacity 340ms var(--ease) var(--swap),visibility 0s var(--swap),
             order 0s var(--swap),filter 520ms var(--ease);
}
/* ABOUT · SERVICES (Anthony, 2026-09-15). The two pages are a pair, so they get
   the site's pair control: Feed · Index's switch, on both pages, the page you
   are on highlighted and the highlight sliding across as you go from one to the
   other. It replaced a Services pill on About and an About pill on Services,
   which traded places between the two — that move did not feel right on a
   phone, and desktop follows so the two stay aligned. On a phone: wordmark
   ~102, switch ~136, plus 30 and gaps, ~290 of 335. It arrives and leaves like
   Feed · Index; the `html` in the selectors outranks Feed · Index's own
   visibility rule, which would otherwise show this one on the home page. */
html body:not(.about-open):not(.services-open) .view-seg.page-seg{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  order:-1;
  transition:opacity 260ms var(--ease),visibility 0s linear 260ms,
             order 0s linear 260ms,filter 520ms var(--ease);
}
html body.about-open .view-seg.page-seg,
html body.services-open .view-seg.page-seg{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  order:0;
  transition:opacity 340ms var(--ease) var(--swap),visibility 0s var(--swap),
             order 0s var(--swap),filter 520ms var(--ease);
}

/* WHICH SWITCH SHOWS WHERE — AND WHY THESE SELECTORS LOOK LIKE THIS.
   Feed · Index's own show rule is `body:not(.project-open):not(.about-open)
   :not(.services-open) .view-seg`, which is FOUR classes' worth of weight on
   one element. Every rule that has to overrule it needs four classes of its
   own, so each one below carries a `:not()` that is always true for the state
   it describes. Count the classes before editing one; a rule with three loses
   silently and a hidden switch reappears over the wordmark (2026-09-17).

   The 404 shows none of them: neither pair means anything there, and the way
   back is the wordmark or the menu. */
html body.nf-open:not(.about-open):not(.services-open) .view-seg{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  order:-1;
  transition:opacity 260ms var(--ease),visibility 0s linear 260ms,
             order 0s linear 260ms,filter 520ms var(--ease);
}

/* PRIVACY · TERMS. The two legal pages are a pair like About and Services, so
   they get the pair control — and only that one: Feed · Index has nothing to
   say on a page of terms. */
html body:not(.doc-legal):not(.nf-open) .view-seg.legal-seg,
html body.doc-open:not(.nf-open) .view-seg:not(.legal-seg){
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  order:-1;
  transition:opacity 260ms var(--ease),visibility 0s linear 260ms,
             order 0s linear 260ms,filter 520ms var(--ease);
}
html body.doc-legal:not(.nf-open) .view-seg.legal-seg{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  order:0;
  transition:opacity 340ms var(--ease) var(--swap),visibility 0s var(--swap),
             order 0s var(--swap),filter 520ms var(--ease);
}

.seg-glide{
  position:absolute;
  top:3px;
  left:0;
  width:0;
  height:calc(var(--chip-h) - 6px);
  border-radius:calc(var(--chip-r) - 3px);
  background-color:var(--seg-glide);
  /* eased at both ends and a touch longer: the highlight is a small thing
     travelling a short way, and an ease-out made it snap into place */
  transition:transform var(--seg-t) var(--seg-ease),width var(--seg-t) var(--seg-ease),
             background-color var(--seg-t) var(--seg-ease);
}
.seg-opt{
  position:relative;
  height:calc(var(--chip-h) - 6px);
  padding:0 14px;
  border:0;
  border-radius:calc(var(--chip-r) - 3px);
  background:none;
  font:inherit;
  font-size:var(--fs-s);
  color:var(--ink);
  white-space:nowrap;
  opacity:.4;
  cursor:pointer;
  /* the words brighten on the highlight's own clock, so they arrive together */
  transition:opacity var(--seg-t) var(--seg-ease),color var(--seg-t) var(--seg-ease);
}
@media (hover:hover){.seg-opt:hover{opacity:.7}}.seg-opt.is-pressed{opacity:.7}
.seg-opt[aria-pressed="true"]{opacity:1;cursor:default}

/* The scrim. Figma 794:1789 — a full-screen blur with a 10% wash over it.
   backdrop-filter rather than a filter on the page, because the page is not
   one element: this takes in everything painted before it inside .blurwrap
   (the strip and the about document) and leaves everything painted after it
   sharp — the wordmark, Services, the plus and the form itself. The footer is
   painted after too, so it is blurred separately below. */
.scrim{
  position:absolute;
  inset:0;
  backdrop-filter:blur(15px);
  -webkit-backdrop-filter:blur(15px);
  background:var(--scrim);
  opacity:0;
  pointer-events:none;
  transition:opacity 380ms var(--ease);
}
/* opacity only — NEVER pointer-events. The menu is modal to clicks but not to
   scroll, and this has to behave the same way: a scrim that accepted the
   pointer would sit between the wheel and .about and the page would freeze
   behind the form. Dismissal is the capture-phase guard's job. */
body.head-contact-open .scrim{opacity:1}

/* The footer sits outside .blurwrap and paints after the scrim, so it needs
   its own blur. A filter on the footer is safe where a filter on an ANCESTOR
   of the wordmark would not be: mix-blend-mode composes after the element's
   own filter, so the blurred footer still blends with the page beneath it. */
.footer{transition:filter 380ms var(--ease)}
body.head-contact-open .footer{filter:blur(15px)}

/* The cursor badge. Replaces the native zoom-in/zoom-out cursors, which named
   a magnifier when what actually happens is the column changing width. Same
   30px frosted chip and same glyph as the menu button — the site's own
   control, just carried on the pointer.

   TWO elements, and it has to stay that way. The outer one only positions and
   is never transitioned, so it tracks the cursor exactly; the inner one does
   the pop. Scaling the outer element instead made it drift in from the top
   left: the individual `scale` property is composed BEFORE the `transform`
   property, so at scale .86 the translate to the cursor was also multiplied by
   .86 and the badge sat 14% of the way back toward the origin until the scale
   finished. */
.cursor-tip{
  position:fixed;
  left:0;top:0;
  z-index:60;
  pointer-events:none;
  transform:translate3d(var(--tx,0),var(--ty,0),0);
  /* its own compositor layer: it moves with every pointermove, and without
     this the frosted fill is re-sampled against the page on the main thread
     each time, which is the likeliest cause of the cursor flickering */
  will-change:transform;
}
.tip-chip{
  display:flex;align-items:center;justify-content:center;
  position:relative;
  /* ONE BADGE THAT CHANGES ITS WORD (2026-09-26): the width is set in whole
     pixels by setTip (--tip-w, the word plus 15 a side) and glides, and the
     glyphs and the word cross-fade on top of each other, instead of the circle
     and the "Open" pill swapping in a single frame. Appearing, it takes its
     new look at once (.no-morph) and pops as before. */
  width:var(--tip-w,var(--chip-h));height:var(--chip-h);
  border-radius:var(--chip-r);      /* a circle at its height, a pill once the word widens it */
  color:var(--ink);        /* or the word stays dark on the dark theme's chip */
  background-color:var(--chip);
  /* the same frost as the menu button, so the badge reads as one of the
     site's own controls rather than a floating swatch */
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  opacity:0;
  /* the scale sits last in the list, so it scales the glyph and not the
     offset that places it above the cursor */
  transform:translate(-50%,-100%) scale(.72);
  transition:opacity 150ms var(--ease),
             transform 260ms cubic-bezier(.34,1.4,.64,1),
             width 560ms cubic-bezier(.45,0,.2,1),   /* slow enough to see it change size (2026-11-13, his note: Open → plus "just changes") */
             background-color 200ms var(--ease);
}
.tip-chip > *{position:absolute;left:50%;top:50%;translate:-50% -50%}
.tip-chip.no-morph,
.tip-chip.no-morph *{transition:none !important}
.cursor-tip.is-on .tip-chip{
  opacity:1;
  transform:translate(-50%,-100%) scale(1);
}

/* Opening a project is the interaction the whole site hangs on, so that one
   gets a word rather than a glyph — a pill in the same frosted family. */
.tip-text{display:block;font-size:var(--fs-s);line-height:1;white-space:nowrap;color:var(--ink);opacity:0;transition:opacity 160ms var(--ease)}
.cursor-tip .plus{transition:transform 420ms var(--ease),opacity 160ms var(--ease)}
/* word → circle: the word goes as the pill starts to narrow, the plus arrives
   once it is mostly a circle, so the shrink reads between them */
.cursor-tip:not(.is-label) .plus{transition:transform 420ms var(--ease),opacity 260ms var(--ease) 240ms}
.cursor-tip:not(.is-label) .tip-text{transition:opacity 180ms var(--ease)}
.cursor-tip.is-label .plus{opacity:0}
.cursor-tip.is-label .tip-text{opacity:1}

/* Near the foot of the project page the badge becomes a down arrow — Figma
   793:1437, a 45-degree head spanning the full glyph box, which is the same
   visual extent as the plus beside it.

   NOT called `.arrow`: that class already belongs to the carousel's prev/next
   buttons, which paint arrow.svg as a BACKGROUND IMAGE. Reusing the name put a
   right-pointing arrow on top of this one. */
.cursor-tip .tip-arrow{
  display:block;
  opacity:0;
  transition:opacity 160ms var(--ease);
  width:12px;height:12px;
  flex:0 0 auto;
  fill:none;
  stroke:var(--ink);
  stroke-width:1;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.cursor-tip.is-down .tip-arrow{opacity:1}
.cursor-tip .tip-arrow{transform:translateY(-1px)}   /* optical, as .arrow: 1px towards its tail */
/* THE JOURNEY'S OWN STATES (2026-09-22): the invitation as a word — the same
   pill the strip's Open uses, in the chip's grey — and then the carousel's
   arrow, turned toward the next stage. Both ride ABOVE the pointer, like
   every other badge on the site. */
.cursor-tip .tip-go{
  display:block;
  opacity:0;
  width:12px;height:12px;
  flex:0 0 auto;
  fill:none;stroke:var(--ink);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;
  transform:rotate(var(--pj-a,0deg)) translateX(-1px);   /* optical, as .arrow — inside the turn, so always towards the tail */
  transition:transform 300ms var(--ease),opacity 160ms var(--ease);
}
.cursor-tip.is-go .tip-go{opacity:1}
.cursor-tip.is-go .plus{opacity:0}
/* over the left quarter of the stage the same arrow turns round: that press
   goes back (2026-09-23) */
.cursor-tip.is-back .tip-go{transform:rotate(180deg) translateX(-1px)}

/* The phone's "next project" button: the menu button's chip with the badge's
   down arrow, under the last image at the right. Desktop has the cursor badge's
   down band instead. */
.proj-next{display:none}
.next-arrow{
  width:12px;height:12px;
  transform:translateY(-1px);   /* optical, as .arrow */
  fill:none;
  stroke:var(--ink);
  stroke-width:1;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.cursor-tip.is-down .plus{opacity:0}

/* SENT / ERROR (see flashTip): the same chip, green with a check drawn in, or
   red with the plus swung round into an X — one rotation of the whole glyph,
   the way the menu's plus becomes its close. */
.cursor-tip .tip-check{display:block;opacity:0;width:12px;height:12px;fill:none;stroke:#111111;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:14;stroke-dashoffset:14;transition:opacity 160ms var(--ease)}
.cursor-tip.is-sent .tip-chip{background-color:#34c759;backdrop-filter:none;-webkit-backdrop-filter:none}
.cursor-tip.is-sent .plus{opacity:0}
.cursor-tip.is-sent .tip-check{opacity:1;stroke-dashoffset:0;transition:opacity 160ms var(--ease),stroke-dashoffset 420ms var(--ease) 120ms}
.cursor-tip.is-error .tip-chip{background-color:var(--contact-error);backdrop-filter:none;-webkit-backdrop-filter:none}
.cursor-tip.is-error .plus{stroke:#ffffff;transform:rotate(90deg)}

/* plus → minus: the vertical bar swings down and BECOMES the minus, while the
   horizontal one shrinks to nothing from its middle (Anthony, 2026-11-14). The
   two are never stacked: fading the swung bar out read as fussy, and keeping it
   whole until it landed showed a doubled, bold minus for a moment before one
   layer vanished. The stroke keeps its weight as a bar shrinks. Back to the
   plus, the horizontal bar grows out again as the other swings up. */
.cursor-tip .plus path{
  transform-box:fill-box;
  transform-origin:center;
  vector-effect:non-scaling-stroke;
}
.cursor-tip .plus path:first-child{transition:transform 240ms var(--ease)}
.cursor-tip .plus path:last-child{transition:transform 320ms var(--ease)}
.cursor-tip.is-minus .plus path:first-child{transform:scale(0)}
.cursor-tip.is-minus .plus path:last-child{transform:rotate(90deg)}
