/* aidtext.com: colours, type, the page shell and the parts every page shares (aidtext/DESIGN.md).
   The look is a page gone over with big highlighters: warm paper, white cards, and ribbons of
   ink that show a third colour where two cross. What a tool finds has colour; text is quiet. */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/instrument-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/newsreader-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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 {
  --canvas: #fbfaf6;
  --paper: #ffffff;
  --paper-2: #f5f3ec;
  --paper-3: #ebe9df;
  --ink: #12241c;
  --ink-2: #44554c;
  --ink-3: #5c6b63;
  --line: rgb(18 36 28 / 0.1);
  --line-2: rgb(18 36 28 / 0.2);
  --green: #0b6e4f;
  --green-soft: #e2f1ea;
  --lime: #dff25f;
  --lime-deep: #d0e83c;
  --lime-soft: #f1f8cf;
  --red: #b42318;
  --red-soft: #fdeceb;
  --amber: #8a5a00;
  --amber-soft: #fcf3d9;

  /* parts of speech, wherever words are tagged */
  --pos-noun: #0b6e4f;
  --pos-verb: #c2570c;
  --pos-modifier: #2563a8;
  --pos-function: #5c6b63;

  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 20px;

  /* a squircle looks squarer than a circle of the same radius, so where it is drawn the radii grow */
  --sq: 1;
  --q: calc(12px * var(--sq));
  --q-l: calc(20px * var(--sq));
  --q-xl: calc(26px * var(--sq));
  --q-stage: calc(32px * var(--sq));

  --shadow-1: 0 1px 2px rgb(18 36 28 / 0.04), 0 4px 12px rgb(18 36 28 / 0.04);
  --shadow-2: 0 2px 4px rgb(18 36 28 / 0.04), 0 8px 20px rgb(18 36 28 / 0.05), 0 20px 40px rgb(18 36 28 / 0.06);
  --shadow-3: 0 4px 6px rgb(18 36 28 / 0.04), 0 12px 24px rgb(18 36 28 / 0.06), 0 40px 64px rgb(18 36 28 / 0.1);
  --halo: 0 0 0 8px rgb(255 255 255 / 0.36);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.46, 0.6, 1);

  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  /* the voice of the visitor's own text: passages, quotes, words listed from it */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --page: 1200px;
  --gutter: 24px;
  --inset: 24px;
  --header: 72px;
}

@supports (corner-shape: squircle) {
  :root {
    --sq: 1.75;
  }
}

/* The six pens (content.js gives each group of tools its own): wash for large areas, pen for
   ribbons and marks, deep for small words and icons on them. */
:root,
[data-pen="lime"] {
  --wash: #eef7c4;
  --pen: #dff25f;
  --deep: #4a5a0a;
}

[data-pen="aqua"] {
  --wash: #d6f3ec;
  --pen: #8fe3d0;
  --deep: #0b5c4c;
}

[data-pen="sky"] {
  --wash: #dbeafd;
  --pen: #9cc9f7;
  --deep: #154f8a;
}

[data-pen="lilac"] {
  --wash: #e9e2fb;
  --pen: #c4b0f5;
  --deep: #4b3596;
}

[data-pen="peach"] {
  --wash: #fde6d3;
  --pen: #fbc08c;
  --deep: #7d4310;
}

[data-pen="rose"] {
  --wash: #fbe0e8;
  --pen: #f5a9bf;
  --deep: #8a2746;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header) + 16px);
  scrollbar-color: var(--line-2) transparent;
  overflow-x: clip;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--canvas);
  color: var(--ink);
  font: 400 16px/26px var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--green);
}

::selection {
  background: var(--lime);
  color: var(--ink);
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-weight: 500;
  line-height: 1.2;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: var(--radius-s);
}

.icon {
  flex: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── layout ─────────────────────────────────────────────────────────── */

#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
}

/* until the first page is in place there is no footer, so nothing moves when the page comes */
.main:empty + .footer {
  display: none;
}

