/* Qoffee documentation.
   Fonts load from Google Fonts in each page head. To self host, put the woff2
   files in assets/ and swap the link tag for @font-face here. */

:root {
  --paper: #e9e4f4;
  --card: #ffffff;
  --ink: #140f1e;

  --teal: #00d2a0;
  --purple: #9e0ffe;
  --amber: #ffc21f;
  --coral: #ff5a45;

  --bd: 3px;
  --sh: 6px 6px 0 var(--ink);
  --sh-sm: 4px 4px 0 var(--ink);
  --sh-lg: 9px 9px 0 var(--ink);

  --display: "Bricolage Grotesque", "Arial Black", Impact, sans-serif;
  --sans: "Space Grotesk", "Segoe UI", -apple-system, system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 62ch;
}

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

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(20, 15, 30, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 15, 30, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
}

a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 3px solid var(--teal);
  padding-bottom: 1px;
}

a:hover {
  background: var(--teal);
}

:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 14px;
  top: 14px;
  z-index: 20;
  background: var(--amber);
  border: var(--bd) solid var(--ink);
  padding: 8px 14px;
}

/* ---------- entry page ---------- */

.entry-page {
  min-height: 100vh;
}

.entry-main {
  width: min(1120px, calc(100% - 56px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 0 28px;
}

.entry-header {
  max-width: 880px;
  margin-bottom: 30px;
}

.entry-header .motto {
  background: var(--amber);
  color: var(--ink);
  margin-bottom: 12px;
}

.entry-header h1 {
  margin: 0 0 12px;
  max-width: 14ch;
  font-size: clamp(42px, 6vw, 68px);
  line-height: 0.88;
}

.entry-lede {
  max-width: 56ch;
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.entry-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 1000px;
}

.entry-option {
  display: flex;
  flex-direction: column;
  min-height: 214px;
  padding: 16px 20px 14px;
  border: var(--bd) solid var(--ink);
  box-shadow: var(--sh-lg);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.entry-option:hover {
  transform: translate(-4px, -4px);
  box-shadow: 13px 13px 0 var(--ink);
}

.entry-option-use {
  background: var(--teal);
  transform: rotate(-1.2deg);
}

.entry-option-use:hover {
  background: var(--teal);
}

.entry-option-code {
  background: var(--amber);
  transform: rotate(1.2deg);
}

.entry-option-code:hover {
  background: var(--amber);
}

.entry-option-index {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: auto;
}

.entry-option-label {
  display: block;
  max-width: 10ch;
  margin: 22px 0 10px;
  font-family: var(--display);
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 0.94;
  font-weight: 800;
}

.entry-option-copy {
  display: block;
  max-width: 38ch;
  min-height: 48px;
  font-size: 13px;
  line-height: 1.35;
}

.entry-option-action {
  display: block;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.entry-foot {
  margin: 28px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.entry-foot a {
  border-bottom-width: 2px;
}

/* ---------- shell ---------- */

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  max-width: 1240px;
  margin: 0 auto;
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: scroll;
  scrollbar-width: thin;
  scrollbar-color: var(--ink) var(--paper);
  border-right: var(--bd) solid var(--ink);
  padding: 26px 22px 60px 22px;
}

.rail::-webkit-scrollbar {
  width: 12px;
}

.rail::-webkit-scrollbar-track {
  background: var(--paper);
  border-left: 2px solid var(--ink);
}

.rail::-webkit-scrollbar-thumb {
  background: var(--ink);
  border: 2px solid var(--paper);
}

.rail::-webkit-scrollbar-thumb:hover {
  background: var(--teal);
}

.rail-inner {
  position: static;
}

.rail nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rail nav li {
  margin: 0 0 4px 0;
}

.rail nav a {
  display: block;
  padding: 5px 9px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  border: 2px solid transparent;
  border-bottom-width: 2px;
}

.rail nav a:hover {
  background: var(--teal);
  border-color: var(--ink);
}

.rail nav a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  font-weight: 700;
}

.page-toc {
  position: fixed;
  top: 34px;
  right: max(24px, calc((100vw - 1240px) / 2 + 24px));
  width: 210px;
  max-height: calc(100vh - 68px);
  overflow-y: auto;
  border-left: var(--bd) dashed var(--ink);
  padding-left: 12px;
}

.page-toc-title {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.page-toc li {
  margin: 0 0 2px;
}

.page-toc a {
  display: block;
  padding: 3px 7px;
  border: 2px solid transparent;
  border-bottom-width: 2px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}

.page-toc a:hover {
  background: var(--teal);
  border-color: var(--ink);
}

.page-toc .toc-sub a {
  padding-left: 18px;
  font-size: 11px;
}

.rail-boundary {
  margin: 20px 0 14px 0;
  border-top: var(--bd) dashed var(--ink);
  padding-top: 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.rail-foot {
  margin-top: 28px;
  border-top: var(--bd) solid var(--ink);
  padding-top: 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 2;
}

.rail-foot a {
  border-bottom-width: 2px;
}

/* ---------- content ---------- */

main {
  padding: 34px 46px 130px 46px;
  min-width: 0;
}
body:has(.page-toc) main#content {
  position: relative;
  padding-right: 270px;
}

p,
ul,
ol {
  max-width: var(--measure);
}

h1 {
  font-family: var(--display);
  font-size: clamp(38px, 5.4vw, 58px);
  line-height: 0.94;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 4px 0 26px 0;
  max-width: 15ch;
}

h2 {
  font-family: var(--display);
  font-size: 27px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 56px 0 16px 0;
  max-width: 22ch;
}

h2::after {
  content: "";
  display: block;
  width: 62px;
  height: 7px;
  background: var(--purple);
  border: 2px solid var(--ink);
  margin-top: 10px;
}

  position: absolute;
  top: 34px;
  right: 24px;
  width: 210px;
  max-height: calc(100vh - 68px);
  overflow-y: auto;
  border-left: var(--bd) dashed var(--ink);
  padding-left: 12px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 34px 0 8px 0;
}

p {
  margin: 0 0 16px 0;
}

ul,
ol {
  padding-left: 22px;
  margin: 0 0 18px 0;
}

li {
  margin-bottom: 9px;
}

li::marker {
  font-weight: 700;
}

strong {
  font-weight: 700;
  background: var(--amber);
  box-shadow: 0 0 0 2px var(--amber);
}

.why-matters strong {
  background: var(--teal);
  box-shadow: 0 0 0 2px var(--teal);
}

.limits-intro {
  font-weight: 700;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

.limits-list strong {
  background: none;
  box-shadow: none;
}

.note {
  background: var(--card);
  border: var(--bd) solid var(--ink);
  border-left-width: 12px;
  box-shadow: var(--sh-sm);
  padding: 14px 18px;
  margin: 24px 0;
  font-size: 16px;
  max-width: 660px;
}

/* ---------- code ---------- */

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--card);
  border: 2px solid var(--ink);
  padding: 0 4px;
}

pre {
  position: relative;
  background: var(--ink);
  border: var(--bd) solid var(--ink);
  box-shadow: var(--sh);
  padding: 20px;
  overflow-x: auto;
  margin: 0 0 26px 0;
  max-width: 720px;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: #f0ecfa;
}

.copy {
  position: absolute;
  top: -3px;
  right: -3px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--teal);
  border: var(--bd) solid var(--ink);
  padding: 4px 10px;
  cursor: pointer;
}

.copy:hover {
  background: var(--amber);
}

/* ---------- tables ---------- */

table {
  border-collapse: collapse;
  width: 100%;
  max-width: 720px;
  margin: 0 0 28px 0;
  font-size: 15px;
  background: var(--card);
  border: var(--bd) solid var(--ink);
  box-shadow: var(--sh);
}

th {
  text-align: left;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 14px;
  border-right: 2px solid var(--paper);
}

th:last-child {
  border-right: 0;
}

td {
  padding: 11px 14px;
  border-top: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
  vertical-align: top;
}

td:last-child {
  border-right: 0;
}

td:first-child {
  font-weight: 700;
  white-space: nowrap;
  background: #f4f1fb;
}

td.free {
  white-space: normal;
  font-weight: 400;
  background: none;
}

/* ---------- status vocabulary ---------- */

.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1px 7px;
  border: 2px solid var(--ink);
  background: var(--card);
  white-space: nowrap;
}

