/* Kariem OS · the top bar (bar.js). One bar, every screen, every width.
   Rhythm follows me.kariem.dev's SiteHeader: the row is 32px, the padding
   breathes with the viewport (clamp), never a jump at a breakpoint. */
.bar{position:sticky;top:0;z-index:40;display:flex;align-items:center;gap:10px;
  padding:clamp(8px,1.6vw,14px) var(--s-4);padding-top:max(clamp(8px,1.6vw,14px),env(safe-area-inset-top));
  background:rgb(var(--bg)/.86);-webkit-backdrop-filter:blur(14px) saturate(1.2);backdrop-filter:blur(14px) saturate(1.2);
  border-bottom:1px solid transparent;transition:border-color .2s var(--ease)}
.bar.under{border-bottom-color:rgb(var(--line))}
@media(min-width:1280px){.bar{padding-inline:var(--s-6)}}

/* the lockup: mark leads, the word follows. On a desktop the side nav already
   sits beside it, so the word stays; on a phone the trail needs the room. */
.bt-mark{display:flex;align-items:center;gap:8px;flex:none;min-height:44px;color:rgb(var(--fg));text-decoration:none}
.bt-mark:focus-visible{outline:2px solid rgb(var(--accent));outline-offset:3px;border-radius:8px}
.bm-wrap{display:block;width:30px;height:30px}
.bm{display:block;width:30px;height:30px;overflow:visible}
.bm-card{transform-origin:32px 32px;transform:rotate(var(--b,0deg));transition:transform .7s cubic-bezier(.16,1,.3,1)}
/* At 30px a 90-degree turn of a symmetric 8-point rose is invisible, so the
   bar's rose lights north alone (the portfolio's one break in symmetry, made
   the whole signal): the accent point is the bearing you read. */
.bm-lit{fill:currentColor;fill-opacity:.62}
.bm-shade{fill:currentColor;fill-opacity:.3}
.bm-n.bm-lit{fill:rgb(var(--accent));fill-opacity:1}
.bm-n.bm-shade{fill:rgb(var(--accent));fill-opacity:.7}
.bm-hub{fill:rgb(var(--bg));stroke:currentColor;stroke-opacity:.7;stroke-width:1}
.bt-mark:hover .bm-card{transform:rotate(calc(var(--b,0deg) + 8deg))}
.bt-word{font:600 14px/1 var(--mono);letter-spacing:.02em;white-space:nowrap}
.bt-word b{color:rgb(var(--accent));font-weight:700}
@media(max-width:899px){.bt-word{display:none}}

/* the trail: where you are, the step above you is a link */
.bt-trail{display:flex;align-items:center;gap:6px;min-width:0;flex:1 1 auto;overflow:hidden;font:600 15px/1.2 var(--display);white-space:nowrap}
.bt-step{all:unset;cursor:pointer;color:rgb(var(--fg-3));font:500 14px/1.2 var(--display);padding:12px 0;flex:none}
.bt-step:hover{color:rgb(var(--fg))}
.bt-step:focus-visible{outline:2px solid rgb(var(--accent));outline-offset:2px;border-radius:4px}
.bt-here{color:rgb(var(--fg));overflow:hidden;text-overflow:ellipsis;min-width:0}
.bt-here.mono{font:500 12.5px var(--mono)}
.bt-sep{flex:none;width:5px;height:5px;border-inline-start:1.5px solid rgb(var(--fg-4));border-bottom:1.5px solid rgb(var(--fg-4));transform:rotate(45deg);margin-inline:2px}
@media(min-width:900px){.bt-trail{padding-inline-start:14px;margin-inline-start:4px;border-inline-start:1px solid rgb(var(--line))}}

.bt-end{display:flex;align-items:center;gap:4px;flex:none;margin-inline-start:auto}

/* alive: a solid dot breathing; offline: hollow, the time it last heard */
.bl{display:flex;align-items:center;gap:6px;padding:0 6px;min-height:44px;font:500 11.5px var(--sans);color:rgb(var(--fg-3))}
.bl i{width:7px;height:7px;border-radius:50%;background:rgb(var(--ok));box-shadow:0 0 0 0 rgb(var(--ok)/.5);animation:blb 2.4s ease-out infinite}
.bl.off i{background:none;border:1.5px solid rgb(var(--needs));animation:none}
.bl.off{color:rgb(var(--needs))}
@keyframes blb{0%{box-shadow:0 0 0 0 rgb(var(--ok)/.45)}70%,100%{box-shadow:0 0 0 7px rgb(var(--ok)/0)}}
@media(max-width:899px){.bl:not(.off) .bl-tx{display:none}}