.wrap {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.page {
  padding-block: 48px 104px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack-s {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.muted {
  color: var(--ink-3);
}

.small {
  font-size: 14px;
  line-height: 22px;
}

.serif {
  font-family: var(--serif);
}

.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* The highlighter: a swipe of lime behind a word. */
.mark {
  margin-inline: -0.1em;
  padding-inline: 0.1em;
  border-radius: 0.16em 0.4em 0.22em 0.34em;
  background: var(--lime);
  color: var(--ink);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ── type ───────────────────────────────────────────────────────────── */

.display,
.title,
.heading,
.subheading,
.report-title {
  word-spacing: 0.08em;
}

.display {
  font-size: clamp(42px, 5.6vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.032em;
}

.title {
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.026em;
}

.heading {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.14;
  letter-spacing: -0.022em;
}

.subheading {
  font-size: 22px;
  line-height: 30px;
  letter-spacing: -0.01em;
}

.lead {
  font-size: 18px;
  line-height: 28px;
  color: var(--ink-2);
  max-width: 38rem;
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--green);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 140ms var(--ease);
}

.link:hover {
  color: var(--ink);
}

.link:disabled {
  color: var(--ink-3);
  cursor: not-allowed;
}

/* ── buttons: solid ink for the one thing to do, white for the others ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--q);
  corner-shape: squircle;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition:
    background-color 160ms var(--ease),
    box-shadow 160ms var(--ease),
    color 160ms var(--ease),
    transform 160ms var(--ease);
}

.btn:hover:not(:disabled) {
  background: var(--paper-2);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:focus-visible {
  border-radius: var(--q);
}

.btn:disabled {
  background: var(--paper-3);
  box-shadow: none;
  color: var(--ink-3);
  cursor: not-allowed;
}

/* a button that is on: one of a few that can be pressed */
.btn[aria-pressed="true"] {
  background: var(--ink);
  box-shadow: none;
  color: var(--paper);
}

.btn-primary {
  background: var(--ink);
  box-shadow: none;
  color: var(--paper);
}

.btn-primary:hover:not(:disabled) {
  background: #24402f;
}

.btn-lime {
  background: var(--lime);
  box-shadow: none;
  color: var(--ink);
}

.btn-lime:hover:not(:disabled) {
  background: var(--lime-deep);
}

.btn-danger {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 45%, transparent);
  color: var(--red);
}

.btn-danger:hover:not(:disabled) {
  background: var(--red-soft);
}

/* on a stage: white film over the ribbons */
.btn-film {
  background: rgb(255 255 255 / 0.66);
  box-shadow: none;
}

.btn-film:hover:not(:disabled) {
  background: var(--paper);
}

.btn-s {
  min-height: 36px;
  padding: 0 14px;
  border-radius: calc(10px * var(--sq));
  font-size: 14px;
}

.btn-l {
  min-height: 52px;
  padding: 0 24px;
  border-radius: calc(14px * var(--sq));
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

/* what starting the task would cost, after the label of the button that starts it (js/price.js);
   the spinner of a busy button takes its place */
.btn[data-cost]::after {
  content: "\00a0·\00a0" attr(data-cost);
  font-weight: 400;
}

.btn.is-busy {
  position: relative;
  color: transparent;
}

.btn.is-busy::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--ink);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.btn-primary.is-busy::after {
  border-color: var(--paper);
  border-right-color: transparent;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: calc(10px * var(--sq));
  corner-shape: squircle;
  background: none;
  color: var(--ink-2);
  transition:
    background-color 140ms var(--ease),
    color 140ms var(--ease);
}

.icon-btn:hover {
  background: rgb(18 36 28 / 0.07);
  color: var(--ink);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── form controls ──────────────────────────────────────────────────── */

.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--q);
  corner-shape: squircle;
  background: var(--paper);
  color: var(--ink);
  line-height: 22px;
  transition:
    border-color 140ms var(--ease),
    box-shadow 140ms var(--ease);
}

.input::placeholder {
  color: var(--ink-3);
}

.input:hover {
  border-color: var(--ink-3);
}

.input:focus-visible {
  outline: none;
  border-color: var(--green);
  border-radius: var(--q);
  box-shadow: 0 0 0 3px var(--green-soft);
}

textarea.input {
  min-height: 88px;
  resize: vertical;
}

select.input {
  width: auto;
  max-width: 100%;
  padding-right: 38px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%2344554c'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* a button beside an input is as high as it */
.field .row > .btn {
  min-height: 44px;
  border-radius: var(--q);
}

.field-label {
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
}

.field-value {
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.hint {
  font-size: 14px;
  line-height: 22px;
  color: var(--ink-3);
  max-width: 68ch;
}

/* switch */
.switch {
  appearance: none;
  flex: none;
  position: relative;
  width: 44px;
  height: 26px;
  margin: 0;
  border-radius: 13px;
  background: var(--line-2);
  cursor: pointer;
  transition: background-color 180ms var(--ease);
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 1px 3px rgb(18 36 28 / 0.24);
  transition:
    transform 220ms var(--spring),
    background-color 180ms var(--ease);
}

.switch:checked {
  background: var(--ink);
}

.switch:checked::after {
  background: var(--lime);
  transform: translateX(18px);
}

.switch:focus-visible {
  border-radius: 13px;
}

/* checkbox */
.check {
  appearance: none;
  flex: none;
  display: inline-grid;
  place-content: center;
  width: 20px;
  height: 20px;
  margin: 0;
  border-radius: 6px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--ink-3);
  cursor: pointer;
  transition:
    background-color 140ms var(--ease),
    box-shadow 140ms var(--ease);
}

.check::after {
  content: "";
  width: 11px;
  height: 11px;
  clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 10%, 37% 70%);
  background: var(--lime);
  transform: scale(0);
  transition: transform 180ms var(--spring);
}

.check:checked {
  background: var(--ink);
  box-shadow: none;
}

.check:checked::after {
  transform: scale(1);
}

.check:focus-visible {
  border-radius: 6px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.option > .switch {
  margin-top: -2px;
}

.option > .check {
  margin-top: 2px;
}

.option label {
  cursor: pointer;
}

/* a choice of a few: radio buttons drawn as one segmented row */
.segments {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: calc(14px * var(--sq));
  corner-shape: squircle;
  background: var(--paper-2);
}

.segment {
  position: relative;
}

.segment input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segment span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: calc(11px * var(--sq));
  corner-shape: squircle;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  transition:
    background-color 160ms var(--ease),
    box-shadow 160ms var(--ease),
    color 160ms var(--ease);
}

.segment input:hover + span {
  color: var(--ink);
}

.segment input:checked + span {
  background: var(--paper);
  box-shadow: var(--shadow-1);
  color: var(--ink);
}

.segment input:focus-visible + span {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* range */
.range {
  flex: 1;
  min-width: 120px;
  max-width: 360px;
  height: 24px;
  margin: 0;
  background: none;
  appearance: none;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: var(--paper-3);
}

.range::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--paper-3);
}

.range::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border: 4px solid var(--paper);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 1px 4px rgb(18 36 28 / 0.28);
}

