:root {
  --ink: #101417;
  --surface: #171c20;
  --surface-soft: #242d32;
  --line: #39444a;
  --line-strong: #536169;
  --text: #edf2ef;
  --muted: #aebbb8;
  --faint: #7e8d8c;
  --amber: #f1b35b;
  --amber-soft: #3c3021;
  --cyan: #72d7d1;
  --green: #9ed69f;
  --red: #ff9a9a;
  --topbar-height: 56px;
  --stage-nav-height: 56px;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { background: var(--ink); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--ink); color: var(--text); font: 18px/1.55 var(--sans); letter-spacing: .005em; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin-top: 0; }
[hidden] { display: none !important; }
.svg-sprite { height: 0; overflow: hidden; position: absolute; width: 0; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.topbar { align-items: center; background: #0d1113; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; min-height: var(--topbar-height); padding: 0 clamp(18px, 4vw, 64px); }
.wordmark { align-items: center; display: inline-flex; font: 700 18px/1 var(--mono); gap: 11px; letter-spacing: .03em; }
.wordmark-mark { color: var(--amber); font-size: 22px; letter-spacing: -.18em; }
.topbar-status { color: var(--text); font: 15px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.status-dot { animation: dot-breath 2.6s ease-out infinite; background: var(--green); border-radius: 50%; display: inline-block; height: 8px; margin-right: 7px; width: 8px; }
@keyframes dot-breath { 0%, 100% { box-shadow: 0 0 0 0 rgba(158, 214, 159, .5); } 70% { box-shadow: 0 0 0 5px rgba(158, 214, 159, 0); } }
.status-divider { border-left: 1px solid var(--line); display: inline-block; height: 15px; margin: 0 12px -3px; }
.status-flag { color: var(--amber); font-weight: 400; }

.stage-nav { background: #12171a; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.stage-nav-inner { display: flex; flex-wrap: wrap; margin: 0 auto; max-width: 1540px; padding: 0 clamp(12px, 3.7vw, 60px); }
.stage-link { align-items: center; border-bottom: 3px solid transparent; color: var(--muted); display: inline-flex; flex: 0 0 auto; font-size: 18px; gap: 9px; min-height: 56px; padding: 0 16px; transition: color .16s ease; }
.stage-link span { color: var(--faint); font: 15px/1 var(--mono); }
.stage-link:hover, .stage-link:focus-visible, .stage-link.is-active { color: var(--text); }
.stage-link.is-active { border-color: var(--amber); }
.stage-link.is-active span { color: var(--amber); }
.stage-link.is-locked { color: var(--faint); opacity: .72; }
.stage-link.is-locked span { color: var(--faint); }
.stage-link.is-locked:hover, .stage-link.is-locked:focus-visible { color: var(--muted); opacity: 1; }
.lock-glyph { fill: none; height: 12px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.4; width: 12px; }

.workbench { margin: 0 auto; max-width: 1540px; padding: 12px clamp(18px, 4vw, 64px) 72px; }
.stage-header { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 24px; justify-content: space-between; min-height: 82px; padding: 8px 0; }
.stage-heading { align-items: baseline; display: flex; flex-wrap: wrap; gap: 12px 20px; min-width: 0; }
h1 { font-size: clamp(30px, 4vw, 40px); letter-spacing: -.045em; line-height: 1; margin: 0; }
.stage-focus { color: var(--muted); font-size: 18px; margin: 0; }
.stage-funnel { color: var(--text); flex: 0 0 auto; font: 18px/1.2 var(--mono); }

.filters { background: rgba(23, 28, 32, .97); border: 1px solid var(--line); margin-bottom: 14px; padding: 10px 12px; position: sticky; top: var(--stage-nav-height); z-index: 8; }
.search-field { align-items: center; display: flex; gap: 16px; }
.search-field span { color: var(--amber); flex: 0 0 auto; font: 16px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.search-field input { background: var(--ink); border: 1px solid var(--line-strong); color: var(--text); font: 18px/1.2 var(--sans); min-width: 0; outline: none; padding: 10px 12px; transition: border-color .18s ease-out, box-shadow .18s ease-out; width: 100%; }
.search-field input:focus { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(114, 215, 209, .16); }
.search-field input::placeholder { color: var(--faint); }
.filter-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.filter-chip { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); cursor: pointer; font: 16px/1.1 var(--mono); padding: 8px 9px; transition: background-color .18s ease-out, border-color .18s ease-out, color .18s ease-out, transform .1s ease-out; }
.filter-chip:active { transform: translateY(1px); }
.filter-chip b { color: var(--cyan); font-weight: 500; }
.filter-chip:hover, .filter-chip[aria-pressed="true"] { background: var(--amber-soft); border-color: var(--amber); color: var(--text); }

.fleet-line { color: var(--faint); font: 15px/1.4 var(--mono); margin: 0 2px 18px; }
.fleet-line b { color: var(--green); font-weight: 500; }

/* cards — screenshot thumbnail + two lines, no chrome */
.entry-grid { align-items: stretch; display: grid; gap: 22px 18px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.entry-card { background: none; border: 0; display: flex; flex-direction: column; height: 100%; min-width: 0; padding: 0; transition: transform .16s ease; }
.entry-card:hover { transform: translateY(-2px); }
.entry-card:active { transform: translateY(0); }
.entry-card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
.entry-card[data-expandable] { cursor: pointer; }
.card-media { display: block; }

.screen { aspect-ratio: 9 / 16; background: #0d1113; border-radius: 10px; overflow: hidden; position: relative; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.wall { display: block; height: 100%; inset: 0; object-fit: cover; position: absolute; width: 100%; }
.s-shade { background: linear-gradient(180deg, rgba(5, 8, 10, .38), rgba(5, 8, 10, 0) 24%, rgba(5, 8, 10, 0) 58%, rgba(5, 8, 10, .5)); inset: 0; position: absolute; }

.s-bar { align-items: center; color: rgba(255, 255, 255, .85); display: flex; font: 500 8px/1 var(--mono); justify-content: space-between; letter-spacing: .04em; left: 0; padding: 7px 11px 0; position: absolute; right: 0; top: 0; }
.s-sig { align-items: center; display: flex; gap: 4px; }
.g-wifi { border: 1.4px solid currentColor; border-bottom-color: transparent; border-left-color: transparent; border-radius: 0 100% 0 0; display: inline-block; height: 6px; position: relative; transform: rotate(-45deg); width: 6px; }
.g-wifi::after { background: currentColor; border-radius: 50%; content: ""; height: 1.8px; left: 50%; position: absolute; top: -1px; transform: translate(-50%, 0); width: 1.8px; }
.g-batt { border: 1px solid currentColor; border-radius: 1.5px; display: inline-block; height: 6px; position: relative; width: 11px; }
.g-batt::before { background: currentColor; border-radius: 1px; bottom: 1px; content: ""; left: 1px; position: absolute; top: 1px; width: 62%; }
.g-batt::after { background: currentColor; border-radius: 0 1px 1px 0; content: ""; height: 2.5px; position: absolute; right: -2px; top: 50%; transform: translateY(-50%); width: 1.2px; }

.s-glance { color: #fff; display: grid; gap: 3px; left: 13px; position: absolute; text-shadow: 0 1px 10px rgba(0, 0, 0, .3); top: 30px; }
.s-time { font: 500 32px/1 var(--sans); letter-spacing: -.02em; }
.s-date { font: 400 12px/1.2 var(--sans); opacity: .92; }
.s-weather { font: 400 10px/1.2 var(--sans); margin-top: 3px; opacity: .72; }

.s-grid { bottom: 66px; display: grid; grid-template-columns: repeat(4, 1fr); justify-items: center; left: 0; padding: 0 12px; position: absolute; right: 0; row-gap: 13px; }
.app { background: rgba(255, 255, 255, .13); border-radius: 50%; color: #fff; display: grid; height: 33px; place-items: center; position: relative; width: 33px; }
.app img { height: 16px; width: 16px; }
.app svg { fill: none; height: 16px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 16px; }
.app.is-dot::after { background: var(--amber); border-radius: 50%; border: 1.5px solid rgba(13, 17, 19, .55); content: ""; height: 6px; position: absolute; right: -2px; top: -1px; width: 6px; }
.s-dock { bottom: 12px; display: flex; gap: 18px; justify-content: center; left: 50%; position: absolute; transform: translateX(-50%); }
.s-dock .app { background: rgba(255, 255, 255, .17); }

/* app-open state — fullscreen reel capture */
.screen.is-reel .wall { filter: saturate(.5) brightness(.55) contrast(1.05); }
.screen.is-reel .s-shade { background: linear-gradient(180deg, rgba(5, 8, 10, .55), rgba(5, 8, 10, 0) 26%, rgba(5, 8, 10, 0) 60%, rgba(5, 8, 10, .74)); }
.r-top { align-items: center; color: #fff; display: flex; justify-content: space-between; left: 0; padding: 22px 12px 0; position: absolute; right: 0; top: 0; }
.r-title { font: 600 11px/1 var(--sans); letter-spacing: .01em; }
.r-cam svg { fill: none; height: 13px; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 13px; }
.r-rail { align-items: center; bottom: 84px; color: #fff; display: flex; flex-direction: column; gap: 13px; position: absolute; right: 9px; }
.r-act { align-items: center; color: #fff; display: flex; flex-direction: column; font: 500 8px/1 var(--mono); gap: 4px; }
.r-act svg { fill: none; height: 16px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 16px; }
.r-meta { bottom: 36px; color: #fff; display: grid; gap: 4px; left: 12px; position: absolute; right: 56px; }
.r-handle { font: 600 11px/1 var(--sans); }
.r-cap { font: 400 10px/1.4 var(--sans); opacity: .9; }
.r-audio { font: 400 9px/1 var(--mono); opacity: .68; }
.r-progress { bottom: 11px; display: flex; gap: 4px; left: 11px; position: absolute; right: 11px; }
.r-progress i { background: rgba(255, 255, 255, .3); border-radius: 2px; flex: 1; height: 2.5px; }
.r-progress i.is-done { background: rgba(255, 255, 255, .85); }
.r-progress i.is-live { background: rgba(255, 255, 255, .55); }

.card-body { display: flex; flex: 1; flex-direction: column; padding: 12px 2px 0; }
.dev-name { font: 700 16px/1.2 var(--mono); letter-spacing: .01em; margin: 0 0 4px; }
.dev-line { color: var(--muted); font: 13px/1.5 var(--mono); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-footer { align-items: center; display: flex; gap: 12px; margin-top: 10px; }
.score-button { background: transparent; border: 0; color: var(--amber); cursor: pointer; font: 500 13px/1 var(--mono); padding: 0; text-transform: lowercase; }
.score-button:hover, .score-button:focus-visible { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.card-add { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); cursor: pointer; font: 500 13px/1.1 var(--mono); margin-left: auto; padding: 6px 9px; }
.card-add:hover, .card-add:focus-visible { border-color: var(--cyan); color: var(--cyan); }
.card-add { transition: border-color .18s ease-out, color .18s ease-out, transform .1s ease-out; }
.card-add:active, .score-button:active { transform: translateY(1px); }
.score-good { color: var(--green); }
.score-mid { color: var(--amber); }
.score-bad { color: var(--red); }

/* live led on the phone screen, the farm breathing */
.g-led { border-radius: 50%; display: inline-block; height: 6px; width: 6px; }
.g-led--live { --led-glow: 158, 214, 159; animation: led-breath 2.4s ease-out infinite; background: var(--green); }
.g-led--busy { --led-glow: 241, 179, 91; animation: led-breath 1.6s ease-out infinite; background: var(--amber); }
@keyframes led-breath { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--led-glow), .55); opacity: 1; } 70% { box-shadow: 0 0 0 4px rgba(var(--led-glow), 0); opacity: .55; } }

.card-detail { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.detail-grid { display: grid; gap: 10px; }
.detail-grid > div { display: grid; gap: 3px; }
.detail-label { color: var(--faint); font: 12px/1 var(--mono); text-transform: uppercase; }
.detail-grid strong { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }

.empty-state { align-items: flex-start; background: var(--surface); border: 1px solid var(--line); display: flex; gap: 25px; margin-top: 16px; max-width: 890px; padding: clamp(27px, 4vw, 48px); }
.empty-sigil { align-items: center; border: 1px solid var(--amber); color: var(--amber); display: flex; flex: 0 0 auto; font: 700 15px/1 var(--mono); height: 48px; justify-content: center; width: 48px; }
.empty-state h2 { font-size: 24px; margin-bottom: 9px; }
.empty-note { color: var(--muted); margin-bottom: 18px; max-width: 650px; }
.text-link { background: none; border: 0; color: var(--cyan); cursor: pointer; display: inline-flex; font-size: 18px; gap: 8px; padding: 0; }
.text-link:hover, .text-link:focus-visible { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

.toast { background: #0d1113; border: 1px solid var(--amber); bottom: 26px; color: var(--text); font: 15px/1.4 var(--mono); left: 50%; max-width: min(92vw, 520px); opacity: 0; padding: 11px 14px; pointer-events: none; position: fixed; text-align: center; transform: translate(-50%, 16px); transition: transform .28s cubic-bezier(.16, 1, .3, 1), opacity .28s ease; z-index: 50; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* entrance — Motion lib drives .is-motion, keyframes cover .is-fallback */
.is-motion .anim { opacity: 0; }
@keyframes fb-in { from { filter: blur(5px); opacity: 0; transform: translateY(12px); } to { filter: blur(0); opacity: 1; transform: translateY(0); } }
.is-fallback .anim { animation: fb-in .3s ease-out both; }
.is-fallback .stage-nav { animation-delay: .05s; }
.is-fallback .stage-header { animation-delay: .1s; }
.is-fallback .filters { animation-delay: .15s; }
.is-fallback .fleet-line { animation-delay: .2s; }
.is-fallback .entry-card { animation-delay: calc(.24s + var(--i, 0) * .06s); }
.is-reduced .anim { animation: none !important; opacity: 1 !important; }

@media (max-width: 760px) {
  .topbar-status { font-size: 14px; }
  .status-divider, .topbar-status .status-dot { display: none; }
  .stage-header { align-items: flex-start; flex-direction: column; gap: 10px; }
  .stage-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .search-field { align-items: flex-start; flex-direction: column; gap: 8px; }
  .empty-state { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .anim { animation: none !important; }
  .is-motion .anim { opacity: 1; }
  .status-dot, .g-led { animation: none; }
  .toast { transition: none; }
  *, *::before, *::after { transition-duration: .001ms !important; }
}
