/* thoughtbot client portal. Calm and minimal, with thoughtbot red as the only accent.
 * Tokens, base styles, type and layout helpers. Each component has its own file. */

:root {
  --ink: #201313;
  --ink-soft: #6b5f5a;
  --ink-faint: #746b66;
  --line: #e2dcd8;
  --line-strong: #c1bab7;
  --line-warm: #d8d0cb;
  --paper: #f5f3ef;
  --paper-deep: #ece7e2;
  --paper-aside: #e9e4dc;
  --field: #fdfcfa;
  --red: #e03131;
  --red-ink: #b0251d;
  --red-text: #c42a21;
  --red-wash: #fceaea;
  --green: #2f8f5b;
  --green-ink: #22704a;
  --green-wash: #e2eee5;
  --amber: #d97a1e;
  --amber-ink: #9a4a0e;
  --amber-wash: #f7e7d4;

  --serif: "Newsreader", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1240px;
  --page: calc(var(--max) + var(--gutter) * 2);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

h1, h2, h3, p, ol, ul, fieldset { margin: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
a { color: var(--ink); }
a:hover { color: #000; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Type */
.display { font-family: var(--serif); font-weight: 400; font-size: clamp(42px, 4.6vw, 64px); line-height: 1.08; letter-spacing: -0.015em; }
.display em { font-style: italic; }
.balance { text-wrap: balance; }
.headline { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4vw, 42px); line-height: 1.1; letter-spacing: -0.015em; }
.title { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; letter-spacing: -0.01em; }
.lede { font-size: 17px; line-height: 1.6; color: var(--ink-soft); max-width: 60ch; }
.lede--short { max-width: 44ch; }
.lede--sm { font-size: 16px; }
.section-label { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.section-label--alert { color: var(--red-ink); font-weight: 600; }
.section-label--inline { display: inline; margin-right: 16px; }
.headline--task { font-size: clamp(30px, 5vw, 44px); text-wrap: balance; }
.subhead { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.2; letter-spacing: -0.01em; }
.kicker { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.kicker--alert { color: var(--red-ink); }
.kicker--ruled { padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
/* Floats so a fieldset's legend lays out like any other block. */
.question { display: block; float: left; width: 100%; padding: 0; margin-bottom: 12px; font-size: 15px; font-weight: 500; }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.small-plus { font-size: 14px; }
.muted { color: var(--ink-faint); }
.muted-soft { color: var(--ink-soft); }
.ink { color: var(--ink); }
.strong, .medium { font-weight: 500; }
.plain-em { font-style: normal; }
.alert-text { color: var(--red-ink); font-weight: 500; }
.alert-text-soft { color: var(--red-text); }
.measure { max-width: 60ch; }
.measure-short { max-width: 44ch; }
.plain { text-decoration: none; }
.plain-list { list-style: none; padding: 0; }

/* Layout */
.page { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter) 160px; }
.narrow { max-width: 640px; margin: 0 auto; padding-top: clamp(48px, 8vw, 104px); }
.stack-xxs { display: flex; flex-direction: column; gap: 4px; }
.stack-xs { display: flex; flex-direction: column; gap: 6px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.stack-md { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 28px; }
.stack-xl { display: flex; flex-direction: column; gap: 48px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.rule { padding-top: 16px; border-top: 1px solid var(--ink); }
fieldset.rule { padding-top: 16px; }
.rule--soft { border-top-color: var(--line); }
/* One focused task, like approving a milestone, under the minimal header. */
.task { display: flex; flex-direction: column; gap: 56px; max-width: 672px; margin: 0 auto; padding-top: clamp(40px, 6vw, 72px); }
.task--check-in { max-width: 600px; gap: 40px; padding-top: clamp(40px, 7vw, 96px); }
.task--short, .task--done { gap: 28px; }
.task--sent { gap: 24px; }
.task__form { display: flex; flex-direction: column; gap: inherit; }
.task__intro { display: flex; flex-direction: column; gap: 14px; }
.task__intro--short { gap: 12px; }
.task__intro--centered { align-items: center; text-align: center; }
.headline--check-in { font-size: clamp(36px, 5vw, 52px); line-height: 1.05; letter-spacing: -0.02em; }
.check-in__lede { max-width: 40ch; }
.task__eyebrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.task__section { display: flex; flex-direction: column; gap: 16px; }
.task__section--tight { gap: 14px; }
.task__footer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.task__error { flex-basis: 100%; }
.task__aside { margin-top: -24px; }

/* On phones the main action stays in reach, pinned to the bottom. */
@media (max-width: 560px) {
  .task { gap: 40px; padding-top: 12px; }
  .task--check-in { gap: 32px; padding-top: 20px; }
  .task--short, .task--done { gap: 28px; }
  .task--sent { gap: 24px; padding-top: 24px; }
  .task__intro--centered { align-items: flex-start; text-align: left; }
  .check-in__lede { font-size: 15px; }
  .task--sent .button, .task--done .button { align-self: stretch; }
  .task__footer, .check-in__footer { position: sticky; bottom: 0; z-index: 4; flex-direction: column; align-items: stretch; gap: 4px; margin: 0 calc(var(--gutter) * -1); padding: 14px var(--gutter) 22px; border-top: 1px solid var(--line); background: rgba(245, 243, 239, 0.96); backdrop-filter: blur(12px); }
  .task__footer .button, .check-in__footer .button, .task .check-in__send { align-self: stretch; }
  .check-in__last { display: none; }
  .task__footer .quiet-action { justify-content: center; }
  .task__footer > .small { display: none; }
  .task__aside { margin-top: 0; }
}

.done-mark { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 999px; background: var(--green-wash); color: var(--green-ink); }
.done-mark svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.done-mark--message { background: var(--paper-deep); color: var(--ink); }
.done-mark--message svg { stroke-width: 1.8; }

.rule-head { padding-bottom: 12px; margin-bottom: 20px; border-bottom: 1px solid var(--ink); }

/* Flash */
.flash { margin-top: 8px; padding: 12px 16px; border-radius: 12px; background: var(--paper-deep); font-size: 14px; }

/* Sample data, until the real thing is connected (SampleData) */
.sample-flag { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 0 32px; padding: 12px 16px; border: 1px dashed var(--amber); border-radius: 10px; background: var(--amber-wash); font-size: 14px; line-height: 1.45; color: var(--ink); }
.sample-flag__tag, .sample-tag { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--paper); background: var(--amber-ink); border-radius: 4px; padding: 3px 6px; white-space: nowrap; }
.sample-tag { display: inline-block; align-self: flex-start; margin-left: 8px; padding: 2px 5px; font-size: 9px; vertical-align: 2px; }
