/* Auto Looking Time. Colour rules: mint green only ever means "looking" (coded frames, a finished
   result). Actions are ink black. Amber = something to do, red = something went wrong. Type: Bricolage
   Grotesque throughout (800 for the wordmark and page titles). Logo: the "oo" of looking is two eyes. */

@font-face { font-family: "Brico"; src: url("fonts/bricolage-grotesque-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Brico"; src: url("fonts/bricolage-grotesque-latin-600-normal.woff2") format("woff2"); font-weight: 600 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Brico"; src: url("fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); font-weight: 700 800; font-style: normal; font-display: swap; }

:root {
  --paper: #f4f5f6; --surface: #fdfdfd; --sunk: #eceef0;
  --ink: #121417; --ink-2: #4b5159; --ink-3: #6b717a; --rule: #e1e4e8; --rule-2: #c9ced5;
  --act: #121417; --act-hover: #2b2f35; --act-ink: #fdfdfd;
  --look: #14996f; --look-ink: #fdfdfd;
  --away: #d8dce1; --outside: #eceef1;
  --todo: #8f5500; --todo-soft: #fbf0dc; --bad: #b3261e; --bad-soft: #fbe5e2;
  --film: #121417;                                   /* behind video frames, both themes */
  --r-ctl: 8px; --r-panel: 12px;                     /* controls 8px, panels 12px, nothing else */
  --shadow: 0 1px 2px rgba(18, 20, 23, .05);
  --sans: "Brico", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1113; --surface: #16191c; --sunk: #1e2226;
    --ink: #f0f2f4; --ink-2: #b2b8bf; --ink-3: #8d949c; --rule: #272b30; --rule-2: #393f46;
    --act: #f0f2f4; --act-hover: #ffffff; --act-ink: #121417;
    --look: #2fcf98; --look-ink: #0f1113;
    --away: #353b42; --outside: #1f2328;
    --todo: #f0b25a; --todo-soft: #33291a; --bad: #ff8a7a; --bad-soft: #3a211e;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { font: 400 15px/1.55 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 32px 64px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.015em; }
h1 { font-weight: 800; letter-spacing: -.03em; }
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 17px; line-height: 1.35; }
p { margin: 0; }
a { color: inherit; }
.num, .t { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: 13.5px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--sunk); padding: 1px 5px; border-radius: 4px; }