.range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 4px solid var(--paper);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 1px 4px rgb(18 36 28 / 0.28);
}

.range:focus-visible {
  border-radius: 12px;
}

.number {
  width: 112px;
  font-variant-numeric: tabular-nums;
}

/* ── small parts ────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 14px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.badge-finished {
  background: var(--green-soft);
  color: var(--green);
}

.badge-failed {
  background: var(--red-soft);
  color: var(--red);
}

.badge-pending {
  animation: blink 1.6s ease-in-out infinite;
}

/* a running task: a stroke of lime goes over its badge again and again */
.badge-running {
  background: linear-gradient(100deg, var(--lime-soft) 0 35%, var(--lime) 50%, var(--lime-soft) 65% 100%) 0 0 / 300% 100%;
  color: #4a5a0a;
  animation: badge-run 2.4s linear infinite;
}

@keyframes badge-run {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

@keyframes blink {
  50% {
    opacity: 0.4;
  }
}

.notice {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 24px;
}

.notice .icon {
  margin-top: 3px;
}

.notice-warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.notice-error {
  background: var(--red-soft);
  color: var(--red);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--line-2);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

/* A task that is not done (js/working.js): a page of lines. Waiting its turn, a lime cursor
   blinks at the first line; running, the highlighter marks the lines one after another. */
.working {
  flex: none;
  width: 160px;
  height: auto;
  overflow: visible;
}

.working .w-paper {
  fill: var(--paper);
  filter: drop-shadow(0 8px 18px rgb(18 36 28 / 0.1));
}

.working .w-line {
  fill: var(--ink);
  opacity: 0.5;
}

.working .w-mark {
  transform: scaleX(0);
  transform-box: fill-box;
  transform-origin: left center;
}

.working .w-mark.is-lime {
  fill: var(--lime);
}

.working .w-mark.is-sky {
  fill: #9cc9f7;
}

.working .w-mark.is-lilac {
  fill: #c4b0f5;
}

.working .w-cursor {
  fill: var(--lime-deep);
}

.working.is-pending .w-cursor {
  animation: blink 1.2s ease-in-out infinite;
}

.working.is-running .w-cursor {
  display: none;
}

.working.is-running .w-mark {
  animation: mark-line 4.2s var(--ease) infinite;
  animation-delay: calc(var(--i) * 0.45s);
}

@keyframes mark-line {
  0% {
    transform: scaleX(0);
    opacity: 1;
  }
  14%,
  76% {
    transform: scaleX(1);
    opacity: 1;
  }
  92%,
  100% {
    transform: scaleX(1);
    opacity: 0;
  }
}

.empty {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 88px 24px;
  border-radius: var(--q-xl);
  corner-shape: squircle;
  background: #f4f8e0;
  color: var(--ink-2);
  text-align: center;
}

.empty p {
  max-width: 44ch;
}

.empty .title {
  color: var(--ink);
}

/* a tool's picture: one thing in overlapping inks */
.tool-icon {
  flex: none;
  object-fit: contain;
}

/* ── cards ──────────────────────────────────────────────────────────── */

.card {
  min-width: 0;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: var(--paper);
  box-shadow: var(--shadow-1);
  color: var(--ink);
}

/* a card lying on a stage */
.float {
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: var(--paper);
  box-shadow: var(--halo), var(--shadow-3);
  color: var(--ink);
}

/* a tool as a card: its picture and its name (js/cards.js) */
.tcard {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  min-height: 172px;
  padding: 22px 22px 20px;
  overflow: hidden;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: var(--paper);
  box-shadow: var(--shadow-1);
  transition:
    transform 260ms var(--ease),
    box-shadow 260ms var(--ease),
    background-color 200ms var(--ease);
}

.tcard:hover,
.tcard:focus-visible {
  background: var(--wash);
  box-shadow: var(--shadow-2);
  transform: translateY(-4px);
}

.tcard:focus-visible {
  border-radius: var(--q-l);
}

.tcard .tool-icon,
.mini .tool-icon {
  transition: transform 300ms var(--ease);
}

.tcard:hover .tool-icon {
  transform: scale(1.1) rotate(-5deg);
}

.tcard-name {
  font-size: 17px;
  font-weight: 500;
  line-height: 22px;
  text-wrap: balance;
}

.tcard-go {
  position: absolute;
  top: 20px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--paper);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition:
    opacity 180ms var(--ease),
    transform 240ms var(--ease);
}

