/* Reading Progress: a port of ddoemonn's 21st.dev component (MIT). reading-progress.js renders the tree and drives the
   springs; every size, colour and shadow below is the original's (Tailwind v4 utilities resolved to plain CSS).
   Colours are variables with a per-theme override (-l light, -d dark) that falls back to the original value:
     --fx-rp-fill-l/-d    #4568FF / #93B0FF                        (the fill)
     --fx-rp-track-l/-d   stone-100 / #1D1D1A                      (the recessed track)
     --fx-rp-text-l/-d    stone-500 / stone-400                    ("2 min left")
     --fx-rp-done-l/-d    stone-700 / stone-200                    ("✓ End · 2 min")
   Also here: the ddoemonn surface kit the demo sits in (.fx-mat-panel, .fx-mat-well, .fx-fade-y, .fx-no-bar and the
   ink colours .fx-ink / .fx-ink-2 / .fx-ink-3), with the same -l/-d override scheme (see the bottom of the file). */

.fx-rp {
  --fx-rp-fill: var(--fx-rp-fill-l, #4568ff);
  --fx-rp-track: var(--fx-rp-track-l, oklch(97% .001 106.424));
  --fx-rp-track-shadow: inset 0 1px 2px rgba(28, 25, 23, .07);
  --fx-rp-text: var(--fx-rp-text-l, oklch(55.3% .013 58.071));
  --fx-rp-done: var(--fx-rp-done-l, oklch(37.4% .01 67.558));
  display: flex;
  align-items: center;
  gap: 12px;
}
:root[data-theme="dark"] .fx-rp {
  --fx-rp-fill: var(--fx-rp-fill-d, #93b0ff);
  --fx-rp-track: var(--fx-rp-track-d, #1d1d1a);
  --fx-rp-track-shadow: inset 0 1px 2px rgba(0, 0, 0, .45);
  --fx-rp-text: var(--fx-rp-text-d, oklch(70.9% .01 56.259));
  --fx-rp-done: var(--fx-rp-done-d, oklch(92.3% .003 48.717));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fx-rp {
    --fx-rp-fill: var(--fx-rp-fill-d, #93b0ff);
    --fx-rp-track: var(--fx-rp-track-d, #1d1d1a);
    --fx-rp-track-shadow: inset 0 1px 2px rgba(0, 0, 0, .45);
    --fx-rp-text: var(--fx-rp-text-d, oklch(70.9% .01 56.259));
    --fx-rp-done: var(--fx-rp-done-d, oklch(92.3% .003 48.717));
  }
}
.fx-rp *, .fx-rp *::before, .fx-rp *::after { box-sizing: border-box; }

/* min-w-0 flex-1 rounded-[4px] bg-stone-100 p-[2px] shadow-[inset_0_1px_2px_rgba(28,25,23,0.07)] */
.fx-rp__track {
  min-width: 0;
  flex: 1;
  border-radius: 4px;
  background-color: var(--fx-rp-track);
  padding: 2px;
  box-shadow: var(--fx-rp-track-shadow);
}
/* h-[3px] origin-left rounded-[2px] bg-[#4568FF], width 100%, scaleX from the JS spring */
.fx-rp__fill {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background-color: var(--fx-rp-fill);
  transform-origin: 0;
  transform: scaleX(0);
}
.fx-rp__fill:dir(rtl) { transform-origin: 100%; }

/* grid shrink-0 justify-items-end font-mono text-[10.5px] tabular-nums; the three spans share one cell */
.fx-rp__meta {
  display: grid;
  flex-shrink: 0;
  justify-items: end;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 10.5px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.fx-rp__meta[hidden] { display: none; }
.fx-rp__sizer, .fx-rp__left, .fx-rp__done {
  grid-column-start: 1;
  grid-row-start: 1;
  white-space: nowrap;
}
/* invisible flex items-center gap-1: reserves the width of the widest label so nothing shifts */
.fx-rp__sizer { visibility: hidden; display: flex; align-items: center; gap: 4px; }
.fx-rp__sizer-icon { width: 12px; flex-shrink: 0; }
.fx-rp__left { color: var(--fx-rp-text); }
.fx-rp__done { display: flex; align-items: center; gap: 4px; color: var(--fx-rp-done); opacity: 0; }
.fx-rp__done svg { display: block; flex-shrink: 0; overflow: visible; }
.fx-rp__done-text { display: block; }

/* The check draws itself (framer pathLength): dasharray "<length> 1" on pathLength 1, a 0.3s tween with
   cubic-bezier(.23,1,.32,1) after 0.08s. */
.fx-rp__check {
  stroke-dasharray: 0 1;
  stroke-dashoffset: 0;
  transition: stroke-dasharray .3s cubic-bezier(.23, 1, .32, 1) .08s;
}
.fx-rp--complete .fx-rp__check { stroke-dasharray: 1 1; }
.fx-rp--instant .fx-rp__check { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .fx-rp__check { transition: none; }
}

/* ---- ddoemonn surface kit (the demo's panel). Values from the original :root / .dark tokens. ---- */
.fx-mat-panel { background: var(--fx-panel-l, #fff); box-shadow: var(--fx-shadow-lift-l, 0 1px 2px #0000000a, 0 0 0 1px #0000001c); }
.fx-mat-well { background: var(--fx-well-l, #fff); box-shadow: var(--fx-shadow-well-l, inset 0 1px 2px #0000000d, inset 0 0 0 1px #0000001a); }
.fx-ink { color: var(--fx-ink-l, #131313); }
.fx-ink-2 { color: var(--fx-ink-2-l, #454545); }
.fx-ink-3 { color: var(--fx-ink-3-l, #6e6e6e); }
:root[data-theme="dark"] .fx-mat-panel { background: var(--fx-panel-d, #1d1d1a); box-shadow: var(--fx-shadow-lift-d, 0 1px 2px #0006, inset 0 1px 0 #ffffff0d, 0 0 0 1px #ffffff0d); }
:root[data-theme="dark"] .fx-mat-well { background: var(--fx-well-d, #252522); box-shadow: var(--fx-shadow-well-d, inset 0 1px 3px #0006, inset 0 0 0 1px #ffffff08); }
:root[data-theme="dark"] .fx-ink { color: var(--fx-ink-d, #f8f8f4); }
:root[data-theme="dark"] .fx-ink-2 { color: var(--fx-ink-2-d, #c2c2ba); }
:root[data-theme="dark"] .fx-ink-3 { color: var(--fx-ink-3-d, #93938b); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fx-mat-panel { background: var(--fx-panel-d, #1d1d1a); box-shadow: var(--fx-shadow-lift-d, 0 1px 2px #0006, inset 0 1px 0 #ffffff0d, 0 0 0 1px #ffffff0d); }
  :root:not([data-theme="light"]) .fx-mat-well { background: var(--fx-well-d, #252522); box-shadow: var(--fx-shadow-well-d, inset 0 1px 3px #0006, inset 0 0 0 1px #ffffff08); }
  :root:not([data-theme="light"]) .fx-ink { color: var(--fx-ink-d, #f8f8f4); }
  :root:not([data-theme="light"]) .fx-ink-2 { color: var(--fx-ink-2-d, #c2c2ba); }
  :root:not([data-theme="light"]) .fx-ink-3 { color: var(--fx-ink-3-d, #93938b); }
}
/* Fades the top 14px and bottom 22px of a scroller; hides its scrollbar. */
.fx-fade-y {
  -webkit-mask-image: linear-gradient(#0000, #000 14px, #000 calc(100% - 22px), #0000);
  mask-image: linear-gradient(#0000, #000 14px, #000 calc(100% - 22px), #0000);
}
.fx-no-bar { scrollbar-width: none; }
.fx-no-bar::-webkit-scrollbar { width: 0; height: 0; }
