/* The public site and the account pages of Kestrel.
   Loaded after board.css, whose fonts and colors it uses. Same family as widal.com: Archivo (wide
   for headings, normal for text), JetBrains Mono only for commands and terminal output, a cool
   off-white page and Widal's teal. Kestrel's own colors come from its bird: the sky of the logo,
   the chestnut of the wings, the slate of the head, and the yellow that is also the status line's
   color for "soon".
   No inline styles anywhere: every page uses these classes. */

/* The fonts and the shared colors (--k-paper, --k-ink, --k-accent, --k-sky, --k-chestnut and the
   rest, light and dark) are in board.css, which every page loads first. Only the terminal's colors
   are the site's own. */
:root {
  --k-term-bg: #0e2f38;
  --k-term-ink: #e3eef0;
  --k-term-dim: #8fa9b0;
  --k-term-ok: #6bcb8b;
  --k-term-warn: #f5c542;
  --k-term-branch: #7fc8d6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --k-term-bg: #08161c;
  }
}

/* ---------- Base ---------- */

body.site {
  margin: 0;
  background: var(--k-paper);
  color: var(--k-ink);
  font-family: var(--k-font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.site main {
  max-width: none;
  margin: 0;
  padding: 0;
}

.site .wrap {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 16px;
}

.site main.wrap-narrow {
  max-width: calc(44rem + 32px);
  padding-block: 48px 0;
}

.site h1,
.site h2,
.site h3 {
  font-family: var(--k-font);
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
}

.site h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
  margin-bottom: 16px;
}

.site h2 {
  font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  margin: 48px 0 12px;
}

.site h3 {
  font-size: 1.125rem;
  margin: 0 0 8px;
}

.site p,
.site li,
.site dd {
  text-wrap: pretty;
}

.site p {
  margin: 0 0 16px;
}

.site ul,
.site ol {
  margin: 0 0 16px;
  padding-left: 1.25em;
}

.site li + li {
  margin-top: 8px;
}

.site a {
  color: var(--k-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.site a:hover {
  text-decoration-thickness: 2px;
}

.site :focus-visible {
  outline: 3px solid var(--k-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.site code {
  font-family: var(--k-mono);
  font-size: 0.88em;
  background: var(--k-code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

.site ::selection {
  background: var(--k-ink);
  color: var(--k-paper);
}

.lede {
  font-size: 1.1875rem;
  color: var(--k-text-2);
  max-width: 40rem;
}

.fine {
  font-size: 0.9375rem;
  color: var(--k-text-2);
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  background: var(--k-ink);
  color: var(--k-paper);
  padding: 8px 12px;
  border-radius: var(--k-radius);
  z-index: 10;
}

.site .skip {
  color: var(--k-paper);
}

.skip:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Buttons ---------- */

.site .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--k-radius);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.site .btn-lg {
  min-height: 48px;
  padding: 12px 22px;
  font-size: 1rem;
}

.site .btn-primary {
  background: var(--k-accent);
  color: var(--k-on-accent);
}

.site .btn-primary:hover {
  background: var(--k-accent-deep);
}

.site .btn-quiet {
  background: transparent;
  color: var(--k-ink);
  border-color: var(--k-line-strong);
}

.site .btn-quiet:hover {
  border-color: var(--k-ink);
}

.site .btn-danger {
  background: var(--k-danger);
  color: var(--k-on-danger);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
}

/* ---------- Header ---------- */

.masthead {
  border-bottom: 1px solid var(--k-line);
}

.masthead-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding-block: 12px;
}

.site .logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--k-ink);
  text-decoration: none;
  font-weight: 700;
  font-stretch: 125%;
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
}

.logo img {
  display: block;
  border-radius: 8px;
}

.site-nav {
  order: 3;
  flex-basis: 100%;
  display: flex;
  gap: 20px;
}

.site .site-nav a,
.site .signin-link {
  color: var(--k-ink);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  padding-block: 6px;
  border-bottom: 2px solid transparent;
}

.site .site-nav a:hover,
.site .signin-link:hover {
  border-bottom-color: var(--k-line-strong);
}

.site .site-nav a[aria-current='page'],
.site .signin-link[aria-current='page'] {
  border-bottom-color: var(--k-accent);
}

.masthead-right {
  order: 2;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.site .who {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--k-ink);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  max-width: 12rem;
}

.who-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
}

.avatar-letter {
  display: inline-grid;
  place-items: center;
  background: var(--k-sky);
  color: var(--k-ink);
  font-weight: 600;
  font-size: 0.875rem;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 1.5rem;
}

@media (min-width: 860px) {
  .site-nav {
    order: 0;
    flex-basis: auto;
    margin-left: 16px;
  }
}

@media (max-width: 420px) {
  .who-name {
    display: none;
  }
}

/* ---------- Home ---------- */

.hero {
  padding-block: 64px 24px;
}

.site .hero h1 {
  font-size: clamp(2.375rem, 1.3rem + 4.2vw, 4rem);
  font-stretch: 115%;
  line-height: 1.04;
  max-width: 17ch;
  margin-bottom: 24px;
}

.site .status-note {
  margin-top: 16px;
  font-size: 0.9375rem;
  color: var(--k-text-2);
}

/* The status line: the one loud thing on the page. */
.term {
  margin: 48px 0 0;
}

.term-screen {
  background: var(--k-term-bg);
  color: var(--k-term-ink);
  border-radius: 12px;
  padding: 22px 24px;
  border: 1px solid var(--k-line);
}

/* Each line of the status line wraps when the screen is narrow. A wrapped part is indented, so the
   four lines stay four lines. */
.term-lines {
  font-family: var(--k-mono);
  font-size: 0.875rem;
  line-height: 1.75;
}

.t-line {
  display: block;
  white-space: pre-wrap;
  padding-left: 2ch;
  text-indent: -2ch;
}

@media (max-width: 600px) {
  .term-screen {
    padding: 16px;
  }

  .term-lines {
    font-size: 0.8125rem;
    line-height: 1.6;
  }

  .t-line + .t-line {
    margin-top: 6px;
  }
}

.t-strong {
  font-weight: 500;
  color: #ffffff;
}

.t-sep,
.t-dim {
  color: var(--k-term-dim);
}

.t-branch {
  color: var(--k-term-branch);
}

.t-ok {
  color: var(--k-term-ok);
}

.t-warn {
  color: var(--k-term-warn);
}

.t-hint {
  color: var(--k-term-dim);
}

.term figcaption {
  margin-top: 12px;
  font-size: 0.9375rem;
  color: var(--k-text-2);
}

/* A section of the home page: the heading on the left, the text on the right. */
.band {
  padding-block: 56px;
}

.site .band > h2 {
  margin: 0 0 16px;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
}

.band-body {
  max-width: 44rem;
}

@media (min-width: 900px) {
  .band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    column-gap: 48px;
    padding-block: 80px;
  }

  .band > * {
    grid-column: 2;
  }

  .site .band > h2 {
    grid-column: 1;
    grid-row: 1 / span 4;
    align-self: start;
    max-width: 14ch;
  }
}

.pairs {
  margin: 0 0 16px;
}

.pairs dt {
  font-weight: 600;
  margin-top: 20px;
}

.pairs dt:first-child {
  margin-top: 0;
}

.pairs dd {
  margin: 4px 0 0;
  color: var(--k-text-2);
}

.pairs-cmd dt code {
  font-size: 0.875rem;
}

/* The share of carrying context, from the one measured computer. */
.split {
  display: flex;
  height: 28px;
  border-radius: 4px;
  overflow: hidden;
  margin: 24px 0 12px;
}

.split-a {
  width: 73%;
  background: var(--k-chestnut);
}

.split-b {
  flex: 1;
  background: var(--k-slate);
}

.site .split-key {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  font-size: 0.9375rem;
}

.split-key li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.split-key li + li {
  margin-top: 4px;
}

.key {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex: none;
}

.key-a {
  background: var(--k-chestnut);
}

.key-b {
  background: var(--k-slate);
}

.site .facts {
  list-style: none;
  padding: 0;
}

.facts li + li {
  margin-top: 12px;
}

.facts strong,
.band-body > p strong {
  font-stretch: 112%;
}

.two {
  display: grid;
  gap: 8px 40px;
  margin: 24px 0 8px;
}

@media (min-width: 640px) {
  .two {
    grid-template-columns: 1fr 1fr;
  }
}

/* A real sequence of steps. */
.site .steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  min-height: 30px;
}