/* waiting on you: the dotted stroke = something said, waiting for a decision */
.bw{display:flex;align-items:center;gap:6px;min-height:44px;padding:0 10px;text-decoration:none;color:rgb(var(--compass))}
.bw span:first-child{min-width:24px;height:24px;padding:0 6px;border-radius:12px;border:1.4px dashed rgb(var(--compass));display:grid;place-items:center;font:600 12.5px var(--sans)}
.bw-tx{font:500 12px var(--sans)}
.bw:focus-visible{outline:2px solid rgb(var(--compass));outline-offset:2px;border-radius:12px}
@media(max-width:899px){.bw-tx{display:none}.bw{padding:0 6px}}

/* quota: two hairline rules, 5h above 7d */


/* the side nav lost its brand row and search to the bar: it starts at the
   bar's height so the first tab lines up under the lockup */
@media(min-width:900px){.side{padding-top:calc(var(--s-4) + 52px)}}
@media(prefers-reduced-motion:reduce){.bm-card{transition:none}.bl i{animation:none}}

/* the bar's trail names the screen, so a page's own title repeating it is
   kept for screen readers only; its lead paragraph stays */
.screen > .hello > h1,.screen > .pl-top .hello > h1,.cl-head > h2{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.cl-head{margin-top:0}
.screen > .hello{padding-top:2px}
.pl-back{display:none}

.bt-back{all:unset;cursor:pointer;display:none;place-items:center;width:36px;height:44px;margin-inline-start:-8px;color:rgb(var(--fg-2));flex:none}
.bt-back svg{width:20px;height:20px}
.bt-back:focus-visible{outline:2px solid rgb(var(--accent));outline-offset:-4px;border-radius:8px}
@media(max-width:899px){
  .bt-back{display:grid}
  .bt-trail .bt-step,.bt-trail .bt-sep{display:none}
  .bt-trail:has(.bt-back) ~ * {}
  main#main{padding-top:var(--s-2)}
}

/* the hub of the rose is the heartbeat: on a phone it carries "live" alone */
.bar.is-live .bm-hub{fill:rgb(var(--ok));stroke:rgb(var(--ok));stroke-opacity:.35;stroke-width:3;animation:hub 2.4s ease-in-out infinite}
.bar.is-off .bm-hub{fill:rgb(var(--bg));stroke:rgb(var(--needs));stroke-opacity:1;stroke-width:1.4}
@keyframes hub{50%{stroke-opacity:.08}}
@media(max-width:899px){.bl:not(.off){display:none}}
/* deep in a page on a phone the name gets the room: quota folds to its 7-day rule */
@media(prefers-reduced-motion:reduce){.bar.is-live .bm-hub{animation:none}}
/* quota: one twin-spark per Max account (K = Kariem, S = seha-we-afya). Ring = 5h window, 12 rays = 7d, same mark as Home */
.bq{all:unset;cursor:pointer;display:flex;align-items:center;gap:10px;padding:4px 10px;min-height:44px;border-radius:10px}
.bq:focus-visible{outline:2px solid rgb(var(--accent));outline-offset:2px;border-radius:6px}
.ms{display:block;overflow:visible}
.ms-bg{fill:none;stroke:rgb(var(--fg-3));stroke-opacity:.28;stroke-width:6}
.ms-rg{fill:none;stroke:rgb(var(--fg-2));stroke-width:7;stroke-linecap:round}
.ms-dim line{stroke:rgb(var(--fg-3));stroke-opacity:.34;stroke-width:9;stroke-linecap:round}
.ms-lit line{stroke:rgb(var(--fg-2));stroke-width:9;stroke-linecap:round}
.ms.warm .ms-rg,.ms.warm .ms-lit line{stroke:rgb(var(--needs))}
.ms.hot .ms-rg,.ms.hot .ms-lit line{stroke:rgb(var(--bad))}
.ms-t{font:700 34px var(--sans);fill:rgb(var(--fg-3));direction:ltr}
@media(max-width:360px){.bq{display:none}}
@media(max-width:400px){.bar.deep .bq{display:none}}

/* quota popover: both Max accounts, both windows, and when each comes back.
   A rule = how much is used; the notch on it = how far the clock has gone.
   Fill past the notch means the window is being burned faster than time. */
.bq:hover,.bq[aria-expanded="true"]{background:rgb(var(--fg-3)/.12)}
.qp{position:absolute;top:calc(100% + 6px);inset-inline-end:var(--s-4);z-index:41;width:min(372px,calc(100vw - 16px));
  background:rgb(var(--surface));border:1px solid rgb(var(--line));border-radius:14px;
  box-shadow:0 18px 40px -18px rgb(0 0 0/.55);animation:qpin .18s var(--ease) both;
  max-height:calc(100dvh - 140px);overflow-y:auto;overscroll-behavior:contain}
.qs{position:fixed;inset:0;z-index:39;background:rgb(var(--bg)/.55);animation:qsin .18s var(--ease) both}
@keyframes qsin{from{opacity:0}}
@keyframes qpin{from{opacity:0;transform:translateY(-4px)}}
@media(max-width:480px){.qp{inset-inline:8px;width:auto}}
@media(min-width:1280px){.qp{inset-inline-end:var(--s-6)}}
.qp-in{padding:6px 14px 12px}
.qa{padding:12px 0 14px;border-bottom:1px solid rgb(var(--line))}
.qa-h{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.qa-id{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.qa-id b{font:600 15px/1.2 var(--display);color:rgb(var(--fg))}
.qa-s{font:500 12px/1.2 var(--sans);color:rgb(var(--fg-3))}
.qa.shut .qa-s{color:rgb(var(--bad))}
.qa-age{display:flex;align-items:center;gap:6px;font:500 11px/1.3 var(--sans);color:rgb(var(--fg-3));text-align:end;max-width:46%}
.qa-age i{flex:none;width:6px;height:6px;border-radius:50%;background:rgb(var(--ok))}
.qa-age.old,.qa-age.bad{color:rgb(var(--needs))}
.qa-age.old i,.qa-age.bad i{background:none;border:1.5px solid rgb(var(--needs))}
.qa-age.bad{color:rgb(var(--bad))}.qa-age.bad i{border-color:rgb(var(--bad))}
.qa-age.busy i{background:rgb(var(--fg-3));animation:qbusy 1s ease-in-out infinite}
@keyframes qbusy{50%{opacity:.2}}
.qa.meas .qw{opacity:.55;transition:opacity .2s var(--ease)}
.qp-e{margin:10px 0 0;font:500 12px/1.5 var(--sans);color:rgb(var(--bad))}
.qw{margin-top:10px}
.qw:first-of-type{margin-top:0}
.qw-h{display:flex;align-items:baseline;gap:8px}
.qw-l{font:600 13px var(--display);color:rgb(var(--fg-2))}
.qw-p{font:500 11.5px var(--sans);color:rgb(var(--fg-3));margin-inline-end:auto}
.qw-n{font:700 15px var(--sans);color:rgb(var(--fg));font-variant-numeric:tabular-nums}
.qw.warm .qw-n,.qw.warm .qw-p{color:rgb(var(--needs))}
.qw.hot .qw-n,.qw.hot .qw-p{color:rgb(var(--bad))}
.qw-r{position:relative;height:7px;margin:7px 0 6px;border-radius:4px;background:rgb(var(--fg-3)/.2)}
.qw-f{position:absolute;inset-block:0;inset-inline-start:0;width:0;border-radius:4px;background:rgb(var(--fg-2))}
.qw.warm .qw-f{background:rgb(var(--needs))}
.qw.hot .qw-f{background:rgb(var(--bad))}
.qw-t{position:absolute;inset-block:-4px;width:2px;margin-inline-start:-1px;border-radius:1px;background:rgb(var(--fg));opacity:.85}
.qw-w{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 8px;font:500 12px/1.4 var(--sans);color:rgb(var(--fg-3))}
.qw-w b{color:rgb(var(--fg));font-weight:600}
.qw-d{color:rgb(var(--fg-3));margin-inline-start:auto}
.qp-k{display:flex;align-items:center;gap:8px;margin:10px 0 0;font:500 11px/1.5 var(--sans);color:rgb(var(--fg-4))}
.qp-kt{position:static;flex:none;height:12px;margin:0 3px}
@media(prefers-reduced-motion:reduce){.qp,.qs,.qa-age i{animation:none}.qa.meas .qw{transition:none}}
.qa-mute{opacity:.45}
.qp-k span{min-width:0}
.qp-kt{margin:0 4px}
