/* panda 耳朵. Panda's black and white; the one ornament is a panda's ear on the top of its (white) head: it is the
   record button, it listens while recording and folds down when paused (ear.js). While recording the whole screen
   is black. Green only means "safe": on the NAS, written. */

@font-face {
  font-family: "Archivo Digits"; /* Archivo ExtraBold Italic, digits only (OFL, fonts/archivo-OFL.txt) */
  src: url(/fonts/archivo-digits.woff2) format("woff2");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #000;
  --paper: #fff;
  --graphite: #6b6b6b;
  --mist: #e7e7e4;
  --bamboo: #3f7a2b;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --digits: "Archivo Digits", var(--sans);
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #fff; --paper: #000; --graphite: #929292; --mist: #2b2b2b; --bamboo: #8cc079; color-scheme: dark; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.6 var(--sans); }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; opacity: .4; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.num { font-family: var(--digits); font-style: italic; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .01em; }

/* --- frame --- */
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px var(--gutter); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 17px; }
.brand svg { width: 22px; height: 26px; }
.who { color: var(--graphite); font-size: 13px; }
.who button { margin-left: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* the "p" mark: ink by default, paper on the recording screen */
.pmark .stem, .pmark .bowl { fill: currentColor; }
.pmark .eye { fill: var(--paper); }

/* --- buttons --- */
.act { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--ink); font-weight: 600; white-space: nowrap; }
.act.solid { background: var(--ink); color: var(--paper); }
.act.quiet { border-color: transparent; color: var(--graphite); padding: 0 4px; }
.link { text-decoration: underline; text-underline-offset: 3px; }

/* press and hold: the fill shows how long is left */
.hold { position: relative; overflow: hidden; isolation: isolate; }
.hold::after { content: ""; position: absolute; inset: 0; z-index: -1; background: currentColor; opacity: .18; transform: scaleX(0); transform-origin: left; }
.hold.holding::after { transform: scaleX(1); transition: transform var(--hold, 900ms) linear; }

/* --- home --- */
.home { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 0 var(--gutter) 96px; }
@media (min-width: 960px) {
  .home { grid-template-columns: minmax(340px, 5fr) 7fr; gap: 64px; align-items: start; }
  .stage { position: sticky; top: 24px; min-height: calc(100vh - 120px); }
}

.stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 7vh 0 9vh; text-align: center; }

/* the ear on the top of the head (ear.js draws it; the pointer can play with it) */
.ear { cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; }
.ear canvas { display: block; width: 100%; height: 100%; }
.ear:focus-visible { outline-offset: -6px; }
.ear.home { width: min(560px, 92vw); aspect-ratio: 1.8; }
.ear.rec-ear { width: clamp(170px, 26vw, 250px); aspect-ratio: 1.8; }
.mic { color: var(--graphite); font-size: 13px; max-width: 80vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mic::after { content: " ⌄"; }
.stage .lede { margin: 0; font-size: 17px; }
.stage .row-acts { display: flex; gap: 12px; }
.note { margin: 0; color: var(--graphite); font-size: 13px; }

/* the list: what needs you first, then by day */
.shelf { padding-top: 4vh; }
.shelf h2 { margin: 40px 0 6px; font-size: 13px; font-weight: 400; color: var(--graphite); }
.shelf h2:first-child { margin-top: 0; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; padding: 14px 0; border-bottom: 1px solid var(--mist); text-decoration: none; position: relative; }
.item .t { font-size: 17px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .m { grid-column: 1; display: flex; flex-wrap: wrap; gap: 0 14px; color: var(--graphite); font-size: 13px; }
.item .m .num { font-size: 13px; }
.item .side { grid-column: 2; grid-row: 1 / span 2; color: var(--graphite); font-size: 13px; }
.item.attn .t::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 8px 2px 0; border-radius: 50%; background: var(--ink); }
.item.busy::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: calc(var(--p, 0) * 100%); background: var(--bamboo); transition: width .6s ease; }
.item.err .m { color: var(--ink); }

