/* What the tools share on top of the blog's chrome (blog.css): the phone header, the index, and the pieces every
   tool builds with. Colours come from the blog's palette only. */
:root {
  /* a quiet fill for controls and tiles, a stronger one for tracks and pressed states */
  --surface: color-mix(in srgb, var(--ink) 5%, transparent);
  --surface-2: color-mix(in srgb, var(--ink) 11%, transparent);
  /* text on the accent */
  --on-accent: #fffdf7;
  --ok: #2f8a5b;
  --shadow: 0 1px 2px rgba(28, 26, 20, 0.05), 0 10px 30px rgba(28, 26, 20, 0.06);
}
:root[data-theme="dark"] {
  --on-accent: #1c1a14;
  --ok: #6fd39c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.25);
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
fieldset {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
::selection {
  background: var(--mark);
}

/* ---- index ---- */
.hub {
  padding-block: 88px 24px;
  max-width: 760px;
}
.hub h1 {
  font: 800 clamp(48px, 8vw, 88px) / 0.92 var(--display);
  letter-spacing: -0.04em;
  margin: 0 0 24px;
}
.hub h1 i {
  font-style: normal;
  color: var(--accent);
}
.hub > p {
  margin: 0 0 56px;
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.45;
  color: var(--muted);
  max-width: 30em;
}
.tool-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.tool-list a {
  display: block;
  padding-block: 22px;
  border-bottom: 1px solid var(--line);
}
.tool-list h2 {
  font: 700 25px / 1.2 var(--display);
  letter-spacing: -0.03em;
  margin: 0 0 6px;
}
.tool-list .arr {
  display: inline-block;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-8px);
  transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.tool-list a:hover .arr,
.tool-list a:focus-visible .arr {
  opacity: 1;
  transform: none;
}
.tool-list p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.55;
}

/* ---- a tool's page ---- */
.tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding-block: 28px 20px;
}
.tool-head h1 {
  font: 800 clamp(34px, 5vw, 46px) / 1 var(--display);
  letter-spacing: -0.04em;
  margin: 0;
}
.tool-head h1 i {
  font-style: normal;
  color: var(--accent);
}
/* the accent pill for a tool's main action, and the outlined one beside it */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  transition: filter 0.15s;
}
@media (hover: hover) {
  .btn:hover {
    filter: brightness(1.06);
  }
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
  filter: none;
}
.btn.ghost {
  background: none;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--rule);
}
@media (hover: hover) {
  .btn.ghost:hover {
    box-shadow: inset 0 0 0 1px var(--ink);
    filter: none;
  }
}
/* a row of choices where one is on, like the time signatures */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface);
}
.segmented button {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 999px;
}
.segmented button[aria-pressed="true"] {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(28, 26, 20, 0.14);
}
input[type="range"] {
  accent-color: var(--accent);
}

/* ---- phones: the blog's one-row header, from its responsive section ---- */
@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }
  .bar {
    gap: 2px;
    padding-block: 14px;
  }
  .brand {
    white-space: nowrap;
  }
  .tab {
    padding-inline: 7px;
  }
  .hub {
    padding-block: 48px 8px;
  }
  .hub > p {
    margin-bottom: 36px;
  }
}
@media (max-width: 380px) {
  .tab {
    padding-inline: 5px;
    font-size: 14px;
  }
}
@media (max-width: 330px) {
  .bar {
    gap: 0;
  }
  .brand {
    font-size: 17px;
  }
  .tab {
    padding-inline: 3px;
    font-size: 13px;
  }
  .theme-toggle {
    width: 32px;
    height: 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    /* biome-ignore lint/complexity/noImportantStyles: reduced motion must override every animation */
    animation: none !important;
    /* biome-ignore lint/complexity/noImportantStyles: as above */
    transition: none !important;
  }
}
