/* The Client Portal, in the Butter Side Up Studios palette. Light only, like the rest of the site. */
:root {
  --paper: #FAF8F4;
  --ink: #1A1714;
  --ink-2: #5F574E;
  --ink-3: #7A7168; /* darker than the main site's, so small text keeps its contrast */
  --rule: #E3DDD3;
  --crust: #B5712E;
  --butter: #FFD84D;
  --ok: #2E7D4F;
  --ok-bg: #E6F2EA;
  --warn: #8A5A00;
  --warn-bg: #FFF1BF;
  --bad: #AD2A24;
  --bad-bg: #F9E4E2;
  --go: #2F5FB3;
  --go-bg: #E4ECFA;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--butter); color: var(--ink); }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--crust); outline-offset: 3px; }
[hidden] { display: none !important; }
button, select, input, textarea { font: inherit; color: inherit; }
main { flex: 1; width: 100%; padding-bottom: clamp(48px, 7vw, 96px); }

.wrap { max-width: 1100px; margin-inline: auto; padding-inline: var(--gutter); }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.06em; letter-spacing: -.01em; }
.label { font-size: .78rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.fine { font-size: .88rem; color: var(--ink-3); }
.small { font-size: .8rem; }
.hint { font-weight: 400; }
.link {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .25em;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  transition: text-decoration-color .2s;
}
.link:hover { text-decoration-color: currentColor; }
.link-button { padding: 0; border: 0; background: none; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: .25em; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 8px 14px; border-radius: 6px; background: var(--ink); color: var(--paper);
}
.skip:focus { top: 12px; }
.empty { color: var(--ink-3); padding: 12px 0; }
.status { color: var(--warn); font-size: .92rem; min-height: 1.3em; }
.status:empty { display: none; }

/* Buttons and pills */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  padding: .9em 1.35em; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font: 500 .98rem/1 var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .2s;
}
.btn:hover { background: #000; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-small { padding: .7em 1.1em; font-size: .88rem; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); transition: background-color .2s, color .2s; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-danger { color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.btn-danger:hover { background: var(--bad); color: #fff; }
.pill { display: inline-block; padding: .2em .7em; border-radius: 999px; background: #fff; border: 1px solid var(--rule); color: var(--ink-2); font-size: .8rem; font-weight: 500; white-space: nowrap; }
.pill-ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.pill-warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.pill-bad { background: var(--bad-bg); border-color: transparent; color: var(--bad); }
.pill-go { background: var(--go-bg); border-color: transparent; color: var(--go); }

/* Header and footer, as on the site */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgb(250 248 244 / .86);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { flex: none; display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.brand-portal { font-weight: 400; color: var(--ink-3); }
.brand-portal::before { content: "·"; margin-right: 10px; }
/* On a phone the name steps out of the way of the links and the Sign out button: the mark stays. */
@media (max-width: 560px) {
  .nav-inner { gap: 16px; }
  .nav-links { gap: 16px; }
  .brand-tail, .brand-portal { display: none; }
}
@media (max-width: 480px) {
  .brand-name { display: none; }
}
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: var(--ink-2); font-size: .94rem; text-decoration: none; transition: color .15s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.standing { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.standing .email { font-size: .88rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  .standing .email { display: none; }
}
.footer { padding: 32px 0 44px; border-top: 1px solid var(--rule); color: var(--ink-3); font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 32px; }
.footer ul { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* Pages */
.page-hero { padding: clamp(40px, 7vw, 80px) 0 clamp(24px, 4vw, 40px); }
.page-title { font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 500; line-height: 1.05; letter-spacing: -.035em; text-wrap: balance; overflow-wrap: anywhere; }
.page-lede { max-width: 38em; margin-top: 20px; color: var(--ink-2); font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.5; }
.page-lede:empty { display: none; }
.back { display: inline-block; margin-bottom: clamp(20px, 3vw, 36px); color: var(--ink-2); font-size: .92rem; text-decoration: none; }
.back:hover { color: var(--ink); }
.door { max-width: 34em; padding: clamp(40px, 8vw, 96px) 0; display: grid; gap: 24px; }
.door .page-lede { margin-top: 0; }

/* Forms, as on the site's start page */
.form { display: grid; gap: 24px; }
.field { display: grid; gap: 6px; color: var(--ink-3); font-size: .85rem; font-weight: 500; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0;
  background: transparent; color: var(--ink); font: 400 1.05rem/1.4 var(--sans);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-bottom-color: var(--ink); box-shadow: 0 1px 0 var(--ink); }
.field input[type="file"] { font-size: .95rem; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px 32px; }
.staff-form { margin-top: 20px; padding: 20px; border: 1px dashed var(--rule); border-radius: 10px; background: #fff; }

/* Blocks on a project page */
.block { padding: clamp(28px, 4vw, 44px) 0; border-top: 1px solid var(--rule); }
.block-head { margin-bottom: 16px; }
.status-now { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.status-note { max-width: 40em; margin-top: 12px; color: var(--ink-2); white-space: pre-line; }
.status-note:empty { display: none; }
.list { display: grid; }
.list > li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.list > li:last-child { border-bottom: 0; }
.list .empty { padding: 4px 0; }
.row-actions { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.row-main { display: grid; gap: 2px; min-width: 0; flex: 1 1 220px; }
.row-name { font-weight: 500; overflow-wrap: anywhere; }
.invoice-amount { font-variant-numeric: tabular-nums; font-weight: 500; }

/* Milestones */
.milestone .tick { width: 22px; height: 22px; flex: none; display: inline-grid; place-items: center; border: 1.5px solid var(--ink-3); border-radius: 50%; font-size: .8rem; }
.milestone.done .tick { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.milestone.done .milestone-title { color: var(--ink-3); text-decoration: line-through; }
.milestone-title { flex: 1 1 200px; }

/* Project cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card { display: grid; gap: 8px; padding: 22px; border: 1px solid var(--rule); border-radius: 12px; background: #fff; text-decoration: none; transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--ink-3); transform: translateY(-2px); }
.card-top { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 8px 12px; }
.card h3, .card-top h4 { font-size: 1.15rem; font-weight: 500; letter-spacing: -.015em; overflow-wrap: anywhere; }
.card-waiting { color: var(--crust); font-size: .9rem; font-weight: 500; }

/* Approvals */
.list > li.approval { display: grid; gap: 8px; }
.approval .decide { margin-top: 8px; padding: 16px; border-radius: 10px; background: #fff; border: 1px solid var(--rule); }

/* Messages */
.thread { display: grid; gap: 12px; margin-bottom: 24px; }
.message { max-width: 84%; padding: 10px 14px; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgb(26 23 20 / .06); justify-self: start; border-bottom-left-radius: 4px; }
.message.mine { justify-self: end; background: var(--warn-bg); border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 600px) {
  .message { max-width: 100%; }
  .row-actions { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .btn .arrow, .card, .link, .nav-links a, .field input, .field textarea, .field select { transition: none; }
  .card:hover { transform: none; }
}