/* --- recording: the screen turns black --- */
.rec { position: fixed; inset: 0; z-index: 20; display: grid; grid-template-rows: auto auto 1fr auto auto; background: #000; color: #fff; padding: 18px var(--gutter) calc(20px + env(safe-area-inset-bottom)); overflow: hidden; --paper: #000; --ink: #fff; --graphite: #8a8a8a; --mist: #222; }
.rec[hidden] { display: none; }
.rec.opening { animation: open .45s cubic-bezier(.3, .7, .2, 1); }
@keyframes open { from { clip-path: circle(var(--r0, 100px) at var(--cx, 50%) var(--cy, 40%)); } to { clip-path: circle(150% at var(--cx, 50%) var(--cy, 40%)); } }
.rec-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.rec-top .pmark { color: #fff; width: 22px; height: 26px; }
.rec .mic { color: #9a9a9a; }
.clock { margin: 6vh 0 2vh; font-size: clamp(76px, 20vw, 184px); line-height: .9; }
.rec.paused .clock { opacity: .35; }
.wave { width: 100%; height: clamp(72px, 14vh, 128px); display: block; }
/* what was heard, like subtitles: the newest words at the bottom, older ones fading out at the top */
.live { align-self: end; display: flex; flex-direction: column; justify-content: flex-end; max-width: 46em; height: calc(1.6em * 4); margin: 2vh 0; overflow: hidden; font-size: clamp(16px, 2.2vw, 20px); line-height: 1.6; -webkit-mask-image: linear-gradient(transparent, #000 55%); mask-image: linear-gradient(transparent, #000 55%); }
.live p { margin: 0; }
.fields { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 24px; margin-bottom: 4vh; }
.fields input { flex: 1 1 14em; min-width: 0; background: none; border: 0; border-bottom: 1px solid #333; padding: 6px 0; font-size: 17px; }
.fields input::placeholder { color: #6f6f6f; }
.fields .where { color: #9a9a9a; text-align: left; }
.fields .where.set { color: #fff; }
.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.controls .mark { justify-self: start; color: #9a9a9a; font-size: 15px; padding: 10px 0; }
.controls .mark.hit { color: #fff; }
.controls .end { justify-self: end; white-space: nowrap; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1.5px solid #fff; font-weight: 600; }
.rec .note { color: #c8c8c8; margin-top: 12px; }

/* --- choosing where a recording goes --- */
.picker { margin-top: 8px; }
.picker input { width: 100%; background: none; border: 0; border-bottom: 1.5px solid var(--ink); padding: 8px 0; font-size: 17px; }
.picker ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 46vh; overflow: auto; }
.picker li button { display: flex; justify-content: space-between; gap: 16px; width: 100%; padding: 11px 0; border-bottom: 1px solid var(--mist); text-align: left; }
.picker li button span:last-child { color: var(--graphite); font-size: 13px; }
.picker li button[aria-current="true"] { font-weight: 700; }
.picker .more { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 14px; color: var(--graphite); font-size: 13px; }
.sheet { position: absolute; inset: auto 0 0 0; max-height: 78vh; overflow: auto; padding: 20px var(--gutter) calc(24px + env(safe-area-inset-bottom)); background: #111; border-top: 1px solid #262626; z-index: 2; }

/* --- a recording's page --- */
.doc { max-width: 720px; margin: 0 auto; padding: 8px var(--gutter) 120px; }
.back { color: var(--graphite); font-size: 13px; text-decoration: none; }
.doc-title { display: block; width: 100%; margin: 26px 0 6px; padding: 0; background: none; border: 0; resize: none; overflow: hidden; font: 700 clamp(26px, 4.6vw, 38px)/1.25 var(--sans); }
.doc-title::placeholder { color: var(--ink); opacity: .35; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 0 18px; color: var(--graphite); font-size: 13px; }
.facts { display: grid; grid-template-columns: 4.5em minmax(0, 1fr); gap: 14px 12px; align-items: baseline; margin: 34px 0 0; }
.facts dt { color: var(--graphite); font-size: 13px; }
.facts dd { margin: 0; }
.seg { display: inline-flex; gap: 22px; }
.seg button { padding: 2px 0; color: var(--graphite); border-bottom: 2px solid transparent; }
.seg button[aria-pressed="true"] { color: var(--ink); font-weight: 700; border-color: var(--ink); }
.state { margin: 38px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.state .say { font-size: 17px; }
.state .bar { flex: 1 0 100%; height: 2px; background: var(--mist); }
.state .bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--bamboo); transition: width .6s ease; }
.state.ok .say { color: var(--bamboo); }
.player { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; margin: 44px 0 0; }
.player .play { width: 44px; aspect-ratio: 1; border-radius: 50%; background: var(--ink); position: relative; }
.player .play::before { content: ""; position: absolute; left: 53%; top: 50%; translate: -50% -50%; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent var(--paper); }
.player .play.on::before { width: 12px; height: 15px; border: 0; background: linear-gradient(90deg, var(--paper) 0 35%, transparent 35% 65%, var(--paper) 65%); left: 50%; }
.player canvas { width: 100%; height: 56px; display: block; cursor: pointer; }
.player .num { font-size: 13px; color: var(--graphite); min-width: 4.2em; text-align: right; }
.doc h2 { margin: 56px 0 12px; font-size: 13px; font-weight: 400; color: var(--graphite); }
.outline h3 { margin: 28px 0 8px; font-size: 19px; }
.outline ul { margin: 0; padding-left: 1.2em; }
.outline li { margin: 4px 0; }
.outline li.todo { list-style: none; margin-left: -1.2em; }
.outline li.todo::before { content: "□ "; }
.transcript p { display: grid; grid-template-columns: 3.4em minmax(0, 1fr); gap: 14px; margin: 0; padding: 10px 0; }
@media (min-width: 720px) { .transcript p { grid-template-columns: 4.6em minmax(0, 1fr); } }
.transcript p button { align-self: start; text-align: left; color: var(--graphite); font-size: 13px; padding-top: 4px; }
.transcript p.now { background: linear-gradient(90deg, var(--mist), transparent 85%); }
.transcript p.gap { color: var(--graphite); font-size: 13px; }
.transcript .star { font-style: normal; margin-right: .3em; }
.doc-foot { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-top: 64px; padding-top: 18px; border-top: 1px solid var(--mist); }

/* --- the way in --- */
.door { min-height: 80vh; display: grid; place-content: center; justify-items: center; gap: 28px; text-align: center; padding: 0 var(--gutter); }
.door .ear.home { width: min(420px, 86vw); }
.door h1 { margin: 0; font-size: 28px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
