/* Menomentis — the files appended to the goal (AppendFiles.js,
   GoalFiles.js): the paperclip, the drop card, what it holds, and a file
   drawn small. Loaded by the project page and the home page, whose new
   project takes files as a card of its own. */

/* ---------- AppendFiles ---------- */

/* The round paperclip beside the goal definition's Send, and at the end of
   the head of the block files are appended in (AppendFiles.js): Send's size,
   a circle — with the board's +, the system's round controls — ink, not
   ochre: appending files sets nothing to work. */
.af-clip {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--space-8);
  height: var(--space-8);
  padding: 0;
  border: var(--stroke-hairline) solid var(--line);
  border-radius: 50%;
  background: var(--bg-surface);
  color: var(--ink-muted);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background-color 140ms cubic-bezier(0.2, 0, 0, 1), border-color 140ms cubic-bezier(0.2, 0, 0, 1);
}

.af-clip:hover {
  border-color: var(--line-strong);
  background: var(--bg-hover);
  color: var(--ink-strong);
}

.af-clip:focus-visible {
  outline: var(--stroke-rule) solid var(--focus-ring);
  outline-offset: 2px;
}

/* The drop card: a modal sheet in the middle of the screen, as the
   invitation to the interview is, its title and what it holds from one
   left edge, Done at its foot and the cross at its top right. */
.af {
  width: min(560px, 100% - var(--space-8));
  max-width: none;
  max-height: calc(100% - var(--space-8));
  margin: auto;
  padding: 0;
  overflow: auto;
  border: var(--stroke-hairline) solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--bg-raised);
  color: var(--ink);
  box-shadow: var(--shadow-raised);
  font-family: var(--font-sans);
}

.af:focus-visible {
  outline: var(--stroke-rule) solid var(--focus-ring);
  outline-offset: 2px;
}

.af::backdrop {
  background: var(--bg-scrim);
}

.af__body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-6);
  padding: var(--space-6);
}

.af__title {
  margin: 0;
  padding-right: var(--space-10);
  color: var(--ink-strong);
}

.af__close {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
}

.af__done.mm-btn {
  align-self: flex-start;
}

@media (prefers-reduced-motion: no-preference) {
  .af[open] {
    animation: app-arrive-up 160ms cubic-bezier(0.2, 0, 0, 1);
  }

  .af[open]::backdrop {
    animation: app-fade 160ms cubic-bezier(0.2, 0, 0, 1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .af[open],
  .af[open]::backdrop {
    animation: app-fade 160ms linear;
  }
}

/* What the drop card holds, the interview's files question opens and the
   home page draws under a new project's title: a block drawn as the file
   manager is — its ground in a line edge at a field's corner — the files
   appended as thumbnails in a row, the paperclip in its top right corner,
   and under a hairline its lower half, the description: a fold that opens
   the field it is written in. Every part starts at one edge, space-4 in.
   The whole of it takes a drop: files held over it lift it off the page on
   shadow-raised, firm its edge and fill where the files stand, so letting
   go is seen to put them in. */
.af-drop {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: var(--stroke-hairline) solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  font-family: var(--font-sans);
  color: var(--ink);
  transition: border-color 140ms cubic-bezier(0.2, 0, 0, 1), box-shadow 140ms cubic-bezier(0.2, 0, 0, 1), transform 140ms cubic-bezier(0.2, 0, 0, 1);
}

/* Its ground: in Newsprint the file manager's well, bg-sunken, a step into
   the page; in Typewriter a step off it instead, bg-surface, as the card
   under the goal definition's title stands — chosen so by the owner on
   2026-10-25, since a well on the dark page sank out of sight. */
:root[data-theme="dark"] .af-drop {
  background: var(--bg-surface);
}

.af-drop--over {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-raised);
  transform: translateY(calc(-1 * var(--space-1)));
}

@media (prefers-reduced-motion: reduce) {
  .af-drop {
    transition: border-color 140ms linear, box-shadow 140ms linear;
  }

  .af-drop--over {
    transform: none;
  }
}

.af-drop__input {
  display: none;
}

/* Where the files stand, on the left, and the paperclip at the right of
   their first line; filled while files are held over the block. */
.af-drop__body {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2) var(--space-3) var(--space-4);
  transition: background-color 140ms cubic-bezier(0.2, 0, 0, 1);
}