.steps > li + li {
  margin-top: 16px;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--k-sky);
  color: var(--k-ink);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1;
}

.note {
  background: var(--k-sky-tint);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 24px 0;
}

.note p:last-child {
  margin-bottom: 0;
}

/* ---------- Text pages ---------- */

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 14px 18px;
  margin: 8px 0 8px;
  background: var(--k-paper-2);
  border-radius: 8px;
  font-size: 0.9375rem;
}

.site .cmd {
  background: var(--k-term-bg);
  color: var(--k-term-ink);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 0 0 16px;
  overflow-x: auto;
}

.site .cmd code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.7;
  white-space: pre;
  overflow-wrap: normal;
  color: inherit;
}

@media (max-width: 600px) {
  .site .cmd code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

.plans {
  margin: 32px 0 8px;
  border-top: 1px solid var(--k-line);
}

.plan {
  display: grid;
  gap: 4px 32px;
  padding-block: 24px;
  border-bottom: 1px solid var(--k-line);
}

.site .plan h2 {
  margin: 0;
  font-size: 1.25rem;
}

.plan p {
  margin: 0;
  color: var(--k-text-2);
}

.site .plan .price {
  color: var(--k-ink);
  font-weight: 600;
}

@media (min-width: 720px) {
  .plan {
    grid-template-columns: 12rem 13rem 1fr;
    align-items: baseline;
  }
}

/* ---------- Sign-in pages ---------- */

.panel {
  max-width: calc(32rem + 32px);
  margin: 0 auto;
  padding: 64px 16px 0;
}

.panel-wide {
  max-width: calc(42rem + 32px);
}

.site .panel h2 {
  margin-top: 32px;
}

.panel > .btn {
  margin: 8px 0 16px;
}

.form {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.site .form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9375rem;
}

.site .form input,
.site .form select {
  font: inherit;
  font-weight: 400;
  color: var(--k-ink);
  background: var(--k-field);
  border: 1px solid var(--k-line-strong);
  border-radius: var(--k-radius);
  padding: 9px 12px;
  width: min(22rem, 100%);
}

.site .form input[aria-invalid='true'] {
  border-color: var(--k-danger);
}

.test-form {
  margin: 24px 0;
  padding: 16px 18px;
  border: 1px dashed var(--k-line-strong);
  border-radius: 8px;
}

.test-form .note {
  margin: 0;
  padding: 0;
  background: none;
  font-size: 0.9375rem;
  color: var(--k-text-2);
}

/* ---------- Account ---------- */

.acct {
  padding-block: 8px 24px;
  border-top: 1px solid var(--k-line);
}

.site .acct h2 {
  margin-top: 24px;
}

.site .acct-danger h2 {
  color: var(--k-danger);
}

.profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site .profile-login {
  font-weight: 600;
  font-stretch: 112%;
  font-size: 1.25rem;
  margin: 0 0 4px;
}

.profile .fine {
  margin: 0;
}

.site .teams,
.site .machines {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.teams li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--k-line);
}

.site .teams li + li,
.site .machines li + li {
  margin-top: 0;
}

.team {
  font-weight: 600;
}

.role {
  font-size: 0.875rem;
  color: var(--k-text-2);
}

.machine {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--k-line);
}

.machine p {
  margin: 0;
}

.machine-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.machine-facts,
.machine-state {
  font-size: 0.9375rem;
  color: var(--k-text-2);
}

.machine-removed .machine-name {
  color: var(--k-text-2);
}

.site .error {
  color: var(--k-danger);
  font-weight: 600;
  margin: 0;
}

/* ---------- Footer ---------- */

.foot {
  margin-top: 96px;
  background: var(--k-paper-2);
  font-size: 0.9375rem;
  color: var(--k-text-2);
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 32px;
  padding-block: 28px 40px;
}

.site .foot-maker {
  margin: 0;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.site .foot a {
  color: var(--k-text-2);
}

.site .foot a:hover {
  color: var(--k-ink);
}

@media (prefers-reduced-motion: reduce) {
  .site * {
    scroll-behavior: auto;
    transition: none;
    animation: none;
  }
}
