@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/archivo.woff2") format("woff2");
}

@font-face {
  font-family: "Martian Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/martian-mono.woff2") format("woff2");
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/archivo-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Martian Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/martian-mono-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --ground: #000;
  --ink: #fff;
  --ink-2: #b4b4bd;
  --ink-3: #85858f;
  --rule: #26262c;
  --rule-strong: #45454e;
  /* The brand gradient runs darker at the top to brighter at the bottom. Replace both with the exact brand blues. */
  --blue-top: #0b2c80;
  --blue-bottom: #2a6fe8;
  --blue-ink: #7fb0ff;
  --amber: #ffb84d;
  --text: "Archivo", "Segoe UI", system-ui, sans-serif;
  --data: "Martian Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --page: 1040px;
  --label: 208px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html {
  background: var(--ground);
  scrollbar-color: var(--rule-strong) var(--ground);
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  color: var(--ink);
  font: 400 16px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
  caret-color: var(--blue-ink);
}

::selection { background: var(--blue-bottom); color: #fff; }

.page { max-width: var(--page); margin: 0 auto; padding: 0 32px 96px; }

/* Docket header: the logo block, then labelled fields like the boxes of a waybill. */
.docket {
  display: grid;
  grid-template-columns: auto 1fr;
  border-bottom: 1px solid var(--rule-strong);
}

.brand {
  display: grid;
  place-items: center;
  width: 116px;
  padding: 16px 0;
  background: linear-gradient(to bottom, var(--blue-top), var(--blue-bottom));
}

/* The owner's logo file has a wide empty margin around its plate, so the frame shows the plate alone. The file itself is untouched. */
.logo { display: block; width: 68px; aspect-ratio: 1647 / 2115; overflow: hidden; }
.logo img { display: block; width: 182.15%; max-width: none; height: auto; margin: -26.84% 0 0 -41.04%; }

.fields { display: flex; flex-wrap: wrap; align-items: stretch; }

.field {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 16px 20px;
  border-left: 1px solid var(--rule);
  min-width: 0;
}

.field:first-child { border-left: 0; flex: 1 1 150px; }

.k {
  color: var(--ink-3);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.v { font-weight: 600; overflow-wrap: anywhere; }
.field h1 { margin: 0; font-size: 1.375rem; font-weight: 650; letter-spacing: -0.01em; line-height: 1.2; }

/* One weight of the data face ships, so it is never bolded by the browser. */
.data, .num { font-family: var(--data); font-size: 0.8125rem; font-weight: 400; font-synthesis: none; font-variant-numeric: tabular-nums; letter-spacing: 0; }
input.data::placeholder { font-family: var(--text); font-size: 1rem; }
.field .v.data { font-size: 1rem; }

/* Step rail: four stations on one line, marked done, current or still to do. */
.rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--rule);
}

.rail a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 16px 24px;
  color: var(--ink-3);
  text-decoration: none;
  border-left: 1px solid var(--rule);
  transition: color 0.2s var(--ease);
}

.rail li:first-child a { border-left: 0; padding-left: 0; }
.rail a:hover { color: var(--ink); }

.rail .dot {
  flex: none;
  width: 10px;
  height: 10px;
  border: 1px solid var(--rule-strong);
}

.rail [data-state="done"] { color: var(--ink-2); }
.rail [data-state="done"] .dot { background: var(--ink); border-color: var(--ink); }
.rail [data-state="now"] { color: var(--ink); font-weight: 600; }
.rail [data-state="now"] .dot { background: var(--blue-bottom); border-color: var(--blue-ink); }
.rail .state { margin-left: auto; padding-right: 24px; color: var(--ink-3); font-size: 0.75rem; font-weight: 400; }

/* Each part is a labelled band: its name in the left column, its work on the right. */
.part {
  display: grid;
  grid-template-columns: var(--label) minmax(0, 1fr);
  gap: 0 32px;
  padding: 40px 0 48px;
  border-bottom: 1px solid var(--rule);
}

.part > header { align-self: start; position: sticky; top: 24px; }
.part h2 { margin: 0 0 8px; font-size: 1.125rem; font-weight: 650; letter-spacing: -0.005em; line-height: 1.3; text-wrap: balance; }
.part h2 .n { margin-left: 10px; color: var(--ink-3); font: 400 0.75rem var(--data); white-space: nowrap; }
.part > header p { margin: 0; color: var(--ink-3); font-size: 0.875rem; }

h3 { margin: 40px 0 8px; font-size: 1rem; font-weight: 650; }

p { margin: 0 0 12px; max-width: 68ch; }
.quiet { color: var(--ink-2); font-size: 0.9375rem; }
.note { color: var(--amber); }
.note:empty, .quiet:empty { display: none; }
.ok { color: var(--ink-2); }
.note p { margin: 0 0 4px; }