.af-drop--over .af-drop__body {
  background: var(--bg-hover);
}

.af-drop__shown {
  flex: 1 1 auto;
  min-width: 0;
}

/* With nothing appended, what the block takes, as the file manager says an
   empty folder is: on the paperclip's line, and as tall as the block stood
   when a head named the folder over it, so taking the head away left the
   block its height. */
.af-drop__empty {
  box-sizing: border-box;
  min-height: calc(var(--space-12) + var(--space-1) + var(--stroke-hairline) + 1lh);
  margin: 0;
  padding-top: calc((var(--space-8) - 1lh) / 2);
  color: var(--ink-faint);
}

.af-drop__said {
  margin: var(--space-2) 0 0;
  color: var(--ink-muted);
}

/* The files appended, small, in a row that scrolls sideways. */
.af-drop__files {
  display: flex;
  gap: var(--space-3);
  margin: 0;
  padding: 0 0 var(--space-1);
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.af-drop__file {
  position: relative;
  flex: none;
}

/* The cross in a thumbnail's corner that takes it off, as an image's over a
   message has; where there is a pointer it waits for the thumbnail to be
   hovered, or itself to have the keys. */
.af-drop__remove {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--space-5);
  height: var(--space-5);
  padding: 0;
  border: var(--stroke-hairline) solid var(--line-hairline);
  border-radius: var(--radius-xs);
  background: var(--bg-raised);
  color: var(--ink-muted);
  cursor: pointer;
}

.af-drop__remove:hover {
  border-color: var(--line-strong);
  color: var(--ink-strong);
}

.af-drop__remove:focus-visible {
  outline: var(--stroke-rule) solid var(--focus-ring);
  outline-offset: 2px;
}

@media (hover: hover) {
  .af-drop__remove {
    opacity: 0;
    transition: opacity 120ms cubic-bezier(0.2, 0, 0, 1);
  }

  .af-drop__file:hover .af-drop__remove,
  .af-drop__remove:focus-visible {
    opacity: 1;
  }
}

/* The description, the block's lower half under a hairline: a fold row —
   the ⌄ in a space-6 square, as the chat's steps fold, with "File
   description" beside it in ink-muted — and, open, the field it is written
   in, taking the half: no edge of its own, the document face in ink-strong,
   about as tall as the files' half and growing with what is written, with
   no grip in its corner. Pressed, the ⌄ turns up and the field slides open
   out of a fade, 140ms; with reduced motion it only fades. The block's own
   edge firms to line-strong while the field has the keys, as a card's does
   round a field inside it. */
.af-drop__about {
  border-top: var(--stroke-hairline) solid var(--line-hairline);
}

.af-drop__head {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-2);
}

.af-drop__fold {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--space-6);
  height: var(--space-6);
  padding: 0;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}

.af-drop__head:hover .af-drop__fold {
  background: var(--bg-hover);
  color: var(--ink-strong);
}

.af-drop__fold:focus-visible {
  outline: var(--stroke-rule) solid var(--focus-ring);
  outline-offset: 2px;
}

.af-drop__chev {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 140ms cubic-bezier(0.2, 0, 0, 1);
}

/* Down while there is something to open, turned up while it is open. */
.af-drop--open .af-drop__chev {
  transform: rotate(180deg);
}

