/* ---------- header actions ---------- */

/* Get in touch and Services join the menu button on the About page and
   nowhere else (Figma 794:1732 / 794:1563). 10px apart, not the usual 20 —
   they are one control cluster, not three separate things. */
/* flex-start, not center: when the card opens this group becomes 500-odd
   pixels tall, and centring it on the header's 30px content box would hang it
   half above the top of the screen. Top-aligned it grows straight down from
   y=20, and while it is closed every item in the row is 30px so the two are
   identical. The wordmark keeps the header's own centring. */
.head-actions{
  display:flex;
  align-items:flex-start;
  align-self:flex-start;
  gap:10px;
  /* THE ROW MAY BE WIDER THAN ITS ROOM, AND THEN IT SPILLS LEFT (2026-09-24).
     The parked (hidden) controls below still take their width, and on a
     narrow laptop window the row out-grew the space and squeezed the wordmark
     onto three lines (820 wide; the Process page's Text · Journey switch made
     it worse). The row now takes the free space and packs to the RIGHT, so any
     overflow goes out of its left edge — where only the parked, invisible
     controls are — and the wordmark keeps its one line. */
  flex:1 1 0;
  min-width:0;
  justify-content:flex-end;
}
.head-actions > *{flex-shrink:0}   /* spill, never squeeze: a squeezed Back went to 0 wide */
.header .wordmark{flex:none;white-space:nowrap}


/* Both extra controls are hidden by default and arrive with the page, on the
   same curve and the same beat as its copy. visibility rather than display so
   the row's geometry is settled before they fade in. */
/* HIDDEN CONTROLS STILL TAKE UP ROOM — `visibility:hidden` keeps the box. The
   About page's controls and the project page's index share this one row, so
   on About the invisible index sat between Services and the plus as a large
   empty gap. Hidden controls are therefore sent to the FAR LEFT with
   `order:-1`, where their width only widens the row away from anything you
   can see. The order change waits until the fade-out has finished (it is
   delayed like `visibility`), or a control would jump across the header while
   it was still visibly fading.
   AND AN ARRIVING CONTROL WAITS FOR IT (`--swap`). Taking its place at once, it
   pushed the still-visible leaving ones sideways: leaving About for the strip,
   Get in touch and Services jumped 317px left as Feed · Index swapped in, then
   faded out (Anthony, 2026-09-14). Now nothing arrives in the row until the
   leaving controls have parked at the far left, so the swap happens in one
   frame with nothing visible in it. Every view-scoped control uses it. */
.head-contact{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  order:-1;
  transition:opacity 260ms var(--ease),visibility 0s linear 260ms,
             order 0s linear 260ms;
}
/* GET IN TOUCH HAS LEFT THE HEADER (Anthony, 2026-09-16). It used to appear on
   About and Services, where it was the only 30px SOLID pill beside a segmented
   switch whose own selected pill is 24px inside its track — which is what read
   as "not the same size" (every control is 30px; measured). It is also
   redundant there: anyone on either page has the + menu, the Services page ends
   with a Get in touch card, and About lists the email. So the card that grew
   out of this pill is no longer reachable — the markup, the clone and
   `setupContact` stay for whenever it is wanted again. */

/* The index belongs to the project page the way Get in touch and Services
   belong to About: it appears with the view and leaves with it. */
.proj-index{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  order:-1;                    /* see .head-contact: hidden controls go left */
}
/* This re-declares `transition`, so the list has to stay in step with the one
   above it — anything missing here simply does not animate while the project
   page is open, which is the only time this control is ever on screen. That is
   how `padding` came to snap. */
body.project-open .proj-index{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  order:0;
  transition:width var(--open) var(--glide),
             padding-bottom var(--open) var(--glide),
             background-color var(--hover) var(--ease),
             opacity 340ms var(--ease) var(--swap),
             visibility 0s var(--swap),
             order 0s var(--swap),
             filter 520ms var(--ease);
}

/* With the menu open, Get in touch and Services already exist inside the
   panel, so the pair in the header must not stand as a second copy of the same
   two controls: they join the backdrop and blur with it, on the same 520ms
   curve as .blurwrap, and they stop taking the pointer. The index gets the
   same treatment for the same reason the menu is modal at all — nothing behind
   the panel is live. The plus is the one thing here that stays sharp: it is
   what closes the menu again.
   AFTER the about-open / project-open rules, and at the same specificity, so
   it wins.

   4px, not the page's 24: at 24 a 30px control blurs away to nothing, and they
   should read as blurred buttons, not vanish. And the FROST GOES OFF while they
   are blurred — a backdrop-filter keeps its own edge crisp under `filter`, so
   the chips stayed as sharp empty shapes while their words and glyphs were
   blurred out of them (Anthony reported it on the project page, 2026-09-14).
   Behind a 24px-blurred page the frost is invisible anyway. */