.tcard:hover .tcard-go,
.tcard:focus-visible .tcard-go {
  opacity: 1;
  transform: none;
}

/* the wide one, which says what the tool does */
.tcard-lead {
  grid-column: span 2;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 22px;
  background: var(--wash);
}

.tcard-lead .tool-icon {
  box-sizing: content-box;
  padding: 16px;
  border-radius: calc(22px * var(--sq));
  corner-shape: squircle;
  background: rgb(255 255 255 / 0.88);
}

.tcard-lead .tcard-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tcard-lead .tcard-name {
  font-size: 22px;
  line-height: 28px;
  letter-spacing: -0.01em;
}

.tcard-intro {
  display: -webkit-box;
  overflow: hidden;
  font-size: 15px;
  line-height: 22px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

/* a tool as a small card: in the menus, and in the cards that name several */
.mini {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 4px 10px;
  border-radius: calc(12px * var(--sq));
  corner-shape: squircle;
  font-size: 15px;
  line-height: 19px;
  transition: background-color 140ms var(--ease);
}

.mini:hover,
.mini:focus-visible,
.mini.is-active,
.mini.is-current {
  background: var(--wash);
}

.mini:hover .tool-icon {
  transform: scale(1.12) rotate(-4deg);
}

/* the card that names a group of tools, in its pen; what is written over a ribbon is always ink */
.gcard {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 356px;
  padding: 30px;
  border-radius: var(--q-xl);
  corner-shape: squircle;
  background: var(--wash);
}


.gcard-count {
  margin-top: auto;
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 99px;
  background: rgb(255 255 255 / 0.72);
  font-size: 14px;
  line-height: 20px;
}

.gblock {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

.gblock > .gcard {
  position: sticky;
  top: calc(var(--header) + 20px);
}

.gblock-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 20px;
}

.gblock.is-short {
  align-items: stretch;
}

.gblock.is-short > .gcard {
  min-height: 220px;
}

/* ── the stage: a page gone over with big highlighters (js/stage.js) ── */

.stage {
  position: relative;
  isolation: isolate;
  overflow: clip;
  max-width: 1680px;
  margin-inline: max(var(--inset), calc((100% - 1680px) / 2));
  border-radius: var(--q-stage);
  corner-shape: squircle;
  background: var(--wash);
}

.ribbons {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  max-width: none;
}

.ribbons g {
  isolation: isolate;
}

.ribbons path {
  mix-blend-mode: multiply;
}

.ribbons.draws path {
  stroke-dasharray: 1 1;
  animation: ribbon-in 1500ms cubic-bezier(0.3, 0, 0.1, 1) both;
  animation-delay: calc(var(--i) * 180ms);
}

@keyframes ribbon-in {
  from {
    stroke-dashoffset: 1;
  }
}

.stage-dark {
  background: var(--ink);
  color: var(--paper);
}

/* a tool's picture on a stage */
.stage-pic {
  display: grid;
  place-items: center;
  width: 136px;
  height: 136px;
  border-radius: calc(34px * var(--sq));
  corner-shape: squircle;
  background: rgb(255 255 255 / 0.88);
  box-shadow: var(--shadow-2);
  view-transition-name: tool-picture;
}

/* the head of a tool's page */
.strip {
  padding-block: 56px 52px;
}

.strip-in {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px 32px;
}

.strip-in > .stage-pic {
  grid-row: span 2;
}

.strip-in > .title {
  align-self: end;
  max-width: 20ch;
}

.strip-in > .lead {
  align-self: start;
  max-width: 46ch;
  color: var(--ink);
}

/* a page change: the tool's picture moves from where it was to where it goes */
::view-transition-group(tool-picture) {
  animation-duration: 320ms;
  animation-timing-function: var(--ease);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
}

/* ── the note over a tool (js/tooltip.js) ───────────────────────────── */

.tip {
  position: fixed;
  inset: 0 auto auto 0;
  width: min(320px, calc(100vw - 24px));
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: none;
  color: var(--paper);
  pointer-events: none;
}

.tip-body {
  overflow: hidden;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: var(--ink);
  box-shadow: var(--shadow-3);
  opacity: 0;
  transform: translate(var(--tip-x, 0), var(--tip-y, 10px)) scale(0.9);
  transform-origin: var(--tip-origin, 50% 100%);
  transition:
    opacity 160ms ease-out,
    transform 200ms var(--ease);
}

.tip.is-on .tip-body {
  opacity: 1;
  transform: none;
  transition:
    opacity 180ms ease-out,
    transform 420ms var(--spring);
}

/* from one tool to the next the note glides over, and its words change on the way */
.tip.is-moving {
  transition: translate 360ms var(--ease);
}

.tip-words {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px 20px;
}

.tip-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tip-head .tool-icon {
  padding: 5px;
  border-radius: calc(10px * var(--sq));
  corner-shape: squircle;
  background: var(--paper);
}

.tip-head strong {
  font-size: 16px;
  font-weight: 500;
  line-height: 21px;
}

.tip-text {
  color: rgb(255 255 255 / 0.82);
  font-size: 14px;
  line-height: 21px;
}

/* ── toasts ─────────────────────────────────────────────────────────── */

#toasts {
  position: fixed;
  top: calc(var(--header) + 12px);
  left: 50%;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 18px;
  border-radius: calc(14px * var(--sq));
  corner-shape: squircle;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
  line-height: 22px;
  box-shadow: var(--shadow-3);
  animation: rise 320ms var(--spring);
}

