/* zacharybhenley.com v16: shared chrome (nav, mobile menu, command palette, footer,
   copy email, back link, page transitions). Markup is rendered by chrome.js into
   <header class="nav" data-chrome="nav"></header> and <footer class="site-foot" data-chrome="footer"></footer>. */

/* cross-document view transitions: the nav stays put, the page cross-fades and lifts */
@view-transition { navigation: auto; }
.nav { view-transition-name: zbh-nav; }
.nav .brand svg { view-transition-name: zbh-mark; }   /* the nav mark only: a second one in the footer made the name duplicate */
::view-transition-old(root) { animation: zbh-out .28s var(--ease-io) both; }
::view-transition-new(root) { animation: zbh-in .5s var(--ease-out) both; }
@keyframes zbh-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes zbh-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 12px; }

/* nav */
.nav { position: fixed; inset: 0 0 auto; z-index: 40; height: 66px; display: flex; align-items: center; justify-content: space-between; gap: var(--sp2); padding: 0 var(--gut); transition: background-color .4s, border-color .4s; border-bottom: 1px solid transparent; }
.nav.scrolled { background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; font-size: 15.5px; letter-spacing: -.01em; white-space: nowrap; }
.brand svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.brand .dot { fill: var(--accent); stroke: none; transition: fill .6s; }
.nav-links { position: relative; display: flex; gap: 2px; padding: 4px; border-radius: var(--r-pill); border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.nav-links a { position: relative; z-index: 1; text-decoration: none; font-size: var(--t-small); color: var(--ink-2); padding: 7px 14px; border-radius: var(--r-pill); transition: color .25s; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current] { color: var(--ink); }
.nav-ind { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: var(--r-pill); background: var(--line-2); opacity: 0; transition: transform .5s var(--ease-out), width .5s var(--ease-out), opacity .3s; pointer-events: none; }
.nav-ind.on { opacity: 1; }
.nav-actions { display: flex; gap: 10px; align-items: center; }
.cmd-btn { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: transparent; cursor: pointer; color: var(--ink-2); font-size: 13px; transition: border-color .2s, color .2s; }
.cmd-btn:hover { color: var(--ink); border-color: var(--ink-2); }
.cmd-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink); transition: border-color .2s; }
.icon-btn:hover { border-color: var(--ink-2); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.theme-btn svg path { fill: currentColor; stroke: none; transition: transform .6s var(--ease-out); transform-origin: 12px 12px; }
:root[data-theme="light"] .theme-btn svg path { transform: rotate(180deg); }
.pill { text-decoration: none; font-size: 14px; font-weight: 500; padding: 9px 18px; border-radius: var(--r-pill); background: var(--ink); color: var(--bg); white-space: nowrap; transition: transform .35s var(--ease); }
.menu-btn { display: none; }
.menu-btn span { display: block; width: 16px; height: 1.4px; background: currentColor; transition: transform .4s var(--ease-out); }
.menu-btn span + span { margin-top: 5px; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.2px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.2px) rotate(-45deg); }
.menu-btn { flex-direction: column; justify-content: center; }
.sheet { position: fixed; z-index: 39; inset: 58px 0 auto; padding: var(--sp1) 16px var(--sp3); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.sheet a { display: flex; justify-content: space-between; align-items: center; padding: 14px 4px; font-size: 20px; letter-spacing: -.02em; text-decoration: none; border-bottom: 1px solid var(--line); }
.sheet a[aria-current] { color: var(--accent); }
.sheet a small { font: 400 11px/1 var(--mono); color: var(--muted); }
@media (max-width: 1080px) { .cmd-btn .cmd-txt { display: none; } }
@media (max-width: 1180px) { .nav-links a { padding: 7px 12px; } }
@media (max-width: 960px) { .nav-links a { padding: 7px 9px; } }
@media (max-width: 860px) {
  .nav { height: 58px; }
  .nav-links, .nav .pill { display: none; }
  .cmd-btn .cmd-txt, .cmd-btn kbd { display: none; }
  .cmd-btn { width: 38px; padding: 0; justify-content: center; }
  .menu-btn { display: flex; }
}
@media (min-width: 861px) { .sheet { display: none !important; } }

/* command palette */
.pal { position: fixed; inset: 0; z-index: 90; display: grid; justify-items: center; align-items: start; padding: 14vh 16px 16px; }
.pal-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.pal-box { position: relative; width: min(600px, 100%); border-radius: 18px; border-color: var(--line-2); overflow: hidden; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55); background: color-mix(in srgb, var(--bg-2) 90%, transparent); }
.pal-box::after { display: none; }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pal-in svg { width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 1.6; flex: none; }
.pal-in input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: 400 15px/1.4 var(--sans); color: var(--ink); }
.pal-in input::placeholder { color: var(--muted); }
.pal-list { list-style: none; margin: 0; padding: 6px; max-height: min(440px, 58vh); overflow: auto; }
.pal-g { padding: 10px 10px 4px; font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pal-i { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.pal-i code { font: 400 11px/1 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.pal-i[aria-selected="true"] { background: var(--line); }
.pal-i[aria-selected="true"] code { color: var(--accent); }
.pal-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--line); font: 400 11px/1 var(--mono); color: var(--muted); }

/* copy email */
.copy-btn { display: inline-flex; align-items: center; gap: 8px; }
.copy-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.copy-btn .ck { display: none; }
.copy-btn[data-done] { border-color: color-mix(in srgb, var(--ok) 60%, transparent); }
.copy-btn[data-done] .cp { display: none; }
.copy-btn[data-done] .ck { display: block; stroke: var(--ok); }

/* footer */
.site-foot { position: relative; padding: var(--sp8) var(--gut) var(--sp4); border-top: 1px solid var(--line); font-size: var(--t-small); color: var(--ink-2); }
.sf-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, .62fr)); gap: var(--sp5) var(--sp4); }
.sf-brand .brand { margin-bottom: var(--sp2); }
.sf-avail { margin: 0 0 var(--sp3); max-width: 44ch; line-height: 1.6; font-weight: 300; }
.sf-avail b { font-weight: 500; color: var(--ink); }
.sf-avail .live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); margin-right: 8px; vertical-align: 1px; }
.sf-cta { display: flex; flex-wrap: wrap; gap: var(--sp1); }
.sf-col h2 { margin: 0 0 var(--sp2); font: 500 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sf-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sf-col a { text-decoration: none; color: var(--ink-2); transition: color .2s; }
.sf-col a:hover, .sf-col a[aria-current] { color: var(--ink); }
.sf-col a[aria-current]::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 2px; }
.sf-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp1) var(--sp3); margin-top: var(--sp8); padding-top: var(--sp3); border-top: 1px solid var(--line); font: 400 11.5px/1.6 var(--mono); color: var(--muted); }
.sf-base p { margin: 0; }
.sf-base .pub { color: var(--ink-2); }
@media (max-width: 860px) {
  .sf-grid { grid-template-columns: 1fr 1fr; }
  .sf-brand { grid-column: 1 / -1; }
  .site-foot { padding-top: var(--sp6); }
}