/* ON THEIR OWN FILTER LAYER FROM THE START. Promoted only when the menu opened,
   iOS Safari rebuilt the layer on the next repaint — flipping the theme switch —
   and drew each control as a hard-edged white box. Tested on Anthony's iPhone
   (2026-09-14) against removing the frost and against a plain fade. */
.head-contact,
.proj-index,
.head-back,
.view-seg{will-change:filter}
/* (2026-09-23: this rule had lost its body — a later block was pasted into
   the middle of its selector list, so these controls stayed sharp and live
   behind the menu. Restored, to match .view-seg below.) */
body.menu-open .head-contact,
body.menu-open .proj-index,
body.menu-open .head-back{filter:blur(4px);backdrop-filter:none;-webkit-backdrop-filter:none;pointer-events:none}

/* THE START PANEL OVER THE PROCESS PAGE APPEARS (2026-09-21): no growth out
   of a card — it fades up where it rests, a touch small becoming full size,
   and its words follow straight away rather than waiting for a growth that
   is not happening. Closing, it fades away where it is. `scale`, the
   individual property, so the drag's `transform` is left alone. */
body.jr-appear{--jr-open:0ms}   /* and app.js fills it at once */
body.jr-appear.journal-open .jr-card{animation:jr-appear 480ms var(--ease) both}
body.jr-appear-out .jr-card{animation:jr-disappear 360ms var(--ease) both}
@keyframes jr-appear{from{opacity:0;scale:.97}to{opacity:1;scale:1}}
@keyframes jr-disappear{from{opacity:1;scale:1}to{opacity:0;scale:.98}}
@media (prefers-reduced-motion: reduce){
  body.jr-appear.journal-open .jr-card,body.jr-appear-out .jr-card{animation-duration:1ms}
}

/* the picture beside the pointer over a service stage — the Index's preview
   (.wl-media): 200 × 250, corner 15, the same fades; pictures cross-fade */
.tl-peek{
  position:fixed;top:0;left:0;
  width:200px;height:250px;
  border-radius:10px;overflow:hidden;
  background:var(--surface);
  opacity:0;pointer-events:none;
  will-change:transform;
  z-index:30;
  transition:opacity 200ms var(--ease);
}
.tl-peek.is-showing{opacity:1;transition:opacity 260ms var(--ease)}
.tl-peek img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity 260ms var(--ease)}
.tl-peek img.is-on{opacity:1}
@media (max-width:768px),(hover:none){.tl-peek{display:none}}

/* ---------- search, on the Index (2026-09-21) ----------
   The icon family's round chip; pressed, it widens into a field to its right
   (the header's actions are pinned right, so the group grows leftwards and
   Feed · Index, to its left, is carried along). It sits next to the plus.
   The chip is the pill; the button inside it is transparent. On a phone the
   Feed · Index switch gives way while it is open — no room for both. */
.head-search{
  display:flex;
  align-items:center;
  height:var(--chip-h);
  border-radius:var(--chip-r);
  background-color:var(--chip);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  /* AWAY FROM THE INDEX IT TAKES NO ROOM (2026-09-21). It used to be
     display:none, so arriving on the Index made room for it in one frame and
     Feed · Index jumped 40px left (Anthony: "it'd be nice if it smoothly moved
     to the left and then the search button appeared"). Now it is always in
     the row, pulled back under the switch by its own width and the gap
     (-40px) and invisible; on the Index the margin opens on --glide, the
     switch travels left, and only then does the chip fade in. Leaving, the
     chip goes first and the room closes after it. */
  margin-left:calc(-1 * (var(--chip-h) + 10px));   /* its own width and the gap */
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:background-color var(--hover) var(--ease),
             opacity 160ms var(--ease),
             visibility 0s linear 160ms,
             margin-left 420ms var(--glide) 120ms,
             filter 520ms var(--ease);
}
body.worklist-open .head-search{
  margin-left:0;
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transition:background-color var(--hover) var(--ease),
             margin-left 420ms var(--glide),
             opacity 260ms var(--ease) 300ms,
             visibility 0s linear 300ms,
             filter 520ms var(--ease);
}
@media (hover:hover){.head-search:not(.is-open):hover{background-color:var(--chip-hover)}}.head-search:not(.is-open).is-pressed{background-color:var(--chip-hover)}
/* a search is standing (the field folded away with words in it): the chip is
   filled — the solid pill's colours — so the list reads as filtered */