.toast .icon {
  margin-top: 2px;
}

.toast-error .icon {
  color: #ffb4a8;
}

.toast-success .icon {
  color: var(--lime);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
}

/* ── task notices: a task of the visitor's has ended (js/taskNotices.js) ── */

.task-notices {
  position: fixed;
  right: var(--gutter);
  bottom: var(--gutter);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 372px;
  max-width: calc(100vw - 2 * var(--gutter));
  pointer-events: none;
}

.task-notice {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  column-gap: 14px;
  padding: 18px 12px 20px 18px;
  overflow: hidden;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: var(--paper);
  box-shadow: var(--shadow-3);
  pointer-events: auto;
  animation: rise 360ms var(--spring);
}

.task-notice-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 20px;
}

.task-notice-name {
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
}

.task-notice-close {
  width: 32px;
  height: 32px;
  margin-top: -6px;
}

.task-notice-foot {
  grid-column: 2 / 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-right: 6px;
  font-size: 14px;
  font-weight: 500;
}

.task-notice-failed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--red);
}

/* how long the note stays: a stroke of highlighter along its foot that wears away */
.task-notice-timer {
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: var(--lime);
  transform-origin: left;
  animation: notice-wear 12s linear forwards;
}

.task-notice.is-failed .task-notice-timer {
  background: var(--line-2);
}