a { color: var(--blue-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }

label { display: block; margin: 20px 0 8px; color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; }
.part label:first-child, header + div > label:first-child { margin-top: 0; }

input, select, textarea {
  width: 100%;
  max-width: 560px;
  padding: 11px 12px;
  color: var(--ink);
  font: inherit;
  background: var(--ground);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  outline: none;
  transition: border-color 0.15s var(--ease);
}

textarea { display: block; resize: vertical; min-height: 46px; }
select { cursor: pointer; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--blue-ink); outline: 2px solid var(--blue-bottom); outline-offset: 1px; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }

button {
  margin: 24px 12px 0 0;
  padding: 12px 20px;
  color: #fff;
  font: 600 0.9375rem var(--text);
  background: linear-gradient(to bottom, var(--blue-top), var(--blue-bottom));
  border: 1px solid var(--blue-bottom);
  border-radius: 3px;
  cursor: pointer;
  transition: filter 0.15s var(--ease), border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}

button:hover { filter: brightness(1.18); }
button:active { filter: brightness(0.92); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--blue-ink); outline-offset: 3px; }
button:disabled { opacity: 0.4; cursor: default; filter: none; }

button.plain { color: var(--ink); background: none; border-color: var(--rule-strong); font-weight: 500; }
button.plain:hover { border-color: var(--ink); filter: none; }

