/*
 * Amstutz Creative tools — built on the brand sheet, not beside it.
 * Five values, no accent. Status is carried by form (how full the mark is),
 * never by colour, because colour on this brand belongs to the photography.
 * Single light theme on purpose: the brand is paper and ink.
 */
:root {
  --paper: #ffffff;
  --panel: #f2f2f1;
  --ink:   #111111;
  --mid:   #6e6e6b;
  --rule:  #e4e4e2;

  --sans: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --edge: clamp(14px, 3.2vw, 44px);
  --gap: clamp(10px, 1.3vw, 18px);
  --card-min: clamp(132px, 11.5vw, 176px);
  --pill: 100px;
  --card: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.micro {
  font: 400 10px/1.4 var(--mono);
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--mid);
  margin: 0;
}
.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}


/* ---------- controls ---------- */

.pill {
  appearance: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  border: 1px solid var(--ink); border-radius: var(--pill);
  background: var(--paper);
  font-size: 13px; font-weight: 500; line-height: 1.2;
  cursor: pointer; white-space: nowrap;
}
.pill:hover { background: var(--panel); }
.pill.solid { background: var(--ink); color: var(--paper); }
.pill.solid:hover { background: #2a2a2a; }

.input, .textarea, .select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--rule); border-radius: 0;
  background: var(--paper);
  font-size: 14px; line-height: 1.45;
}
.input:hover, .textarea:hover { border-color: var(--mid); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--ink); }
.textarea { resize: vertical; min-height: 84px; display: block; }
.select { width: auto; border-radius: var(--pill); padding: 7px 14px; }
.invalid { border-color: var(--ink); border-style: dashed; }

/* ---------- top + intro ---------- */

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px var(--edge);
}
.wordmark { font-size: 14.5px; font-weight: 500; letter-spacing: -.014em; }
.wordmark .slash { color: var(--mid); font-weight: 400; }
.top-actions { display: flex; align-items: center; gap: 12px; }

.intro {
  display: grid; gap: 22px;
  padding: clamp(14px, 3vw, 34px) var(--edge) clamp(18px, 2.4vw, 26px);
}
.intro-main { display: grid; gap: 12px; min-width: 0; }
@media (min-width: 980px) {
  /* title left, progress right: the reels start higher on the page */
  .intro { grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); column-gap: 56px; align-items: end; }
  .progress { margin-top: 0; }
}
h1 {
  font-size: clamp(26px, 4.6vw, 52px); font-weight: 500;
  line-height: 1.02; letter-spacing: -.036em;
  margin: 0; text-wrap: balance;
}
.deck { margin: 0; max-width: 62ch; color: var(--mid); font-size: clamp(13px, 1.2vw, 15px); line-height: 1.5; }