.task-notice:hover .task-notice-timer,
.task-notice:focus-within .task-notice-timer,
.task-notices.is-held .task-notice-timer {
  animation-play-state: paused;
}

@keyframes notice-wear {
  to {
    transform: scaleX(0);
  }
}

/* ── header ─────────────────────────────────────────────────────────── */

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--canvas);
  transition: box-shadow 200ms var(--ease);
}

.header.is-stuck {
  box-shadow: 0 1px 0 var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--header);
  max-width: 1680px;
  margin-inline: auto;
  padding-inline: calc(var(--inset) + 12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.nav {
  display: flex;
  flex: none;
  align-items: center;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: calc(10px * var(--sq));
  corner-shape: squircle;
  background: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 140ms var(--ease);
}

.nav-item:hover,
.nav-item[aria-expanded="true"],
.nav-item.is-current {
  background: var(--paper-3);
}

.header-side {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

/* the search box gives way first when the header runs short of room */
.search-slot {
  flex: 0 1 232px;
  min-width: 0;
  margin-right: 4px;
}

.header-side .btn {
  flex: none;
  margin-left: 4px;
}

.header-side .nav-item,
.header-side .icon-btn,
.header-side .menu-anchor {
  flex: none;
}

/* a menu under the header: the card of its part, and a card for each of its groups */
.panel {
  position: absolute;
  top: calc(var(--header) - 4px);
  left: 50%;
  width: min(1320px, calc(100vw - 2 * var(--inset)));
  max-height: calc(100svh - var(--header) - 16px);
  overflow: hidden auto;
  border-radius: calc(28px * var(--sq));
  corner-shape: squircle;
  background: var(--paper);
  box-shadow: var(--shadow-3);
  transform: translateX(-50%);
  transform-origin: 50% 0;
  animation: panel-in 320ms var(--ease);
  scrollbar-width: thin;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translate(-50%, -10px) scale(0.985);
  }
}

.panel-inner {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

/* going from one part to another in the open panel */
.panel-inner.from-left,
.panel-inner.from-right {
  animation: panel-swap 320ms var(--ease);
}

.panel-inner.from-left {
  --swap-from: -28px;
}

.panel-inner.from-right {
  --swap-from: 28px;
}

@keyframes panel-swap {
  from {
    opacity: 0;
    transform: translateX(var(--swap-from));
  }
}

.panel-lead {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 300px;
  padding: 24px;
  border-radius: calc(20px * var(--sq));
  corner-shape: squircle;
  background: var(--wash);
}

.panel-lead p {
  font-size: 15px;
  line-height: 23px;
}

.panel-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.panel-card {
  padding: 18px 12px 14px;
  border-radius: calc(20px * var(--sq));
  corner-shape: squircle;
  background: var(--canvas);
}

.panel-card-title {
  padding: 0 10px 8px;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 20px;
}

.panel-cards.is-few .panel-card ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2px 8px;
}

/* search */
.search {
  position: relative;
  width: 100%;
}

.search .input {
  min-height: 40px;
  padding: 8px 12px 8px 38px;
  border-color: transparent;
  border-radius: calc(10px * var(--sq));
  background: var(--paper-2);
  font-size: 15px;
}

.search .input:focus-visible {
  border-color: var(--green);
  border-radius: calc(10px * var(--sq));
  background: var(--paper);
}

.search > .icon {
  position: absolute;
  top: 12px;
  left: 13px;
  color: var(--ink-3);
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: min(440px, 70vh);
  overflow: auto;
  padding: 8px;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: var(--paper);
  box-shadow: var(--shadow-3);
  animation: rise 240ms var(--ease);
}

.search-empty {
  padding: 12px;
  color: var(--ink-3);
  font-size: 14px;
}

/* account menu */
.menu-anchor {
  position: relative;
}

.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  min-width: 240px;
  padding: 8px;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: var(--paper);
  box-shadow: var(--shadow-3);
  transform-origin: 100% 0;
  animation: rise 280ms var(--spring);
}

