/* Palette rule: black 60% (page, window), mint 30% (type, dump, glass tint), red 10% (accents).
   Glass follows LIQUID_GLASS.md (dark tokens, tinted mint): clear fill, top sheen, a lip of
   light inside the top edge, darker thickness at the bottom. No 1px borders on glass. */
:root {
  --black: #000000;
  --mint: #39F0AE;
  --red: #FF0000;
  --muted: rgb(57 240 174 / 0.58);
  --faint: rgb(57 240 174 / 0.38);
  --hair: rgb(57 240 174 / 0.1);
  --fill: rgb(57 240 174 / 0.06);
  --sheen: rgb(57 240 174 / 0.09);
  --lip: rgb(57 240 174 / 0.34);
  --edge-shade: rgb(0 0 0 / 0.55);
  --field-ink: rgb(57 240 174 / 0.075);
  --font: "SF Pro Text", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --font-display: "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --pad: clamp(16px, 4vw, 56px);
  --max: 1360px;
  --quart: cubic-bezier(0.25, 1, 0.5, 1);
}

* { box-sizing: border-box; }
html { background: var(--black); color-scheme: dark; }
body {
  margin: 0;
  min-height: 100svh;
  color: var(--mint);
  font: 400 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--mint); color: var(--black); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

/* Background: a memory dump drifting up ~3 px/s. Its bytes hide a message;
   the red ones spell part of it. */
.field {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.hex {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  padding-left: var(--pad);
  font: 400 12px/18px var(--mono);
  font-variant-ligatures: none;
  color: var(--field-ink);
  white-space: pre;
  animation: drift var(--drift, 240s) linear infinite;
}
.hex b { font-weight: 400; color: var(--red); text-shadow: 0 0 6px rgb(255 0 0 / 0.5); }
@keyframes drift { to { transform: translate3d(0, calc(-1 * var(--loop, 0px)), 0); } }

/* Glass */
.glass {
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--sheen), transparent 58%), var(--fill);
  -webkit-backdrop-filter: blur(3px) saturate(1.6);
  backdrop-filter: blur(3px) saturate(1.6);
  box-shadow:
    inset 0 1px 0.5px var(--lip),
    inset 0 -1px 1px rgb(57 240 174 / 0.1),
    inset 0 0 7px -3px var(--edge-shade),
    inset 0 -10px 16px -14px var(--edge-shade);
}
@supports (corner-shape: squircle) {
  .glass, .bead, .find, .row, .new, .offline { corner-shape: squircle; }
}

/* Dock: floating glass bar, path and filter */
.dock {
  --r: 24px;
  position: sticky;
  top: 12px;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 260px;
  align-items: center;
  gap: 22px;
  width: min(100% - 2 * var(--pad), var(--max));
  height: 52px;
  margin: 12px auto 0;
  padding: 0 8px 0 22px;
  background: linear-gradient(180deg, var(--sheen), transparent 58%), rgb(0 0 0 / 0.74);
}
.host { font: 600 13px/1 var(--mono); color: var(--muted); white-space: nowrap; }
.host:hover { color: var(--mint); }
.crumbs {
  display: flex;
  align-items: center;
  gap: 0.55ch;
  overflow-x: auto;
  white-space: nowrap;
  font: 600 15px/52px var(--font);
  scrollbar-width: none;
}
.crumbs::-webkit-scrollbar { display: none; }
.crumbs a { color: var(--muted); }
.crumbs a:hover, .crumbs [aria-current] { color: var(--mint); }
.crumbs .home { font-family: var(--mono); font-size: 16px; }
.crumbs .sep { color: var(--red); font-family: var(--mono); font-weight: 700; }

.find {
  position: relative;
  display: flex;
  align-items: center;
  height: 36px;
  border-radius: 18px;
  background: rgb(0 0 0 / 0.6);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.8), inset 0 -1px 0 rgb(57 240 174 / 0.14);
}
.find:focus-within { box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.8), 0 0 0 2px var(--mint); }
.find svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  stroke-linecap: round;
  pointer-events: none;
}
#filter {
  width: 100%;
  height: 100%;
  padding: 0 14px 0 36px;
  border: 0;
  border-radius: inherit;
  outline: none;
  background: none;
  color: var(--mint);
  font: 500 14px var(--font);
}
#filter::placeholder { color: var(--faint); }