.af-drop__word {
  color: var(--ink-muted);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.af-drop__head:hover .af-drop__word {
  color: var(--ink);
}

/* Folded, hidden from the keys once the fade is done; opened, in sight at
   once, so the caret can go into the field as the ⌄ is pressed. */
.af-drop__half {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  opacity: 0;
  transition: grid-template-rows 140ms cubic-bezier(0.2, 0, 0, 1), opacity 140ms cubic-bezier(0.2, 0, 0, 1), visibility 0s linear 140ms;
}

.af-drop--open .af-drop__half {
  grid-template-rows: 1fr;
  visibility: visible;
  opacity: 1;
  transition: grid-template-rows 140ms cubic-bezier(0.2, 0, 0, 1), opacity 140ms cubic-bezier(0.2, 0, 0, 1), visibility 0s;
}

.af-drop__half-in {
  min-height: 0;
  overflow: clip;
}

.af-drop__text {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: calc(3lh + var(--space-6));
  max-height: calc(10lh + var(--space-6));
  margin: 0;
  padding: var(--space-2) var(--space-4) var(--space-4);
  border: none;
  background: transparent;
  color: var(--ink-strong);
  field-sizing: content;
  resize: none;
  outline: none;
  caret-color: var(--ink-strong);
}

.af-drop:has(.af-drop__text:focus) {
  border-color: var(--line-strong);
}

@media (prefers-reduced-motion: reduce) {
  .af-drop__chev {
    transition: none;
  }

  .af-drop__half {
    transition: opacity 140ms linear, visibility 0s linear 140ms;
  }

  .af-drop--open .af-drop__half {
    transition: opacity 140ms linear, visibility 0s;
  }
}

/* ---------- GoalFiles ---------- */

/* The files appended to the goal definition, under its title (GoalFiles.js):
   a card as the one over the title is, its eyebrow, the thumbnails in a row
   that scrolls sideways, and what the person wrote of them. */
.gf {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0 0 var(--space-6);
  padding: var(--space-4) var(--space-5);
  border: var(--stroke-hairline) solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  font-family: var(--font-sans);
}

.gf__label {
  text-transform: uppercase;
  color: var(--ink-faint);
}

.gf__row {
  display: flex;
  gap: var(--space-4);
  margin: 0;
  padding: 0 0 var(--space-1);
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.gf__item {
  flex: none;
}

.gf__about {
  margin: 0;
  max-width: 80ch;
  color: var(--ink-muted);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* One file small: a square page on the canvas in a line edge, as the
   interview's drawing has the goal definition, and its name under it in
   the document face, as every file name is. */
.gf-thumb {
  --gf-w: calc(var(--space-16) + var(--space-8));
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: var(--gf-w);
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.gf-thumb--small {
  --gf-w: var(--space-16);
}

.gf-thumb--press {
  cursor: pointer;
}

.gf-thumb__page {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: var(--stroke-hairline) solid var(--line);
  border-radius: var(--radius-0);
  background: var(--bg-canvas);
}

.gf-thumb--press:hover .gf-thumb__page {
  border-color: var(--line-strong);
}

.gf-thumb--press:focus-visible {
  outline: var(--stroke-rule) solid var(--focus-ring);
  outline-offset: 2px;
}

.gf-thumb__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
}

.gf-thumb__img--cover {
  object-fit: cover;
  object-position: center;
}

.gf-thumb__kind {
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* A document's first lines, as its page begins: the document face, set
   small enough to show the shape of the page. */
.gf-thumb__text {
  align-self: stretch;
  width: 100%;
  padding: var(--space-2);
  overflow: hidden;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 7px;
  line-height: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gf-thumb__name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gf-thumb--press:hover .gf-thumb__name {
  color: var(--ink-strong);
  text-decoration: underline;
}

/* ---------- FilePreview ---------- */

/* A file seen in a card (FilePreview.js), opened from its thumbnail in the
   block files are appended in: a modal sheet in the middle of the screen,
   as the drop card is, its head — the file's name in the document face,
   what the file is sized or turned with, the cross — space-12 tall over a
   hairline, and under it the file on the canvas, as a window shows one. A
   document's card is the writing measure wide. */
.fp {
  width: min(1040px, 100% - var(--space-8));
  height: min(880px, 100% - var(--space-8));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: var(--stroke-hairline) solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--bg-raised);
  color: var(--ink);
  box-shadow: var(--shadow-raised);
  font-family: var(--font-sans);
}

.fp[open] {
  display: flex;
  flex-direction: column;
}

.fp--text {
  width: min(800px, 100% - var(--space-8));
}

.fp:focus-visible {
  outline: none;
}

.fp::backdrop {
  background: var(--bg-scrim);
}

@media (prefers-reduced-motion: no-preference) {
  .fp[open] {
    animation: app-arrive-up 160ms cubic-bezier(0.2, 0, 0, 1);
  }

  .fp[open]::backdrop {
    animation: app-fade 160ms cubic-bezier(0.2, 0, 0, 1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fp[open],
  .fp[open]::backdrop {
    animation: app-fade 160ms linear;
  }
}

.fp__head {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--space-12);
  padding: 0 var(--space-3) 0 var(--space-5);
  border-bottom: var(--stroke-hairline) solid var(--line-hairline);
}

.fp .fp__name {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink-strong);
  font-family: var(--font-mono);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.fp__tools {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.fp__close {
  flex: none;
}

/* ← → and − +: a key's character in a square of its own, as the PDF
   viewer's bar sets them (brand book, Symbols). */
.fp__sym {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--space-6) + var(--space-1));
  height: calc(var(--space-6) + var(--space-1));
  padding: 0;
  border: var(--stroke-hairline) solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

@media (hover: none) {
  .fp__sym {
    width: var(--space-10);
    height: var(--space-10);
  }
}

.fp__sym:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--ink-strong);
}

.fp__sym:focus-visible {
  outline: var(--stroke-rule) solid var(--focus-ring);
  outline-offset: 2px;
}

/* The size, "150%", a word pressed as a button: it underlines. */
.fp__word {
  padding: 0 var(--space-2);
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--ink-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.fp__word:hover:not(:disabled) {
  color: var(--ink-strong);
  text-decoration: underline;
  text-decoration-thickness: var(--stroke-hairline);
  text-underline-offset: 0.25em;
}

.fp__word:focus-visible {
  color: var(--ink-strong);
  outline: none;
  text-decoration: underline;
  text-decoration-thickness: var(--stroke-rule);
  text-underline-offset: 0.25em;
}

.fp__sym:disabled,
.fp__word:disabled {
  color: var(--ink-faint);
  cursor: default;
}

/* The page shown, of how many: a figure, not a field. */
.fp__where {
  padding: 0 var(--space-2);
  color: var(--ink-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.fp__at {
  color: var(--ink-strong);
}

.fp__body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  background: var(--bg-canvas);
}

.fp__over {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  pointer-events: none;
}

.fp__note {
  margin: 0;
  color: var(--ink-muted);
}

/* An image or a page, centred with space-6 round it; larger than the
   card, it scrolls, and a mouse drags it about. */
.fp__stage {
  flex: 1;
  min-width: 0;
  display: flex;
  overflow: auto;
  padding: var(--space-6);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.fp__stage--pan {
  cursor: grab;
}

.fp__stage--panning {
  cursor: grabbing;
}

.fp__stage--pdf {
  overflow: hidden;
}

.fp__img {
  flex: none;
  display: block;
  max-width: none;
  margin: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.fp__hold {
  flex: none;
  display: flex;
  margin: auto;
}

/* A sheet is paper, whatever the theme, as in the PDF viewer. */
.fp__page {
  display: block;
  background: var(--paper);
  box-shadow: var(--shadow-card);
}

/* A document's text, written in where it stands: the document face, no
   edge of its own, scrolling inside the card. */
.fp__text {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: var(--space-6);
  border: none;
  outline: none;
  resize: none;
  overflow: auto;
  background: transparent;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.fp__text::selection {
  background: var(--text-selection);
}
