@font-face {
  font-family: "Sans Bullshit Sans";
  src:
    url("/fonts/SansBullshitSans.woff2") format("woff2"),
    url("/fonts/SansBullshitSans.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

/* Same glyphs with the ligature table removed. The original font marks its
   buzzword ligatures as a required feature, so CSS can't switch them off;
   turning the filter off swaps to this copy instead. */
@font-face {
  font-family: "Sans Bullshit Sans Unfiltered";
  src: url("/fonts/SansBullshitSans-Unfiltered.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  --paper: #f7f5ff;
  --ink: #1d1340;
  --muted: #5e5675;
  --line: #d9d2ee;
  --magenta: #e400ff;
  --link: #a300bd;
  --wall-ink: #1d1340;
  --code-bg: #ece8fb;
  --font: "Sans Bullshit Sans", "Noto Sans", "Open Sans", sans-serif;
  --font-plain: "Sans Bullshit Sans Unfiltered", "Noto Sans", "Open Sans",
    sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);
  --measure: 36rem;
  --section: clamp(4.5rem, 12vw, 9rem);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #150d2e;
    --ink: #eeeaff;
    --muted: #a9a1c4;
    --line: #362b5c;
    --link: #f17dff;
    --code-bg: #1f1640;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #150d2e;
  --ink: #eeeaff;
  --muted: #a9a1c4;
  --line: #362b5c;
  --link: #f17dff;
  --code-bg: #1f1640;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

html[data-filter="off"] {
  --font: var(--font-plain);
}

h1,
h2,
p,
ul,
pre {
  margin: 0;
}

h2 {
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: 0;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

::selection {
  background: var(--magenta);
  color: #fff;
}

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

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 20;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
}

.skip:focus {
  top: 0.5rem;
}

/* Masthead */

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem var(--gutter);
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.masthead.is-scrolled {
  border-bottom-color: var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.0625rem;
  white-space: nowrap;
}

.wordmark-bar {
  display: inline-block;
  width: 1.6rem;
  height: 0.7rem;
  background: var(--ink);
  border-radius: 2px;
  transform: rotate(-4deg);
  box-shadow: 0.2rem 0.2rem 0 var(--magenta);
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  padding: 0.25rem;
  cursor: pointer;
}

.switch {
  position: relative;
  width: 3rem;
  height: 1.6rem;
  border-radius: 1rem;
  background: var(--magenta);
  transition: background 0.2s;
  flex: none;
}

.knob {
  position: absolute;
  top: 0.2rem;
  left: 1.6rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
}

.filter-toggle[aria-pressed="false"] .switch {
  background: var(--line);
}

.filter-toggle[aria-pressed="false"] .knob {
  left: 0.2rem;
}

/* Shared section rhythm */

main > section {
  padding: var(--section) var(--gutter) 0;
}

.section-head {
  max-width: var(--measure);
  margin-bottom: 2.5rem;
}

.section-head p {
  margin-top: 1rem;
  color: var(--muted);
}

.prose {
  max-width: var(--measure);
}

.prose p + p {
  margin-top: 1.1em;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.6rem 1.4rem;
  border: 2px solid var(--ink);
  border-radius: 0.375rem;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 1.0625rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  box-shadow: 0.25rem 0.25rem 0 var(--magenta);
  transform: translate(-0.125rem, -0.125rem);
}

.button:active {
  box-shadow: none;
  transform: none;
}

.button-quiet {
  background: transparent;
  color: var(--ink);
}

/* Hero */

.hero {
  min-height: calc(100svh - 4rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  padding: clamp(2rem, 8vh, 5rem) var(--gutter) clamp(2rem, 6vh, 4rem);
}

.hero-sentence {
  font-size: clamp(2.25rem, 7.2vw, 6.25rem);
  line-height: 1.08;
  letter-spacing: 0;
  max-width: 15em;
  min-height: 3.24em;
}

.hero-sentence .phrase {
  white-space: nowrap;
}

.hero-sentence .caret {
  display: inline-block;
  width: 0.06em;
  height: 0.9em;
  margin-left: 0.04em;
  vertical-align: -0.08em;
  background: var(--magenta);
  animation: blink 1s steps(1) infinite;
}

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

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  padding-top: 1.75rem;
  border-top: 2px solid var(--ink);
}

.hero-lede {
  max-width: 30rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Try it */

.editor {
  max-width: 64rem;
}

.editor textarea {
  display: block;
  width: 100%;
  min-height: 12rem;
  padding: 1.25rem 1.5rem;
  border: 2px solid var(--ink);
  border-radius: 0.5rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: clamp(1.375rem, 3vw, 2rem);
  line-height: 1.35;
  resize: vertical;
}

.editor textarea::placeholder {
  color: var(--muted);
}

/* Chrome sometimes skips re-shaping ligatures while typing in a textarea;
   nudging the size forces a redraw. The original site did the same. */
.editor textarea.redraw {
  font-size: calc(clamp(1.375rem, 3vw, 2rem) + 0.001px);
}

.editor textarea:focus-visible {
  outline-offset: 4px;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.fineprint {
  max-width: var(--measure);
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* The wall */

main > section.wall {
  margin-top: var(--section);
  padding-bottom: var(--section);
  background: var(--magenta);
  color: var(--wall-ink);
}

.wall .section-head p {
  color: var(--wall-ink);
}

.wall-words {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.1rem;
  max-width: 80rem;
}

.bs {
  position: relative;
  padding: 0.1rem 0;
  border: 0;
  background: none;
  color: var(--wall-ink);
  font: inherit;
  font-size: clamp(1.375rem, 2.6vw, 2rem);
  line-height: 1.3;
  cursor: help;
}

.bs::after {
  content: attr(data-word);
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.35rem);
  z-index: 2;
  padding: 0.3rem 0.65rem;
  border-radius: 0.3rem;
  background: var(--wall-ink);
  color: #fff;
  font-size: 1rem;
  line-height: 1.3;
  white-space: nowrap;
  font-family: var(--font-plain);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.bs:hover::after,
.bs:focus-visible::after,
.bs.is-revealed::after {
  opacity: 1;
  visibility: visible;
}

.bs:focus-visible {
  outline-color: var(--wall-ink);
}

html[data-filter="off"] .bs::after {
  display: none;
}

/* How it works */

.how-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--measure));
  gap: 2.5rem 4rem;
  align-items: start;
}

.how-demo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  font-size: clamp(2rem, 5vw, 3.75rem);
  line-height: 1;
}

.letters {
  display: inline-flex;
  gap: 0.12em;
  font-family: var(--font-plain);
}

.letters span {
  display: inline-grid;
  place-items: center;
  min-width: 0.9em;
  padding: 0.12em 0.1em 0.2em;
  border: 2px dashed var(--line);
  border-radius: 0.15em;
}

.equals {
  font-size: 1rem;
  color: var(--muted);
}

/* Use it */

.use-grid {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  gap: 2.5rem 4rem;
  align-items: start;
  max-width: 64rem;
}

.downloads {
  list-style: none;
  padding: 0;
}

.downloads li {
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}

.downloads li:last-child {
  border-bottom: 1px solid var(--line);
}

.downloads a {
  font-size: 1.1875rem;
}

.downloads span {
  display: block;
  font-size: 0.9375rem;
  color: var(--muted);
}

.code {
  overflow-x: auto;
  padding: 1.25rem 1.5rem;
  border-radius: 0.5rem;
  background: var(--code-bg);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Origin */

.links {
  list-style: none;
  padding: 0;
  margin-top: 1.75rem;
}

.links li + li {
  margin-top: 0.5rem;
}

/* Footer */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: var(--section);
  padding: 2rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--muted);
}

@media (max-width: 52rem) {
  .how-grid,
  .use-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 34rem) {
  body {
    font-size: 1.0625rem;
  }

  .filter-toggle-label {
    font-size: 0.9375rem;
  }

  .wordmark {
    font-size: 0;
  }

  .wordmark-bar {
    width: 2rem;
    height: 0.85rem;
  }

  .hero-sentence {
    min-height: 0;
  }

  .actions,
  .actions .button {
    width: 100%;
  }
}

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