.chip-active {
  background: var(--amber);
}

.chip-ok {
  background: var(--teal);
}

.chip-fail {
  background: var(--coral);
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 44px;
  align-items: start;
  margin-bottom: 20px;
}

.motto {
  display: inline-block;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--amber);
  border: var(--bd) solid var(--ink);
  box-shadow: var(--sh-sm);
  padding: 6px 14px;
  margin: 0 0 24px 0;
  transform: rotate(-1.6deg);
}

.hero-lede {
  font-family: var(--display);
  font-size: clamp(30px, 4.1vw, 44px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0 0 22px 0;
  max-width: 17ch;
}

.hero-go {
  display: inline-block;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--teal);
  border: var(--bd) solid var(--ink);
  box-shadow: var(--sh);
  padding: 12px 26px;
  margin-top: 6px;
}

.hero-go:hover {
  background: var(--amber);
  box-shadow: var(--sh-lg);
}

.hero-go:active {
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(4px, 4px);
}

/* ---------- notification block ---------- */

.notif {
  background: var(--card);
  border: var(--bd) solid var(--ink);
  box-shadow: var(--sh-lg);
  transform: rotate(1.2deg);
}

.notif-head {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--purple);
  border-bottom: var(--bd) solid var(--ink);
  padding: 9px 13px;
}