.menu-head {
  margin-bottom: 6px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 14px;
  line-height: 20px;
  word-break: break-all;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: calc(10px * var(--sq));
  corner-shape: squircle;
  background: none;
  font-size: 15px;
  text-align: left;
  transition: background-color 140ms var(--ease);
}

.menu-item:hover {
  background: var(--paper-2);
}

.menu-item .icon {
  color: var(--ink-3);
}

.menu-item-count {
  margin-left: auto;
  color: var(--ink-3);
}

.only-narrow {
  display: none;
}

/* the sheet that stands in for the navigation on a small screen */
.sheet {
  position: fixed;
  inset: var(--header) 0 0 0;
  z-index: 39;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px var(--gutter) 48px;
  background: var(--canvas);
  animation: sheet-down 240ms var(--ease);
}

@keyframes sheet-down {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.sheet .search {
  margin-bottom: 16px;
}

.sheet .search .input {
  min-height: 48px;
  font-size: 16px;
}

.sheet .search > .icon {
  top: 16px;
}

.sheet .search-results {
  position: static;
  width: 100%;
  max-width: none;
  margin-top: 8px;
  box-shadow: none;
}

.sheet-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet .panel-card {
  background: var(--paper);
  box-shadow: var(--shadow-1);
}

.sheet .mini {
  min-height: 48px;
}

.sheet-foot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
  padding: 8px;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: var(--paper);
  box-shadow: var(--shadow-1);
}

.sheet-foot .menu-item {
  min-height: 48px;
}

/* ── footer ─────────────────────────────────────────────────────────── */

.footer {
  margin-bottom: var(--inset);
  /* neither laid out nor moving while it is off the screen */
  content-visibility: auto;
  contain-intrinsic-block-size: auto 760px;
}

.footer .ribbons {
  height: 520px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 72px;
  padding-block: 112px 40px;
}

.footer-call {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
}

.footer-call h2 {
  max-width: 12ch;
}

/* two rows of tool cards that drift by, slowly enough to read */
.drifts {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-inline: calc(50% - 50vw);
  overflow: hidden;
}

.drift-row {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: drift 320s linear infinite;
}

.drift-back .drift-row {
  animation-direction: reverse;
}

.drifts:hover .drift-row {
  animation-play-state: paused;
}

@keyframes drift {
  to {
    transform: translateX(calc(-50% - 7px));
  }
}

.drift-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px 14px 16px;
  border-radius: var(--q-l);
  corner-shape: squircle;
  background: rgb(255 255 255 / 0.96);
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  white-space: nowrap;
}

.footer-cols {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
  padding-top: 40px;
  border-top: 1px solid rgb(255 255 255 / 0.14);
  font-size: 15px;
  line-height: 24px;
}

.footer-about {
  margin-top: 12px;
  color: rgb(255 255 255 / 0.66);
}

.footer-title {
  margin-bottom: 12px;
  color: rgb(255 255 255 / 0.66);
  font-size: 14px;
  line-height: 20px;
}