.head-search.has-query{background-color:var(--contact-pill)}@media (hover:hover){.head-search.has-query:hover{background-color:var(--contact-pill)}}.head-search.has-query.is-pressed{background-color:var(--contact-pill)}
.head-search.has-query .hs-glyph{stroke:var(--contact-ink)}
.head-search .hs-btn{background-color:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}@media (hover:hover){.head-search .hs-btn:hover{background-color:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}}.head-search .hs-btn.is-pressed{background-color:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}
.hs-glyph{width:12px;height:12px;fill:none;stroke:var(--ink);stroke-width:1;stroke-linecap:round}
.hs-field{
  width:0;
  padding:0;
  border:0;
  background:transparent;
  font:inherit;
  font-size:var(--fs-s);
  color:var(--ink);
  outline:none;
  -webkit-appearance:none;
  appearance:none;
  transition:width 360ms var(--ease),padding 360ms var(--ease);
}
.hs-field::placeholder{color:var(--ink);opacity:.4}
.hs-field::-webkit-search-cancel-button,.hs-field::-webkit-search-decoration{display:none;-webkit-appearance:none}
.head-search.is-open .hs-field{width:180px;padding-right:20px}
body.menu-open .head-search{filter:blur(4px);backdrop-filter:none;-webkit-backdrop-filter:none;pointer-events:none}
/* nothing matched */
.wl-none{padding:10px 0;font-size:16px}
@media (max-width:768px){
  /* room beside the wordmark: the window less the wordmark, the plus and their gaps */
  .head-search.is-open .hs-field{width:min(180px, calc(100vw - 250px))}
  /* Feed · Index GIVES WAY as the field grows, on the field's own clock — it
     narrows to nothing and fades, and its gap goes with it — so the header
     never jumps (it used to vanish in one frame). The transition list repeats
     the switch's own (a declaration replaces the whole list), plus the three
     it needs here. */
  body.worklist-open #viewSeg{
    max-width:160px;
    overflow:hidden;
    transition:opacity 260ms var(--ease),visibility 0s linear 260ms,order 0s linear 260ms,filter 520ms var(--ease),
               max-width 360ms var(--ease),padding 360ms var(--ease),margin 360ms var(--ease);
  }
  body.worklist-open.search-open #viewSeg{max-width:0;padding-left:0;padding-right:0;margin-right:-10px;opacity:0;pointer-events:none}
}

body.menu-open .view-seg{
  filter:blur(4px);
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
  pointer-events:none;
}

/* THE THEME CHANGED BEHIND AN OPEN MENU. iPhone Safari keeps the blurred page
   as a finished picture and does not always redraw it when the colours under
   the blur change — so picking Dark left the page behind the menu white, and
   Light left it black (Anthony, 2026-09-15). Each theme change flips
   `blur-nudge`, moving every blur by a hundredth of a pixel on its normal
   520ms transition: invisible, but a running filter animation has to be
   redrawn on every frame, straight through the 420ms colour fade. */
body.menu-open.blur-nudge .blurwrap{filter:blur(24.01px)}
body.menu-open.blur-nudge .head-contact,
body.menu-open.blur-nudge .proj-index,
body.menu-open.blur-nudge .head-back,
body.menu-open.blur-nudge .view-seg{filter:blur(4.01px)}

/* Back. The home page's prev arrow (`.arrow.prev` supplies the glyph, the
   rotation and the dark-theme swap), shown on every page that is not the
   strip. Always immediately left of the plus, so it sits in the same place
   whatever else the header is carrying. Add a new page's body class to the
   shown rule and it gets one too. Fades and parks exactly like the other
   view-scoped controls. */
.head-back{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  order:-1;
  transition:background-color var(--hover) var(--ease),
             opacity 260ms var(--ease),visibility 0s linear 260ms,
             order 0s linear 260ms,filter 520ms var(--ease);
}
body.project-open .head-back,
body.about-open .head-back,
body.doc-open .head-back,
body.services-open .head-back{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  order:0;
  transition:background-color var(--hover) var(--ease),
             opacity 340ms var(--ease) var(--swap),visibility 0s var(--swap),
             order 0s var(--swap),filter 520ms var(--ease);
}


/* The card grows LEFT and DOWN from the pill's top-right corner, and the two
   controls beside it never move — which falls out of the layout rather than
   being arranged. `.head-actions` is the last item of a `space-between` header,
   so it is pinned to the right edge: widening anything inside it pushes the
   group's LEFT edge out and leaves Services and the plus exactly where they
   were. Figma 794:1735: 360 wide, 15px radius, opening at the pill's own top.

   --pill-w is measured once at boot. The closed width has to be a concrete
   number for `width` to interpolate at all — `max-content` and `auto` do not
   animate — and the property itself never changes, so this is not the
   uninterpolatable-custom-property trap the project page hit. */
.head-contact .contact{
  width:var(--pill-w,auto);
  transition:
    background-color var(--hover) var(--ease),
    width var(--contact-open) var(--glide);
}
.head-contact .contact.is-open{
  width:360px;
  backdrop-filter:blur(100px);
  -webkit-backdrop-filter:blur(100px);
}
/* nothing in the card may shrink as it grows — the fields are laid out at the
   final width from the first frame, so the text inside never reflows twice */
.head-contact .contact-fields{width:360px}
/* Figma pads the card 10 at the top and 20 elsewhere, so the label sits closer
   to the top edge than the fields do to the bottom. The pill's own 30px row is
   unchanged in both states, which is what keeps the words from shifting. */
.head-contact .contact-fields{padding:10px var(--word-x) 20px}