/* back link for review builds, hidden inside iframes */
.zh-back { position: fixed; left: 14px; bottom: 14px; z-index: 50; font: 500 12px/1 var(--sans); padding: 8px 12px; border-radius: var(--r-pill); text-decoration: none; color: var(--ink-2); background: color-mix(in srgb, var(--bg) 80%, transparent); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

/* ---------- reading progress line (G3): 2px under the header, fills left to right ---------- */
.read-prog { position: absolute; left: 0; right: 0; top: calc(100% + 1px); height: 2px; pointer-events: none; opacity: 0; transition: opacity .35s var(--ease-out); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.read-prog.on { opacity: 1; }
.read-prog i { position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; will-change: transform; }

/* =====================================================================
   Phase 3 systems (Oct 7, 2026): edition chip, shortcuts sheet, header data pulse, breadcrumb
   ===================================================================== */
:root[data-theme="dark"] { --e-all: #9fb7ff; --e-ecom: #e7c58f; --e-data: #82d8c4; --e-ops: #c4a8ff; }
:root[data-theme="light"] { --e-all: #3553c2; --e-ecom: #8d5c14; --e-data: #0d7361; --e-ops: #6441bb; }

/* edition chip: the current edition, one tap to change it; a for/* page shows it locked */
.ed { position: relative; }
.ed-btn, .ed-locked { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 11px 0 13px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; transition: border-color .2s, color .2s; }
.ed-btn { cursor: pointer; }
.ed-btn:hover, .ed-btn[aria-expanded="true"] { color: var(--ink); border-color: var(--ink-2); }
.ed-locked { cursor: default; border-style: dashed; }
.ed-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); transition: background-color .6s, box-shadow .6s; }
.ed-dot[data-sw] { background: var(--sw); box-shadow: none; }
.ed-dot[data-sw="all"] { --sw: var(--e-all); } .ed-dot[data-sw="ecom"] { --sw: var(--e-ecom); } .ed-dot[data-sw="data"] { --sw: var(--e-data); } .ed-dot[data-sw="ops"] { --sw: var(--e-ops); }
.ed .chev, .ed .lk { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .75; transition: transform .35s var(--ease-out); }
.ed-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.ed-pop { position: absolute; z-index: 45; top: calc(100% + 10px); right: 0; width: 248px; padding: 10px; border-radius: 16px; border-color: var(--line-2); background: color-mix(in srgb, var(--bg-2) 97%, transparent); box-shadow: 0 30px 60px -28px rgba(0, 0, 0, .6); }
.ed-pop::after { display: none; }
.ed-k { margin: 4px 8px 6px; font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ed-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; font-size: 14px; color: var(--ink-2); }
.ed-opt:hover { background: var(--line); color: var(--ink); }
.ed-opt[aria-pressed="true"] { color: var(--ink); background: var(--line); }
.ed-opt[aria-pressed="true"]::after { content: ""; margin-left: auto; width: 10px; height: 5px; border-left: 1.6px solid var(--ink); border-bottom: 1.6px solid var(--ink); transform: translateY(-1px) rotate(-45deg); }
.ed-n { margin: 8px 8px 4px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.sheet-ed { display: flex; flex-wrap: wrap; gap: 6px; padding: 16px 4px 4px; }
.sheet-ed button { display: inline-flex; align-items: center; gap: 7px; padding: 9px 11px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: none; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.sheet-ed button[aria-pressed="true"] { color: var(--ink); border-color: var(--ink-2); background: var(--line); }
.sheet-ed--note { font: 400 12px/1.5 var(--mono); color: var(--muted); }
@media (max-width: 1120px) { .nav .ed-btn .ed-l { display: none; } .nav .ed-btn { padding: 0 11px; gap: 6px; } }
@media (max-width: 860px) { .nav .ed { display: none; } }

/* keyboard shortcuts sheet */
.ks { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 16px; }
.ks-back { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.ks-box { position: relative; width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 20px 22px 14px; border-radius: 20px; border-color: var(--line-2); background: color-mix(in srgb, var(--bg-2) 96%, transparent); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55); }
.ks-box::after { display: none; }
.ks-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ks-head h2 { margin: 0; font: 500 19px/1.2 var(--sans); letter-spacing: -.02em; }
.ks-x { width: 34px; height: 34px; }
.ks-g { margin: 18px 0 4px; font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ks-l { list-style: none; margin: 0; padding: 0; }
.ks-l li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.ks-l li:last-child { border-bottom: 0; }
.ks-k { display: inline-flex; align-items: center; gap: 6px; }
.ks-k i { font: 400 11px/1 var(--mono); font-style: normal; color: var(--muted); }
.ks-k kbd { min-width: 22px; text-align: center; padding: 4px 6px; color: var(--ink); }
.ks-hint { position: fixed; left: 50%; bottom: 22px; z-index: 60; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: color-mix(in srgb, var(--bg-2) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font: 400 11px/1 var(--mono); color: var(--muted); }
.ks-hint kbd { color: var(--ink); }

/* header data pulse (1280 px and wider): a quiet mono line under the brand, three real figures in turn */
.pulse { display: none; }
@media (min-width: 1280px) {
  .has-pulse .nav > .brand { position: relative; top: -7px; margin-right: auto; }
  .has-pulse .pulse { position: absolute; left: calc(var(--gut) + 36px); top: 41px; display: flex; align-items: center; gap: 8px; max-width: 360px; overflow: hidden; white-space: nowrap; text-decoration: none; font: 400 10.5px/13px var(--mono); letter-spacing: .01em; color: var(--muted); opacity: 0; transition: opacity .6s var(--ease-out), color .25s; }
  .has-pulse .pulse.on { opacity: 1; }
  .has-pulse .pulse.on.swap { opacity: 0; transition-duration: .3s; }
  .has-pulse .pulse.no-room { display: none; }
  .has-pulse .pulse:hover { color: var(--ink); }
  .pulse-d { flex: none; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
  .pulse b { font-weight: 500; color: var(--ink-2); transition: color .25s; }
  .pulse:hover b { color: var(--ink); }
  .pulse-t { overflow: hidden; }
}
@media (min-width: 1280px) and (max-width: 1399px) { .has-pulse .cmd-btn .cmd-txt { display: none; } .has-pulse .cmd-btn { width: auto; padding: 0 9px 0 11px; } .has-pulse .nav-links a { padding: 7px 12px; } }

/* breadcrumb: the same trail build16 writes as BreadcrumbList (chrome.js rewrites a page's own .crumbs in place) */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--sp3); font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.crumbs a { text-decoration: none; color: var(--ink-2); }
.crumbs a:hover { color: var(--ink); }
.crumbs-l { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.crumbs-l li { display: flex; gap: 8px; }
.crumbs-l li + li::before { content: "/"; }
.crumbs--float { position: absolute; z-index: 6; top: 86px; left: var(--gut); margin: 0; }
@media (max-width: 860px) { .crumbs--float { top: 76px; } }

/* phones: the header Menu opens a full-height sheet (the bottom tab bar was removed, Opus Oct 7) */
@media (max-width: 767px) {
  .sheet { max-height: calc(100dvh - 58px); overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(var(--sp3) + env(safe-area-inset-bottom)); animation: zbh-down .4s var(--ease-out) both; }
  .sheet a { padding: 15px 4px; font-size: 22px; }
}
@keyframes zbh-down { from { opacity: 0; transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
@media (min-width: 768px) and (max-width: 860px) { .sheet { animation: none; } }