/* ---------------------------------------------------------------- top bar */
.top { display: flex; align-items: center; gap: 24px; height: 60px; padding: 0 32px; background: var(--surface); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 800; font-size: 23px; letter-spacing: -.035em; line-height: 1; text-decoration: none; white-space: nowrap; color: var(--ink); }
.brand .oo { display: inline-block; height: .60em; width: 1.224em; vertical-align: -.03em; fill: currentColor; margin: 0 -.01em; }
.folder { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.folder b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.engine { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.engine .state { width: 7px; height: 7px; border-radius: 50%; background: var(--rule-2); }
.engine .state.ready { background: var(--look); }
.engine .state.busy { background: var(--todo); }
.engine .state.err { background: var(--bad); }
.engine.err { color: var(--bad); white-space: normal; max-width: 420px; }

/* ---------------------------------------------------------------- controls */
button, .btn { font: inherit; font-size: 14px; font-weight: 600; line-height: 20px; border-radius: var(--r-ctl); border: 1px solid var(--rule-2); background: var(--surface); color: var(--ink); padding: 7px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; }
button:hover:not(:disabled), .btn:hover { border-color: var(--ink-3); }
button:active:not(:disabled), .btn:active { transform: translateY(1px); }
button.primary { background: var(--act); border-color: var(--act); color: var(--act-ink); }
button.primary:hover:not(:disabled) { background: var(--act-hover); border-color: var(--act-hover); }
button.big { font-size: 15px; padding: 11px 20px; }
button.quiet { border-color: transparent; background: none; color: var(--ink-2); padding: 5px 8px; }
button.quiet:hover:not(:disabled) { color: var(--ink); border-color: transparent; background: var(--sunk); }
button:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
select, input[type=text], textarea { font: inherit; font-size: 14px; border: 1px solid var(--rule-2); border-radius: var(--r-ctl); padding: 7px 10px; background: var(--surface); color: var(--ink); }
textarea { width: 100%; min-height: 150px; font-variant-numeric: tabular-nums; line-height: 1.6; resize: vertical; }
label.field { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.notice { border-radius: var(--r-ctl); padding: 10px 14px; font-size: 14px; background: var(--todo-soft); color: var(--ink); border-left: 3px solid var(--todo); margin: 0 0 16px; }
.notice.bad { background: var(--bad-soft); border-left-color: var(--bad); }
.err { color: var(--bad); font-size: 13.5px; }

/* status words (semantic colour only) */
.status { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.status.done { color: var(--look); } .status.todo { color: var(--todo); } .status.err { color: var(--bad); }
.status.ready, .status.run { color: var(--ink); }

/* ---------------------------------------------------------------- the looking strip (the one signature) */
.strip { display: block; width: 100%; border-radius: 3px; background: var(--outside); }
.legend { display: flex; gap: 18px; align-items: center; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 18px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }

/* ---------------------------------------------------------------- home (connect / reconnect): one sentence, one action */
main.home { display: flex; flex-direction: column; justify-content: center; padding-bottom: 14vh; }
.welcome h1 { font-size: 64px; line-height: 1; letter-spacing: -.045em; }
.welcome .lede { font-size: 18px; color: var(--ink-2); margin: 18px 0 0; max-width: 46ch; }
.welcome .act { margin-top: 32px; }
.example { margin: 64px 0 0; }
.example .strip { height: 44px; border-radius: 4px; }
.example .cap { display: flex; justify-content: space-between; gap: 16px; margin-top: 10px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
@media (prefers-reduced-motion: no-preference) {
  .example .strip { animation: code-in 1.6s cubic-bezier(.3, .7, .2, 1) .15s both; }
  @keyframes code-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
}

/* ---------------------------------------------------------------- library */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.pagehead .sub { margin-top: 6px; color: var(--ink-2); font-size: 14px; }
.tools { display: flex; gap: 10px; align-items: center; }
.list { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-panel); box-shadow: var(--shadow); }
.list .head, .list .item { display: grid; grid-template-columns: minmax(180px, 1.3fr) 64px minmax(160px, 1.4fr) 84px 150px; gap: 20px; align-items: center; padding: 0 20px; }
.list .head { height: 40px; font-size: 13px; color: var(--ink-3); border-bottom: 1px solid var(--rule); }
.list .item { min-height: 62px; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); cursor: pointer; text-align: left; width: 100%; background: none; border-radius: 0; border-left: 0; border-right: 0; border-top: 0; font-weight: 400; }
.list .item:last-child { border-bottom: 0; border-radius: 0 0 var(--r-panel) var(--r-panel); }
.list .item:hover { background: var(--paper); }
.list .item:active { transform: none; }
.list .r { text-align: right; }
.vname { font-weight: 600; font-size: 15px; } .vdir { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .strip { height: 14px; }
.list .none { font-size: 13px; color: var(--ink-3); }
.mini { height: 4px; border-radius: 2px; background: var(--sunk); overflow: hidden; margin-top: 6px; width: 100%; }
.mini > i { display: block; height: 100%; background: var(--ink-2); transition: width .3s; }
.empty { padding: 56px 24px; text-align: center; color: var(--ink-2); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }

/* ---------------------------------------------------------------- one video */
.back { margin: -8px 0 14px -8px; }
.vhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.vhead .sub { margin-top: 6px; color: var(--ink-3); font-size: 13.5px; }
.total { text-align: right; }
.total .v { font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.total .v small { font-size: 18px; font-weight: 600; color: var(--ink-2); margin-left: 3px; }
.total .l { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; }

.setup { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-panel); box-shadow: var(--shadow); margin-bottom: 28px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 0 14px; padding: 18px 22px; border-bottom: 1px solid var(--rule); }
.step:last-child { border-bottom: 0; }
.step .n { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--rule-2); display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 1px; }
.step.complete .n { border-color: var(--look); background: var(--look); color: var(--look-ink); }
.step .line { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 28px; flex-wrap: wrap; }
.step .what { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.step .what .muted { font-size: 14px; }
.step .body { grid-column: 2; margin-top: 14px; }
.step .body > p { color: var(--ink-2); font-size: 14px; max-width: 68ch; margin-bottom: 12px; }
table.trials { border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.trials th { font-weight: 600; color: var(--ink-3); font-size: 13px; text-align: left; padding: 0 28px 6px 0; }
table.trials td { padding: 3px 28px 3px 0; }

/* picker */
.picker { position: relative; background: var(--film); border-radius: var(--r-ctl); overflow: hidden; aspect-ratio: 16 / 9; }
.picker canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.picker .ov { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #d8e0db; font-size: 14px; pointer-events: none; padding: 20px; text-align: center; }
.seek { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin-top: 12px; }
.seek .grp { display: flex; gap: 4px; }
.seek .grp button { padding: 6px 10px; font-size: 13px; }
.seek input[type=range] { width: 100%; accent-color: var(--ink); }
.seek .t { font-size: 13px; color: var(--ink-2); grid-column: 1 / -1; display: flex; justify-content: space-between; }

/* run */
.progress { height: 6px; background: var(--sunk); border-radius: 3px; overflow: hidden; margin: 14px 0 8px; }
.progress > i { display: block; height: 100%; background: var(--ink-2); transition: width .3s; }

/* results */
.results { padding: 22px 24px; }
.results h2 { margin-bottom: 4px; }
.results .meta { font-size: 13.5px; color: var(--ink-3); }
.results .reshead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.trial { display: grid; grid-template-columns: 56px minmax(0, 1fr) 132px; gap: 18px; align-items: center; padding: 10px 0; }
.trial + .trial { border-top: 1px solid var(--rule); }
.trial b { font-weight: 600; font-size: 14px; }
.trial .strip { height: 30px; }
.trial .lt { text-align: right; font-variant-numeric: tabular-nums; line-height: 1.25; }
.trial .lt b { font-size: 16px; } .trial .lt span { display: block; font-size: 12.5px; color: var(--ink-3); }
.files { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--rule); }
.files .muted { font-size: 13.5px; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 820px) {
  main { padding: 20px 16px 48px; }
  .top { padding: 0 16px; gap: 12px; }
  .folder { display: none; }
  main.home { justify-content: flex-start; padding-top: 40px; }
  .welcome h1 { font-size: 44px; }
  .list .head { display: none; }
  .list .item { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 16px; }
  .list .item > :nth-child(2) { display: none; }
  .list .item > :nth-child(3) { grid-column: 1 / -1; order: 3; }
  .list .item > :nth-child(4) { order: 2; }
  .list .item > :nth-child(5) { grid-column: 1 / -1; text-align: left; order: 4; }
  .step { grid-template-columns: 1fr; padding: 16px; }
  .step .n { display: none; }
  .step .body { grid-column: 1; }
  .seek { grid-template-columns: 1fr; }
  .trial { grid-template-columns: 40px minmax(0, 1fr) 96px; gap: 10px; }
  .total { text-align: left; }
}