/* Drop area */
.drop {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 32px 24px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  border: 1px dashed var(--rule-strong);
  border-radius: 3px;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.drop strong { color: var(--ink); font-size: 1rem; font-weight: 600; }
.drop:hover, .drop:focus-within { border-color: var(--blue-ink); background: #0b2c8026; }
.drop input { position: absolute; inset: 0; width: 100%; max-width: none; height: 100%; opacity: 0; cursor: pointer; }

.bar { height: 2px; margin: 16px 0 8px; background: var(--rule); }
.bar i { display: block; width: 0; height: 100%; background: linear-gradient(to right, var(--blue-top), var(--blue-bottom)); transition: width 0.3s var(--ease); }

/* What the SOW asks for */
.asked { margin: 0 0 24px; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.asked li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 0.9375rem; }
.asked .data { color: var(--ink-2); padding-top: 2px; }
.asked .types { color: var(--ink-3); text-align: right; }

/* A handed in file and its custody trail */
.file { padding: 20px 0; border-bottom: 1px solid var(--rule); }
.file:first-child { margin-top: 24px; border-top: 1px solid var(--rule); }
.file-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.file-name { flex: 1 1 100%; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.file-name .data { margin-left: 12px; color: var(--ink-3); font-weight: 400; white-space: nowrap; }
.file select { width: auto; max-width: 200px; padding: 8px 10px; font-size: 0.875rem; }
.file button { margin: 0; padding: 8px 14px; font-size: 0.875rem; }

.trail { display: flex; flex-wrap: wrap; gap: 8px 0; margin: 16px 0 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 0.8125rem; }
.trail li { display: flex; align-items: center; }
/* The same square station mark as the step rail: filled when done, hollow amber when something is still needed. */
.trail li > .dot { flex: none; width: 8px; height: 8px; margin-right: 8px; background: var(--ink); border: 1px solid var(--ink); }
.trail li.open > .dot { background: none; border-color: var(--amber); }
.trail li.wait { color: var(--ink-3); }
.trail li.wait > .dot { background: none; border-color: var(--rule-strong); }
.trail li.live { color: var(--ink); }
.trail li.live > .dot { background: var(--blue-bottom); border-color: var(--blue-ink); }
.trail li + li::before { content: ""; width: 28px; height: 1px; margin: 0 12px; background: var(--rule-strong); }
.trail .data { margin-left: 8px; color: var(--ink-3); }
.trail .open { color: var(--amber); }
.print { max-width: none; margin: 12px 0 0; color: var(--ink); font-size: 0.75rem; overflow-wrap: anywhere; }
.print b { margin-right: 12px; color: var(--ink-3); font: 600 0.6875rem var(--text); letter-spacing: 0.09em; text-transform: uppercase; }

.file.fresh .trail li { animation: arrive 0.5s var(--ease) both; }
.file.fresh .trail li:nth-child(2) { animation-delay: 0.18s; }
.file.fresh .trail li:nth-child(3) { animation-delay: 0.36s; }
.file.fresh .trail li:nth-child(4) { animation-delay: 0.54s; }
.file.fresh .print { animation: arrive 0.6s var(--ease) 0.7s both; }

@keyframes arrive {
  from { opacity: 0; clip-path: inset(0 100% 0 0); }
  to { opacity: 1; clip-path: inset(0 0 0 0); }
}

/* Notices */
.banner { margin: 32px 0 0; padding: 16px 20px; border: 1px solid var(--rule-strong); border-radius: 3px; }
.banner strong { display: block; margin: 12px 0 4px; font-weight: 600; }
.banner strong:first-child { margin-top: 0; }
.banner p { margin: 0 0 4px; color: var(--ink-2); }

/* The money, as line items: what the invoice says, what comes off, what to expect. */
.sum { width: auto; min-width: min(100%, 440px); margin: 0 0 20px; }
.sum th { padding: 12px 32px 12px 0; color: var(--ink-2); font-size: 0.9375rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.sum th small { display: block; color: var(--ink-3); font-size: 0.8125rem; }
.sum td { padding-right: 0; text-align: right; font: 400 0.9375rem var(--data); font-variant-numeric: tabular-nums; }
.sum tr.pay th { color: var(--ink); font-weight: 650; }
.sum tr.pay td { font-size: 1.5rem; }
.sum tbody tr:hover td { background: none; }

pre {
  max-height: 360px;
  max-width: 68ch;
  margin: 0;
  padding: 20px;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--ink-2);
  font: 0.9375rem/1.6 var(--text);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  scrollbar-width: thin;
}

/* Sign in: the logo block as the studio's ident beside the form. */
.entry { display: grid; grid-template-columns: minmax(240px, 2fr) 3fr; min-height: 100vh; }
.entry .brand { width: auto; padding: 48px; }
.entry .logo { width: clamp(190px, 17vw, 300px); }
.entry-form { align-self: center; max-width: 480px; padding: 64px 48px; }
.entry-form h1 { margin: 0 0 12px; font-size: 2rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
.entry-form .quiet { margin-bottom: 32px; }
.entry-form footer { margin-top: 48px; }

/* Tables and lists on the admin page */
table { width: 100%; border-collapse: collapse; margin-top: 24px; }
th { color: var(--ink-3); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; }
th, td { padding: 12px 16px 12px 0; text-align: left; border-bottom: 1px solid var(--rule); }
td.num, th.num { padding-right: 0; text-align: right; }
th.num { font-family: var(--text); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.09em; }
td.num { font-size: 0.875rem; font-weight: 400; }
tbody tr:hover td { background: #ffffff0a; }

details { border-bottom: 1px solid var(--rule); }
details:first-child { border-top: 1px solid var(--rule); }
summary { display: flex; align-items: center; gap: 12px; padding: 14px 0; cursor: pointer; font-weight: 600; list-style: none; }
summary::before { content: ""; flex: none; width: 7px; height: 7px; margin: 0 4px 2px 2px; border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: rotate(-45deg); transition: transform 0.2s var(--ease); }
details[open] > summary::before { transform: rotate(45deg); }
summary::-webkit-details-marker { display: none; }
summary .data { margin-left: auto; color: var(--ink-3); font-weight: 400; }
summary:hover { color: var(--blue-ink); }
details > *:not(summary) { margin-left: 0; }
details[open] { padding-bottom: 16px; }

.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--rule); font-size: 0.9375rem; }
.row > .grow { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.row select { width: auto; max-width: 220px; padding: 8px 10px; font-size: 0.875rem; }
.row button { margin: 0; padding: 8px 14px; font-size: 0.875rem; }
.row .data { color: var(--ink-3); }

.inline { display: flex; flex-wrap: wrap; align-items: end; gap: 24px; }
.inline select { width: auto; }
.inline p { margin: 0 0 12px; }

.page > footer { padding-top: 32px; color: var(--ink-3); font-size: 0.875rem; }
footer a { color: var(--ink-3); }

[hidden] { display: none !important; }

@media (max-width: 820px) {
  .page { padding: 0 20px 64px; }
  .part { grid-template-columns: 1fr; gap: 20px; padding: 32px 0 40px; }
  .part > header { position: static; }
  .rail { grid-template-columns: repeat(2, 1fr); }
  .rail li:nth-child(odd) a { border-left: 0; padding-left: 0; }
  .rail li:nth-child(-n + 2) a { border-bottom: 1px solid var(--rule); }
  .field { padding: 12px 16px; }
  .brand { width: 96px; }
  .logo { width: 56px; }
  .entry { grid-template-columns: 1fr; grid-template-rows: 200px auto; min-height: 0; }
  .entry .logo { width: 104px; }
  .entry-form { padding: 40px 20px 64px; }
  .trail { flex-direction: column; gap: 6px; }
  .trail li + li::before { display: none; }
  .file select { flex: 1 1 140px; max-width: none; }
  .asked li { grid-template-columns: 40px minmax(0, 1fr); }
  .asked .types { grid-column: 2; text-align: left; }
  input, select, textarea { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
