/* Head Untangled Studio: the site's tokens, phone-first, one column, 16px gutters. */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0F1420;
  --paper: #F4F1EA;
  --surface: #FBF9F4;
  --line: #DDD8CC;
  --text: #0F1420;
  --muted: #4A5163;
  --amber: #F2B544;
  --amber-ink: #7A5200;
  --amber-soft: #FBEBC6;
  --warn: #B23A2E;
  --warn-soft: #F8E1DD;
  --ok-soft: #DFF3E4;
  --focus: #0F1420;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F1420;
    --surface: #171C2A;
    --line: #2B3244;
    --text: #F4F1EA;
    --muted: #B3B9C7;
    --amber-ink: #F2B544;
    --amber-soft: #3A2E12;
    --warn-soft: #3A1F1C;
    --ok-soft: #1D3324;
    --focus: #F2B544;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #0F1420;
  --surface: #171C2A;
  --line: #2B3244;
  --text: #F4F1EA;
  --muted: #B3B9C7;
  --amber-ink: #F2B544;
  --amber-soft: #3A2E12;
  --warn-soft: #3A1F1C;
  --ok-soft: #1D3324;
  --focus: #F2B544;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .5rem; font-weight: 650; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; margin-top: 1.5rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

.wrap { width: 100%; max-width: 44rem; margin: 0 auto; padding: 0 16px; }

/* Header */
.top { border-bottom: 1px solid var(--line); background: var(--ink); color: #F4F1EA; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 3.5rem; }
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; font-weight: 650; font-size: 1rem; letter-spacing: -0.02em; color: #F4F1EA; white-space: nowrap; }
.brand svg { width: 1.6rem; height: 1.9rem; color: #F4F1EA; flex: none; }
.brand b { color: var(--amber); font-weight: 650; }
.top nav { white-space: nowrap; }
.top nav a { color: #B3B9C7; text-decoration: none; font-size: .9rem; margin-left: .9rem; }
.top nav a[aria-current="page"] { color: #F4F1EA; border-bottom: 2px solid var(--amber); }

main { padding: 1rem 0 4rem; }

/* Buttons and fields */
button, .button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: 0 1.1rem; border-radius: 999px; border: 1.5px solid var(--text);
  background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; font-weight: 600;
}
button.primary, .button.primary { background: var(--amber); border-color: var(--amber); color: #0F1420; }
button.danger { border-color: var(--warn); color: var(--warn); }
button.quiet { border-color: var(--line); color: var(--muted); font-weight: 500; }
button:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.row.end { justify-content: flex-end; }
label { display: block; font-weight: 600; margin: 1rem 0 .3rem; }
label .hint { display: block; font-weight: 400; color: var(--muted); font-size: .9rem; }
input[type="text"], input[type="number"], input[type="email"], input[type="datetime-local"], select, textarea {
  width: 100%; min-height: 44px; padding: .6rem .8rem; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--surface);
}
textarea { min-height: 6rem; resize: vertical; }
textarea.note { min-height: 3rem; font-size: .95rem; margin-top: .4rem; }
fieldset { border: 0; padding: 0; margin: 0; }
.choice { display: flex; gap: .5rem; flex-wrap: wrap; }
.choice label { margin: 0; flex: 1 1 8rem; }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice span {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 1rem;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600;
}
.choice input:checked + span { background: var(--amber); border-color: var(--amber); color: #0F1420; }
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .6rem; }

/* Cards and lists */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1rem; margin: .6rem 0; display: block; color: inherit; text-decoration: none;
}
a.card:hover { border-color: var(--text); }
.card .head { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.card .title { font-weight: 650; }
.badge { display: inline-block; font-size: .78rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
  padding: .15rem .55rem; border-radius: 999px; background: var(--amber-soft); color: var(--amber-ink); }
.badge.kind { background: var(--line); color: var(--text); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.ok { background: var(--ok-soft); }
.next { color: var(--muted); font-size: .92rem; margin-top: .25rem; }
.group h2 { display: flex; align-items: center; gap: .5rem; }
.group h2::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--amber); }
.group.needs_you h2::before { background: var(--warn); }
details.finished > summary { cursor: pointer; color: var(--muted); padding: .75rem 0; font-weight: 600; }
.empty { color: var(--muted); padding: 2rem 0; text-align: center; }

/* Panels */
.panel { border-radius: var(--radius); padding: .9rem 1rem; margin: .75rem 0; border: 1px solid var(--line); background: var(--surface); }
.panel.warn { background: var(--warn-soft); border-color: var(--warn); }
.panel.amber { background: var(--amber-soft); border-color: var(--amber); }
.stage { font-size: 1.15rem; font-weight: 650; }

/* Job page */
.preview { border-radius: var(--radius); overflow: hidden; background: #000; margin: .75rem 0; }
.preview video { width: 100%; }
details.block { border-top: 1px solid var(--line); padding: .25rem 0; }
details.block > summary { cursor: pointer; font-weight: 650; padding: .75rem 0; list-style: none; display: flex; justify-content: space-between; }
details.block > summary::after { content: "+"; color: var(--muted); }
details.block[open] > summary::after { content: "−"; }
.section { padding: .5rem 0 .75rem; }
.section .id { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stills { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.still { position: relative; border-radius: 8px; overflow: hidden; background: var(--line); }
.still img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.still .n { position: absolute; left: .4rem; top: .3rem; font-size: .75rem; font-weight: 700; color: #F4F1EA; text-shadow: 0 1px 2px #000; }
.still .moving { position: absolute; right: .4rem; top: .3rem; }
.still textarea { display: none; }
.still.open textarea { display: block; }
.titles li { padding: .35rem 0; display: flex; justify-content: space-between; gap: 1rem; }
.titles .score { color: var(--muted); font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; font-size: .95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.actions { position: sticky; bottom: 0; background: var(--paper); padding: .75rem 0 1rem; border-top: 1px solid var(--line); margin-top: 1rem; }
.changes li { margin-bottom: .4rem; }
.log { font-size: .9rem; color: var(--muted); white-space: pre-wrap; }

dialog { border: 0; border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 1.25rem; width: min(92vw, 28rem); }
dialog::backdrop { background: rgba(15, 20, 32, .6); }

.toast { position: fixed; left: 16px; right: 16px; bottom: 1rem; background: var(--ink); color: #F4F1EA; padding: .8rem 1rem; border-radius: 10px; z-index: 20; }

@media (min-width: 640px) {
  h1 { font-size: 2rem; }
  .stills { grid-template-columns: 1fr 1fr 1fr; }
}