.footer-links li + li {
  margin-top: 6px;
}

.footer-links a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ── small screens ──────────────────────────────────────────────────── */

@media (max-width: 1080px) {
  :root {
    --inset: 16px;
  }

  .only-wide {
    display: none !important;
  }

  .only-narrow {
    display: inline-grid;
  }

  .gblock {
    grid-template-columns: minmax(0, 1fr);
  }

  .gblock > .gcard,
  .gblock.is-short > .gcard {
    position: relative;
    top: 0;
    min-height: 200px;
  }

  .gblock-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-cols {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
    --inset: 8px;
    --header: 60px;
    --q-stage: calc(20px * var(--sq));
  }

  .header-inner {
    padding-inline: 16px 10px;
  }

  .page {
    padding-block: 32px 64px;
  }

  .lead {
    font-size: 17px;
    line-height: 27px;
  }

  .gblock,
  .gblock-cards {
    gap: 12px;
  }

  .gblock-cards {
    grid-template-columns: 1fr 1fr;
  }

  /* two to a row, all of one kind: a card is its picture and its name */
  .tcard,
  .tcard-lead {
    grid-column: auto;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    min-height: 124px;
    padding: 16px;
    background: var(--paper);
  }

  .tcard .tool-icon,
  .tcard-lead .tool-icon {
    width: 44px !important;
    height: 44px !important;
    padding: 0;
    background: none;
  }

  .tcard .tcard-name {
    font-size: 16px;
    line-height: 20px;
    letter-spacing: 0;
  }

  .tcard > .ribbons,
  .tcard-intro,
  .tcard-go {
    display: none;
  }

  .gcard {
    min-height: 0;
    padding: 24px 20px;
  }

  .stage-pic {
    width: 84px;
    height: 84px;
  }

  .stage-pic .tool-icon {
    width: 56px !important;
    height: 56px !important;
  }

  .strip {
    padding-block: 32px;
  }

  .strip-in {
    gap: 14px 16px;
  }

  .strip-in > .stage-pic {
    grid-row: auto;
  }

  .strip-in > .title {
    align-self: center;
  }

  .strip-in > .lead {
    grid-column: 1 / -1;
  }

  .footer-inner {
    gap: 48px;
    padding-block: 64px 32px;
  }

  .task-notices {
    left: var(--gutter);
    width: auto;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* the tool cards of the footer stand still */
  .drift-row {
    animation: none !important;
  }

  /* a running task's page stands marked, without the highlighter going over it */
  .working.is-running .w-mark {
    animation: none !important;
    transform: none;
  }

  /* a task notice still goes after its while, without the stroke wearing away in sight */
  .task-notice-timer {
    animation-duration: 12s !important;
    visibility: hidden;
  }
}

/* ── print: a task's report, cover first, without the site around it ─── */

@media print {
  @page {
    margin: 16mm 14mm;
  }

  body {
    background: var(--paper);
  }

  .header,
  .footer,
  #toasts,
  .task-notices,
  .ribbons,
  .no-print {
    display: none !important;
  }

  .page {
    padding-block: 0;
  }

  .wrap {
    max-width: none;
    padding-inline: 0;
  }

  .stage {
    margin-inline: 0;
    border-radius: 0;
    background: none;
  }

  .card,
  .float {
    border: 1px solid var(--line-2);
    box-shadow: none;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  svg,
  figure,
  img {
    break-inside: avoid;
  }

  h2,
  h3 {
    break-after: avoid;
  }
}

/* ── the page as the backend writes it ──────────────────────────────── */
/* Every page address is answered with its words already in the HTML, for search engines
   and for a browser without scripts. Once the scripts run, the site draws itself over it. */

.js .static {
  display: none;
}

.static {
  max-width: 760px;
  margin-inline: auto;
  padding: 32px var(--gutter) 64px;
}

.static h1 {
  margin-top: 24px;
  font-size: 32px;
}

.static h2 {
  margin-top: 40px;
  font-size: 22px;
}

.static h3 {
  margin-top: 24px;
  font-size: 18px;
}

.static p,
.static li {
  margin-top: 8px;
  color: var(--ink-2);
}

.static a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}