.notif-avatar {
  width: 24px;
  height: 24px;
  background: var(--teal);
  border: 2px solid var(--ink);
  flex: none;
}

.notif-name {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.notif-time {
  font-family: var(--mono);
  font-size: 11px;
  color: #fff;
}

.notif-body {
  padding: 14px 13px 15px 13px;
}

.notif-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.notif-row {
  border: 2px solid var(--ink);
  margin-bottom: 9px;
  font-size: 13px;
}

.notif-row:last-child {
  margin-bottom: 0;
}

.notif-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-bottom: 2px solid var(--ink);
}

.t-active {
  background: var(--amber);
}

.t-ok {
  background: var(--teal);
}

.t-fail {
  background: var(--coral);
}

.notif-item {
  padding: 7px 9px;
  line-height: 1.4;
  font-weight: 500;
}

.notif-item code {
  font-size: 10.5px;
  border-width: 1px;
  padding: 0 3px;
}

.notif-err {
  font-family: var(--mono);
  font-size: 10.5px;
  background: var(--ink);
  color: #f0ecfa;
  padding: 5px 7px;
  margin-top: 6px;
  overflow-x: auto;
}

/* ---------- timeline ---------- */

.tl {
  margin: 26px 0 30px 0;
  max-width: 680px;
  border-left: var(--bd) solid var(--ink);
  padding-left: 26px;
}

.tl-row {
  position: relative;
  padding-bottom: 26px;
}

.tl-row::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 6px;
  width: 14px;
  height: 14px;
  background: var(--paper);
  border: var(--bd) solid var(--ink);
}

.tl-row.speaks::before {
  background: var(--coral);
}

.tl-clock {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  background: var(--ink);
  color: var(--paper);
  padding: 1px 7px;
  margin-bottom: 6px;
}

.tl-what {
  font-size: 16px;
}

.tl-msg {
  margin-top: 10px;
  background: var(--card);
  border: var(--bd) solid var(--ink);
  box-shadow: var(--sh-sm);
  padding: 11px 14px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.75;
  max-width: 420px;
}

.tl-msg b {
  display: block;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 5px;
  margin-bottom: 6px;
}

/* ---------- setup steps ---------- */

.step {
  background: var(--card);
  border: var(--bd) solid var(--ink);
  box-shadow: var(--sh-lg);
  padding: 0 0 26px 0;
  margin: 0 0 34px 0;
  max-width: 740px;
}

.step-count {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--ink);
  color: var(--paper);
  padding: 6px 16px;
}

.step-n {
  font-family: var(--display);
  font-size: 86px;
  line-height: 0.85;
  font-weight: 800;
  letter-spacing: -0.06em;
  background: var(--teal);
  border-bottom: var(--bd) solid var(--ink);
  padding: 16px 20px 12px 20px;
}

.calm .step-n {
  background: var(--purple);
  color: #fff;
}

.step h2,
.step p,
.step table,
.step pre,
.step figure,
.step .reassure,
.step ul {
  margin-left: 26px;
  margin-right: 26px;
}

.step h2 {
  font-size: 25px;
  margin-top: 22px;
  margin-bottom: 14px;
}

.step h2::after {
  display: none;
}

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

.step table,
.step pre {
  max-width: calc(100% - 52px);
  box-shadow: var(--sh-sm);
}

.reassure {
  background: var(--amber);
  border: var(--bd) solid var(--ink);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 15.5px;
  line-height: 1.5;
  font-weight: 500;
}