/* Hero: the folder's name, its numbers beside it */
main {
  position: relative;
  width: min(100% - 2 * var(--pad), var(--max));
  margin: 0 auto;
  padding: clamp(44px, 8vw, 116px) 0 120px;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px 56px;
  margin-bottom: clamp(28px, 4vw, 52px);
}
h1 {
  margin: 0;
  padding-bottom: 0.04em;
  font: 700 clamp(56px, 10vw, 168px)/0.92 var(--font-display);
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}
.stats { display: flex; flex-direction: column; gap: 10px; min-width: 200px; margin: 0; padding: 0; list-style: none; }
.cap {
  --r: 22px;
  display: grid;
  grid-template-columns: 4.2rem auto;
  align-items: center;
  height: 44px;
  padding: 0 18px;
  /* dense: the dump must not read through the numbers */
  background: linear-gradient(180deg, var(--sheen), transparent 58%), linear-gradient(var(--fill), var(--fill)), rgb(0 0 0 / 0.72);
}
.cap i { font: 500 12px/1 var(--mono); font-style: normal; color: var(--red); }
.cap b { font: 600 15px/1 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Window: the listing. Solid dark glass (no backdrop blur): text sits on it, and the
   dump drifting underneath would make a blur re-run every frame. */
.win {
  --r: 28px;
  position: relative;
  padding: 4px 6px 8px;
  background: linear-gradient(180deg, var(--sheen), transparent 180px), rgb(0 0 0 / 0.92);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.head, .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7rem 10.5rem 6.5rem;
  gap: 20px;
  align-items: center;
  padding: 0 20px;
}
.head { position: relative; height: 50px; font: 500 12px/1 var(--mono); color: var(--muted); }
.head::after { content: ""; position: absolute; left: 20px; right: 20px; bottom: 0; height: 1px; background: var(--hair); }
.head button { justify-self: start; }
.head button:hover, .head [aria-pressed="true"] { color: var(--mint); }
.head .h-size { justify-self: end; }
.head .dir-mark { color: var(--red); margin-left: 0.5ch; }

.list { position: relative; }
.rows { margin: 0; padding: 0; list-style: none; }
.rows li { position: relative; }
.rows li + li::before { content: ""; position: absolute; left: 20px; right: 20px; top: 0; height: 1px; background: var(--hair); }
.row {
  position: relative;
  z-index: 1;
  min-height: 54px;
  padding-top: 12px;
  padding-bottom: 12px;
  border-radius: 24px;
}
.row:focus-visible { outline-offset: -2px; }

/* The bead: one glass capsule that glides to the row under the pointer. */
.bead {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 54px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgb(57 240 174 / 0.13), transparent 70%), rgb(57 240 174 / 0.06);
  box-shadow:
    inset 0 1px 0.5px var(--lip),
    inset 0 -1px 1px rgb(57 240 174 / 0.1),
    inset 0 -10px 16px -14px var(--edge-shade);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.32s var(--quart), height 0.32s var(--quart), opacity 0.2s ease;
}
.bead.on { opacity: 1; }
.bead.jump { transition: none; }

.name { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-size: 16px; }
.label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir .label { font-weight: 650; }
.slash { color: var(--faint); }
.up .label { font-family: var(--mono); font-weight: 600; color: var(--muted); }
.new {
  flex: none;
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--red);
  color: var(--black);
  font: 700 10px/1.3 var(--mono);
  letter-spacing: 0.02em;
}
.size, .date { font: 400 13px var(--mono); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.size { text-align: right; }
.act { text-align: right; font: 600 13px var(--font); color: var(--red); opacity: 0; transition: opacity 0.16s ease; }
.row:hover .act, .row:focus-visible .act { opacity: 1; }

.note { margin: 0; padding: 36px 20px 28px; color: var(--muted); }
.note a { color: var(--mint); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

.offline {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  width: max-content;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 12px 20px;
  border-radius: 22px;
  translate: -50% 0;
  background: var(--red);
  color: var(--black);
  font: 600 14px/1.3 var(--font);
  text-align: center;
}

/* Touch: no hover, so no bead; the row answers the tap instead. */
@media (hover: none) {
  .bead { display: none; }
  .row:active { background: rgb(57 240 174 / 0.08); }
}

@media (max-width: 720px) {
  .dock { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 0 8px 0 18px; }
  .host { display: none; }
  .find { width: 112px; transition: width 0.32s var(--quart); }
  .find:focus-within { width: min(62vw, 260px); }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .stats { align-items: flex-start; min-width: 0; gap: 6px; }
  .cap { --r: 17px; height: 34px; padding: 0 14px; grid-template-columns: 3.9rem auto; }
  .cap b { font-size: 14px; }
  .win { --r: 24px; padding: 2px 4px 6px; }
  .head, .row { grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 0 16px; }
  .head::after, .rows li + li::before { left: 16px; right: 16px; }
  .date, .act, .h-date, .h-act { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hex { animation: none; }
  .bead, .find, .act { transition: none; }
}