.progress { display: grid; gap: 10px; max-width: 720px; margin-top: 10px; }
.progress-head { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.progress-num {
  font-size: clamp(26px, 3vw, 36px); font-weight: 500; letter-spacing: -.03em;
  line-height: 1; font-variant-numeric: tabular-nums;
}
.progress-label { color: var(--mid); font-size: 14px; }

.meter { display: flex; height: 6px; border-radius: var(--pill); overflow: hidden; background: var(--panel); }
.meter span { display: block; height: 100%; }
.meter .m-approved { background: var(--ink); }
.meter .m-revise   { background: var(--mid); }
.meter .m-review   { background: repeating-linear-gradient(90deg, var(--mid) 0 1px, transparent 1px 4px); }

.tally {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px 20px;
  font-size: 13px; color: var(--mid);
}
.tally li { display: inline-flex; align-items: center; gap: 7px; }
.tally b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

.brief { max-width: 68ch; margin-top: 4px; }
.brief summary {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; list-style: none; font-size: 13.5px;
}
.brief summary::-webkit-details-marker { display: none; }
.brief summary::before { content: "+"; font-family: var(--mono); color: var(--mid); width: 10px; }
.brief[open] summary::before { content: "−"; }
.brief p { margin: 8px 0 0 18px; color: var(--mid); white-space: pre-line; max-width: 62ch; }

/* ---------- status mark: fuller as the reel moves toward approved ---------- */

.mark {
  --p: 0;
  flex: none; display: inline-block;
  width: 10px; height: 10px; border-radius: 50%;
  border: 1px solid var(--ink);
  background: conic-gradient(var(--ink) calc(var(--p) * 1%), transparent 0);
}
.mark.edit     { --p: 0; border-color: var(--mid); }
.mark.review   { --p: 50; }
.mark.revise   { --p: 75; }
.mark.approved { --p: 100; }

.status {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px 3px 8px;
  border: 1px solid var(--rule); border-radius: var(--pill);
  font-size: 12.5px; line-height: 1.35; white-space: nowrap;
}
.status.edit     { color: var(--mid); }
.status.review   { border-color: var(--ink); }
.status.approved { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.status.approved .mark { border-color: var(--paper); background: var(--paper); }

.moment-tag {
  display: inline-block; padding: 3px 9px;
  border-radius: var(--pill); background: var(--panel);
  font: 400 10px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- toolbar ---------- */

.toolbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 11px var(--edge);
  background: var(--paper);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  appearance: none;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--rule); border-radius: var(--pill);
  background: var(--paper); color: var(--mid);
  font-size: 13px; line-height: 1.2; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--mid); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip[aria-pressed="true"] .mark { border-color: var(--paper); background: conic-gradient(var(--paper) calc(var(--p) * 1%), transparent 0); }
.chip .count { font: 400 11px/1 var(--mono); opacity: .75; font-variant-numeric: tabular-nums; }

.toolbar-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; flex: 1 1 auto; min-width: 0; }
.toolbar-tools { display: flex; align-items: center; gap: 14px; flex: none; margin-left: auto; }
.toolbar { flex-wrap: nowrap; }
.search { margin-left: 0; }
.search input {
  width: min(220px, 60vw);
  padding: 7px 0; border: 0; border-bottom: 1px solid var(--rule);
  background: transparent; font-size: 13.5px;
}
.search input:focus { outline: none; border-bottom-color: var(--ink); }

.viewtoggle { display: inline-flex; padding: 2px; border: 1px solid var(--rule); border-radius: var(--pill); }
.viewtoggle button {
  appearance: none; border: 0; background: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--pill);
  font-size: 13px; color: var(--mid);
}
.viewtoggle svg { fill: currentColor; }
.viewtoggle button:hover { color: var(--ink); }
.viewtoggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------- content ---------- */

.content { padding: clamp(20px, 2.6vw, 30px) var(--edge) 40px; }
.group + .group { margin-top: clamp(36px, 4.4vw, 56px); }
.group-head {
  display: flex; align-items: baseline; gap: 8px;
  margin: 0 0 14px;
  font-size: 15px; font-weight: 500; letter-spacing: -.012em;
}
.group-head .count { font: 400 11px/1 var(--mono); color: var(--mid); }
.empty { color: var(--mid); padding: 40px 0; margin: 0; }

/* media: poster underneath, loop fades in once it's actually playing */
.media {
  position: relative; display: block;
  aspect-ratio: 9 / 16; border-radius: var(--card); overflow: hidden;
  background: var(--panel);
}
.media img, .media video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.media video { opacity: 0; transition: opacity .25s; }
.media.playing video { opacity: 1; }
.media.none { display: flex; align-items: center; justify-content: center; }
.none-label {
  font: 400 9.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--mid); text-align: center; padding: 4px;
}

/* grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr));
  gap: 28px var(--gap);
}
.card { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.card-open {
  appearance: none; border: 0; background: none; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
  text-align: left; cursor: pointer; min-width: 0;
}
.card-open:focus-visible { outline-offset: 4px; border-radius: var(--card); }
.card-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 14.5px; font-weight: 500; letter-spacing: -.012em; line-height: 1.3;
}
.card-open:hover .card-title { text-decoration: underline; text-decoration-color: var(--mid); text-underline-offset: 3px; }
.card-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.card-meta { display: block; font: 400 11px/1.4 var(--mono); color: var(--mid); }

/* whether each column has been filled: filled dot = there, hollow = not yet */
.card-links { display: flex; flex-wrap: wrap; gap: 3px 12px; font: 400 10.5px/1.5 var(--mono); }
.ind { display: inline-flex; align-items: center; gap: 5px; color: var(--mid); text-decoration: none; white-space: nowrap; }
.ind::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  border: 1px solid currentColor; box-sizing: border-box;
}
.ind.on { color: var(--ink); }
.ind.on::before { background: currentColor; }
a.ind:hover { text-decoration: underline; text-underline-offset: 3px; }

/* list */
.listwrap { overflow-x: auto; }
.list { width: 100%; min-width: 1180px; border-collapse: collapse; font-size: 13.5px; }
.list th {
  font: 400 10px/1.4 var(--mono); letter-spacing: .17em; text-transform: uppercase;
  color: var(--mid); text-align: left; white-space: nowrap;
  padding: 0 14px 10px 0; border-bottom: 1px solid var(--ink);
}
.list td { padding: 9px 14px 9px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.list tbody tr { cursor: pointer; }
.list tbody tr:hover td { background: var(--panel); }
.list tbody tr:hover td:first-child { border-radius: var(--card) 0 0 var(--card); }
.l-thumb { width: 52px; padding-left: 4px !important; }
.l-thumb .media { width: 38px; }
.l-reel { min-width: 240px; }
.row-open {
  appearance: none; border: 0; background: none; padding: 0; cursor: pointer;
  text-align: left; font-size: 14.5px; font-weight: 500; letter-spacing: -.01em; line-height: 1.3;
}
.row-meta { font: 400 11px/1.4 var(--mono); color: var(--mid); margin-top: 3px; }
.l-status { width: 140px; }
.l-moment { width: 96px; }
.snippet {
  display: block; max-width: 280px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.l-link { width: 110px; }
.linkpill {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 3px 10px; border: 1px solid var(--rule); border-radius: var(--pill);
  color: var(--ink); text-decoration: none; font-size: 12.5px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; background: var(--paper);
}
.linkpill:hover { border-color: var(--ink); }
.linkpill .arrow { color: var(--mid); }
.updated { font: 400 11px/1.5 var(--mono); color: var(--mid); white-space: nowrap; }
.dash { color: var(--mid); font-family: var(--mono); }


.foot { padding: 40px var(--edge); }
.foot p { margin: 0; font: 400 10px/1.4 var(--mono); letter-spacing: .17em; text-transform: uppercase; color: var(--mid); }

/* ---------- lightbox ---------- */

.panel {
  --lb-h: min(66vh, 720px);
  border: 0; padding: 0; border-radius: var(--card);
  /* fit-content keeps the dialog's native centering; auto would stretch it edge to edge */
  width: fit-content; max-width: 96vw; max-height: 96vh; overflow: auto;
  background: var(--paper); color: var(--ink);
}
.panel::backdrop { background: rgba(17, 17, 17, .72); }
.lightbox {
  display: grid; gap: 12px;
  padding: 12px;
  width: max(300px, calc(var(--lb-h) * 9 / 16 + 24px));
}
.lb-side { display: grid; gap: 12px; align-content: start; min-width: 0; }

/* Wide enough: fields sit beside the tall vertical video instead of under it,
   so the whole thing fits without the panel scrolling. */
@media (min-width: 760px) {
  .lightbox {
    grid-template-columns: auto minmax(300px, 360px);
    width: calc(var(--lb-h) * 9 / 16 + 360px + 36px);
    align-items: start;
  }
  .lb-bar { grid-column: 1 / -1; }
  .lb-take { grid-template-columns: 1fr; }
}
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.lb-name { display: flex; align-items: baseline; gap: 8px; margin: 0; min-width: 0; }
.lb-count { flex: none; font: 400 11px/1 var(--mono); color: var(--mid); font-variant-numeric: tabular-nums; }
.lb-title {
  font-size: 15px; font-weight: 500; letter-spacing: -.012em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.icon {
  appearance: none; width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule); border-radius: 50%; background: var(--paper);
  font-size: 15px; cursor: pointer;
}
.icon:hover { border-color: var(--ink); }
.icon:disabled { opacity: .35; cursor: default; }
.lb-video { width: 100%; }
/* carries its own poster, so it stays visible even if autoplay is blocked */
.lb-video video { opacity: 1; }

.lb-inspo { display: grid; gap: 6px; }

/* check-out + footage share one strip under the inspo link */
.lb-take {
  display: grid; gap: 12px;
  padding-top: 12px; border-top: 1px solid var(--rule);
}
.lb-block { display: grid; gap: 6px; align-content: start; min-width: 0; }
.lb-footage { justify-items: start; }
.take-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-width: 0; margin: 0; }
.take-row .input { flex: 1 1 140px; min-width: 0; }
.take-row { flex-wrap: nowrap; }
.take-row:has(.take-actions) { flex-wrap: wrap; justify-content: space-between; }
.lb-footage { grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; }
.take-who { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-size: 14px; min-width: 0; }
.take-who b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.take-when { color: var(--mid); font-size: 12.5px; white-space: nowrap; }
.take-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.lb-footage .pill { text-decoration: none; color: var(--ink); }
.footage-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }

/* who has a reel: a filled ink dot and their name */
.owner-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.owner-tag {
  flex: none; padding: 2px 7px; border-radius: var(--pill); background: var(--panel);
  font: 400 9.5px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mid);
}
.owner-none { color: var(--mid); }
.owner-line.none .owner-dot { display: none; }
.owner-line {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  font-size: 12.5px; color: var(--ink);
}
.card-open .owner-line { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.l-owner { width: 168px; white-space: nowrap; }

.footage-all {
  justify-self: start; font-size: 13.5px; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--mid); text-underline-offset: 3px;
}
.footage-all:hover { text-decoration-color: var(--ink); }
.inspo-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-width: 0; }
.inspo-row .input { flex: 1 1 180px; min-width: 0; }
.inspo { flex: 1 1 auto; min-width: 0; white-space: pre-line; overflow-wrap: anywhere; font-size: 14px; }
.inspo a { color: inherit; text-decoration-color: var(--mid); text-underline-offset: 3px; }
.open-link { font-size: 13px; color: var(--ink); white-space: nowrap; text-underline-offset: 3px; }
.hint { font-size: 12.5px; color: var(--mid); }
.text-button {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 2px 0;
  color: var(--mid); font-size: 12.5px;
  text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px;
}
.text-button:hover { color: var(--ink); text-decoration-color: var(--ink); }

/* ---------- toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 20;
  transform: translate(-50%, 12px);
  background: var(--ink); color: var(--paper);
  padding: 9px 18px; border-radius: var(--pill);
  font-size: 13px; opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .toast, .media video { transition: none; }
}

@media (max-width: 760px) {
  :root { --card-min: 132px; }
  .toolbar { flex-wrap: wrap; }
  /* one swipeable row of chips, so the pinned bar stays two rows tall on a phone */
  .toolbar-filters {
    flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto;
    margin: 0 calc(-1 * var(--edge)); padding: 0 var(--edge);
    scrollbar-width: none;
  }
  .toolbar-filters::-webkit-scrollbar { display: none; }
  .toolbar-filters .chips { flex-wrap: nowrap; }
  .toolbar-tools { flex: 1 1 100%; margin-left: 0; }
  .search { flex: 1 1 auto; }
  .search input { width: 100%; }
  .panel { --lb-h: min(58vh, 560px); }
  .lightbox { width: min(96vw, 420px); }
}