/* ---------- figures ---------- */

figure {
  margin-bottom: 0;
}

figure img {
  display: block;
  width: 100%;
  border: var(--bd) solid var(--ink);
}

figcaption {
  font-family: var(--mono);
  font-size: 12px;
  margin-top: 8px;
  line-height: 1.5;
}

.shot-todo {
  border: var(--bd) dashed var(--ink);
  background: #f4f1fb;
  padding: 32px 18px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- closer ---------- */

.closer {
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--card);
  border: var(--bd) solid var(--ink);
  box-shadow: var(--sh);
  padding: 20px 24px;
  margin: 52px 0 0 0;
  max-width: 720px;
}

.closer code {
  background: var(--amber);
  border: 0;
  padding: 0 2px;
}

/* ---------- floating links ---------- */

.floating-links {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  display: flex;
  gap: 8px;
}

.floating-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.floating-link:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.floating-link::after {
  content: attr(data-label);
  position: absolute;
  right: 0;
  bottom: calc(100% + 9px);
  width: max-content;
  max-width: 180px;
  padding: 5px 8px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.floating-link:hover::after,
.floating-link:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.floating-link-repo {
  background: var(--teal);
}

.floating-link-repo:hover {
  background: var(--teal);
}

.floating-link-email {
  background: var(--amber);
}

.floating-link-email:hover {
  background: var(--amber);
}

.floating-link-wiki {
  background: var(--purple);
  color: #fff;
}

.floating-link-wiki:hover {
  background: var(--purple);
}

.ecosystem-note {
  position: fixed;
  right: 18px;
  bottom: 70px;
  z-index: 11;
  width: max-content;
  max-width: min(330px, calc(100vw - 36px));
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ecosystem-note a {
  color: var(--ink);
  border-bottom: 2px solid var(--teal);
}

.ecosystem-note a:hover {
  background: var(--teal);
  color: var(--ink);
}

/* ---------- responsive ---------- */

@media (max-width: 940px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: static;
    height: auto;
    overflow-y: visible;
    border-right: 0;
    border-bottom: var(--bd) solid var(--ink);
    padding: 20px 18px 26px 18px;
  }

  .rail-inner {
    position: static;
  }

  main {
    padding: 26px 18px 90px 18px;
  }
  body:has(.page-toc) main#content {
    padding-right: 18px;
  }
  .page-toc {
    position: fixed;
    top: 20px;
    right: 18px;
    width: auto;
    max-width: 190px;
    max-height: calc(100vh - 40px);
    margin: 0;
    border-left: var(--bd) dashed var(--ink);
    border-top: 0;
    padding: 0 0 0 12px;
  }

  .entry-main {
    width: min(100% - 36px, 620px);
    padding: 28px 0 24px;
  }

  .entry-header {
    margin-bottom: 24px;
  }

  .entry-header .motto {
    font-size: 11px;
    padding: 5px 9px;
    margin-bottom: 14px;
  }

  .entry-header h1 {
    font-size: clamp(38px, 11vw, 58px);
  }

  .entry-lede {
    font-size: 17px;
  }

  .entry-options {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .entry-option {
    min-height: 156px;
    padding: 12px 14px 10px;
  }

  .entry-option-label {
    max-width: 13ch;
    margin: 12px 0 6px;
    font-size: clamp(27px, 8vw, 38px);
  }

  .entry-option-copy {
    min-height: auto;
    font-size: 13px;
    line-height: 1.25;
  }

  .entry-option-action {
    margin-top: 10px;
    padding-top: 8px;
    font-size: 10px;
  }

  .entry-foot {
    margin-top: 42px;
    line-height: 1.7;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }

  .notif {
    transform: none;
    max-width: 380px;
  }

  .step-n {
    font-size: 64px;
  }

  .step h2,
  .step p,
  .step table,
  .step pre,
  .step figure,
  .step .reassure,
  .step ul {
    margin-left: 18px;
    margin-right: 18px;
  }

  .step table,
  .step pre {
    max-width: calc(100% - 36px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

@media (max-width: 600px) {
  .ecosystem-note {
    right: 12px;
    bottom: 54px;
    max-width: calc(100vw - 24px);
  }

  .floating-links {
    right: 12px;
    bottom: 12px;
    gap: 6px;
  }

  .floating-link {
    width: 34px;
    height: 34px;
    box-shadow: 3px 3px 0 var(--ink);
  }
}
