@font-face {
  font-family: "Grug Hand";
  src: url("/fonts/GrugHand-Light.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 300;
}

@font-face {
  font-family: "Grug Hand";
  src: url("/fonts/GrugHand-Regular.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Grug Hand";
  src: url("/fonts/GrugHand-Book.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 450;
}

@font-face {
  font-family: "Grug Hand";
  src: url("/fonts/GrugHand-Medium.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 500;
}

@font-face {
  font-family: "Inter Reference";
  src: url("/fonts/Inter-Regular.woff2") format("woff2");
  font-display: block;
  font-style: normal;
  font-weight: 400;
}

:root {
  color-scheme: light;
  --ink: #000000;
  --paper: #ffffff;
  --paper-soft: var(--paper);
  --panel: var(--paper);
  --line: var(--ink);
  --muted: var(--ink);
  --guide-cap: var(--ink);
  --guide-x: var(--ink);
  --guide-base: var(--ink);
  --page-gutter: clamp(20px, 5vw, 72px);
  --content-width: 1280px;
  --editor-side-column: minmax(290px, 0.88fr);
  --glyph-column-min: 72px;
  --glyph-column-max: 122px;
  --z-dialog: 200;
  --z-header: 100;
  --z-toast: 300;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #ffffff;
  --paper: #000000;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Grug Hand", ui-rounded, system-ui, sans-serif;
  font-feature-settings: "calt" 1, "rand" 1;
  font-size: 20px;
  font-variant-ligatures: contextual;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  touch-action: manipulation;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

[id] {
  scroll-margin-top: 104px;
}

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

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: var(--z-toast);
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.download-section,
.wisdom-section,
.coverage-section,
.format-section,
.forge-footer {
  width: min(100%, calc(var(--content-width) + (2 * var(--page-gutter))));
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.panel-kicker,
.font-card__meta,
.save-indicator,
.variation-field > span,
.guide-controls label > span,
.project-sliders label > span,
.stroke-cap-field legend,
.stacked-field > span {
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas,
    monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.pill--dark {
  background: var(--ink);
  color: var(--paper);
  --rough-fill-color: var(--ink);
}

.pill--outline {
  background: transparent;
  color: var(--ink);
}

.pill:active:not(:disabled),
.square-button:active:not(:disabled),
.drawing-actions button:active:not(:disabled),
.variation-thumbnail:active:not(:disabled),
.segmented button:active:not(:disabled) {
  transform: scale(0.97);
}

button:disabled {
  cursor: not-allowed;
  border-style: dashed;
}

.download-section,
.wisdom-section,
.coverage-section,
.format-section {
  padding-block: clamp(88px, 12vw, 160px);
}

.section-heading {
  display: block;
}

.section-heading h1,
.section-heading h2,
.wisdom-heading h2,
.coverage-heading h2 {
  margin: 0;
  font-size: clamp(46px, 7vw, 94px);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 0.98;
  text-wrap: balance;
}

.download-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 24px;
}

.font-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.font-card {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(26px, 4vw, 46px);
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  --rough-edge-intensity: 1.5;
}

.font-card--light {
  background: var(--paper);
}

.font-card--regular {
  background: var(--paper);
}

.font-card--book {
  background: var(--paper);
}

.font-card--medium {
  background: var(--paper);
}

.font-card__meta {
  margin: 0 0 26px;
  font-size: 10px;
}

.font-card__sample {
  margin: 0;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.02;
}

.font-card--light .font-card__sample {
  font-weight: 300;
}

.font-card--regular .font-card__sample {
  font-weight: 400;
}

.font-card--book .font-card__sample {
  font-weight: 450;
}

.font-card--medium .font-card__sample {
  font-weight: 500;
}

.font-card > a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  margin-top: 32px;
  text-decoration: none;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    transform 150ms ease;
  --rough-edge-intensity: 1.45;
}

.font-card > a:active {
  transform: scale(0.97);
}

.wisdom-heading {
  display: grid;
  justify-items: start;
  gap: 28px;
}

.grug-download-link {
  gap: 7px;
}

.grug-download-icon {
  display: inline-grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  font-family: "Grug Hand", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
}

.wisdom-today {
  padding: clamp(30px, 6vw, 76px);
  border: 1px solid var(--ink);
  margin-top: 56px;
  background: var(--ink);
  color: var(--paper);
  --rough-fill-color: var(--ink);
  --rough-edge-intensity: 2.1;
}

.wisdom-today blockquote {
  position: relative;
  max-width: 1040px;
  margin: 30px 0 0;
  font-feature-settings: "calt" 0, "rand" 0;
  font-size: clamp(38px, 5.5vw, 72px);
  font-variant-ligatures: none;
  line-height: 1.02;
  text-wrap: balance;
}

.wisdom-meta {
  margin: 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wisdom-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.wisdom-card {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid var(--line);
  --rough-edge-intensity: 1.5;
}

.wisdom-card blockquote {
  position: relative;
  margin: 0;
  font-feature-settings: "calt" 0, "rand" 0;
  font-size: clamp(24px, 2.4vw, 34px);
  font-variant-ligatures: none;
  line-height: 1.06;
}

.wisdom-replay {
  touch-action: manipulation;
}

.wisdom-replay:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.wisdom-replay-static {
  display: block;
}

.wisdom-replay-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  transform: translate(1px, 1px);
  opacity: 0;
  pointer-events: none;
}

.wisdom-card .wisdom-replay-canvas {
  transform: translate(1px, 1px);
}

.wisdom-replay.is-replaying .wisdom-replay-static {
  opacity: 0;
}

.wisdom-replay.is-replaying .wisdom-replay-canvas {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .wisdom-replay {
    cursor: pointer;
  }
}

.coverage-heading {
  display: grid;
  justify-items: start;
  gap: 18px;
}

.coverage-heading > p {
  margin: 0;
  color: var(--muted);
}

.segmented {
  display: inline-flex;
  padding: 4px;
  margin: 48px 0 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.segmented button {
  min-width: 116px;
  min-height: 44px;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    transform 150ms ease;
  --rough-fill-color: transparent;
}

.segmented button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  --rough-fill-color: var(--ink);
}

.segmented--small {
  display: flex;
  margin: 14px 0;
}

.segmented--small button {
  min-width: 0;
  flex: 1;
  font-size: 16px;
}

.compiled-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}

.compiled-glyph {
  display: grid;
  min-height: 120px;
  place-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  text-align: center;
  --rough-edge-intensity: 1.35;
}

.compiled-glyph__mark {
  font-family: "Grug Hand", sans-serif;
  font-size: 52px;
  font-weight: 400;
  line-height: 1;
}

.compiled-glyph__label {
  overflow: hidden;
  max-width: 100%;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coverage-note {
  width: 100%;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
}

.editor-section {
  --editor-edge-gap: 12px;
  padding: clamp(24px, 4vw, 56px) 0 clamp(88px, 12vw, 160px);
}

.forge-app {
  display: grid;
  width: calc(100% - (2 * var(--editor-edge-gap)));
  min-height: 820px;
  grid-template-columns: var(--editor-side-column) minmax(440px, 1.55fr) var(--editor-side-column);
  margin-inline: auto;
  border: 1px solid var(--line);
  background: var(--panel);
}

.glyph-browser,
.drawing-panel,
.project-panel {
  min-width: 0;
  padding: clamp(20px, 2.5vw, 34px);
}

.glyph-browser,
.drawing-panel {
  border-right: 1px solid var(--line);
}

.glyph-browser {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  contain: size;
  overflow: hidden;
}

.panel-heading {
  display: flex;
  min-height: 48px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel-heading h3 {
  margin: 2px 0 0;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
}

.panel-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.square-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
  transition:
    background-color 150ms ease,
    transform 150ms ease;
}

.square-button--thumb,
.preview-card > .preview-play {
  border-color: var(--ink);
  border-radius: 48% 52% 46% 54% / 54% 47% 53% 46%;
  background: var(--paper);
  box-shadow: 0.7px 0.4px 0 var(--ink);
  transform: rotate(-1deg);
}

.search-field {
  display: block;
  margin-top: 18px;
}

.search-field input,
.stacked-field input,
.stacked-field select,
.add-dialog input,
.add-dialog select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  color: var(--ink);
  font-size: 16px;
}

.glyph-grid {
  display: grid;
  flex: 1;
  height: 0;
  min-height: 0;
  align-content: start;
  grid-auto-rows: max-content;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  overflow-y: auto;
  padding: 1px 4px 12px 1px;
  overscroll-behavior: contain;
}

.glyph-tile {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 84px;
  grid-template-rows: auto auto;
  gap: 2px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: center;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.glyph-tile[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
  --rough-edge-color: var(--ink);
}

.glyph-tile canvas {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 3 / 4.6;
  pointer-events: none;
}

.glyph-tile span {
  display: block;
  overflow: hidden;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.glyph-tile sup {
  position: absolute;
  top: 4px;
  right: 5px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 8px;
}

.panel-heading--drawing {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
  align-items: flex-start;
  margin-bottom: 20px;
}

.panel-heading--drawing h3 {
  display: flex;
  height: 62px;
  align-items: center;
  overflow: hidden;
  max-width: 14ch;
  margin: 6px 0 0;
  font-size: clamp(46px, 4vw, 62px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.variation-field {
  min-width: 0;
}

.variation-field > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8px;
}

.variation-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  margin-top: -17px;
  padding: 18px 18px 5px 2px;
  scroll-snap-type: x proximity;
}

.variation-thumbnail-item {
  position: relative;
  width: 54px;
  min-width: 54px;
  min-height: 62px;
  flex: 0 0 54px;
  scroll-snap-align: start;
}

.variation-thumbnail-item[data-selected="true"] {
  z-index: 4;
}

.variation-thumbnail {
  position: relative;
  display: grid;
  width: 54px;
  min-width: 54px;
  min-height: 62px;
  flex: 0 0 54px;
  grid-template-rows: 44px auto;
  place-items: center;
  padding: 5px 4px 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  scroll-snap-align: start;
  touch-action: manipulation;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
  --rough-edge-intensity: 2.35;
  --rough-fill-color: transparent;
}

.variation-thumbnail[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
  --rough-edge-color: var(--ink);
  --rough-fill-color: var(--ink);
}

.variation-thumbnail canvas {
  width: 46px;
  height: 42px;
  pointer-events: none;
}

.variation-thumbnail span {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 8px;
  line-height: 1;
  pointer-events: none;
}

.variation-thumbnail--add {
  grid-template-rows: 1fr;
  border-style: dashed;
}

.variation-thumbnail--add .variation-thumbnail__plus {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 28px;
  line-height: 1;
}

.variation-thumbnail-delete {
  position: absolute;
  z-index: 3;
  top: -17px;
  right: -17px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  touch-action: manipulation;
  transform: scale(0.82);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.variation-thumbnail-delete__mark {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 48% 52% 46% 54% / 54% 47% 53% 46%;
  background: var(--paper);
  box-shadow: 0.7px 0.4px 0 var(--ink);
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 16px;
  line-height: 1;
}

.variation-thumbnail-item[data-selected="true"] .variation-thumbnail-delete,
.variation-thumbnail-item:focus-within .variation-thumbnail-delete,
.variation-thumbnail-delete:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.canvas-shell {
  position: relative;
  width: min(100%, 570px);
  margin-inline: auto;
  isolation: isolate;
}

.canvas-stage {
  min-width: 0;
}

.canvas-shell canvas {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4.6;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  cursor: crosshair;
  touch-action: none;
}

.guide-label {
  position: absolute;
  right: 9px;
  z-index: 1;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--paper-soft);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 8px;
  pointer-events: none;
  transform: translateY(-50%);
}

.guide-label--x {
  top: 34%;
  color: var(--guide-x);
}

.guide-label--cap {
  top: 18%;
  color: var(--guide-cap);
}

.guide-label--baseline {
  top: 76.5%;
  color: var(--guide-base);
}

.drawing-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.drawing-actions button,
.project-file-actions button,
.file-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.1;
  text-align: center;
  transition:
    background-color 150ms ease,
    transform 150ms ease;
}

.drawing-actions .drawing-play {
  padding-inline: 0;
  background: var(--ink);
  color: var(--paper);
  touch-action: manipulation;
  --rough-fill-color: var(--ink);
}

.drawing-play__icon {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
}

.drawing-actions .drawing-play:disabled {
  opacity: 0.38;
}

.guide-controls,
.project-sliders {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

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

.project-sliders {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guide-controls label > span,
.project-sliders label > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 8px;
}

output {
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  height: 20px;
  width: 100%;
  appearance: none;
  accent-color: var(--ink);
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: transparent;
}

input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  appearance: none;
  margin-top: -8px;
  border: 1px solid var(--ink);
  border-radius: 48% 52% 46% 54% / 54% 47% 53% 46%;
  background: var(--paper);
  box-shadow: 0.7px 0.4px 0 var(--ink);
}

input[type="range"]::-moz-range-track {
  height: 2px;
  background: transparent;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 1px solid var(--ink);
  border-radius: 48% 52% 46% 54% / 54% 47% 53% 46%;
  background: var(--paper);
  box-shadow: 0.7px 0.4px 0 var(--ink);
}

.project-panel {
  display: flex;
  flex-direction: column;
}

.stacked-field {
  display: grid;
  gap: 7px;
  margin-top: 22px;
}

.project-panel > .stacked-field:first-of-type {
  margin-top: 0;
}

.stacked-field > span {
  color: var(--muted);
  font-size: 8px;
}

.stroke-cap-field {
  min-width: 0;
  padding: 0;
  margin: 22px 0 0;
  border: 0;
}

.stroke-cap-field legend {
  padding: 0;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 8px;
}

.stroke-cap-segmented {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 4px;
}

.stroke-cap-segmented button {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  place-items: center;
}

.stroke-cap-example {
  position: relative;
  display: block;
  width: min(76px, 72%);
  height: 28px;
  color: currentColor;
  pointer-events: none;
}

.stroke-cap-example::before {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 22px;
  background: currentColor;
  content: "";
  transform: translateY(-50%);
}

.stroke-cap-example--round::before {
  border-radius: 999px;
}

.stroke-cap-example--flat::before {
  border-radius: 0;
}

.preview-card {
  position: relative;
  min-height: 250px;
  padding: 18px 18px 72px;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-soft);
}

.preview-card > .preview-play {
  position: absolute;
  z-index: 2;
  right: 18px;
  bottom: 18px;
  left: auto;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--ink);
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 150ms ease;
}

.preview-play:active:not(:disabled) {
  transform: rotate(-1deg) scale(0.97);
}

.preview-play__icon {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
}

.preview-stage {
  position: relative;
  min-height: 160px;
  isolation: isolate;
}

.preview-card textarea {
  display: block;
  width: 100%;
  min-height: 100px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  appearance: none;
  background: transparent;
  color: var(--ink);
  caret-color: var(--ink);
  font-family: "Grug Hand", sans-serif;
  font-feature-settings: "calt" 0, "rand" 0;
  font-variant-ligatures: none;
  overflow-wrap: anywhere;
  font-size: clamp(28px, 3.2vw, 44px);
  letter-spacing: 0;
  line-height: 1.04;
  resize: none;
  text-wrap: wrap;
  transition: opacity 120ms ease;
}

.preview-card textarea:focus {
  outline: none;
}

.preview-card textarea:focus-visible {
  outline: 1px dashed var(--ink);
  outline-offset: 8px;
}

.preview-stage canvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transform: translate(1px, 1px);
  transition: opacity 120ms ease;
}

.preview-stage[data-animating="true"] [data-font-preview] {
  opacity: 0;
}

.preview-stage[data-animating="true"] canvas {
  opacity: 1;
}

.export-section {
  margin-top: 26px;
}

.export-heading {
  margin-bottom: 13px;
}

.export-heading h4 {
  margin: 2px 0 0;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}

.export-stack {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.export-action {
  position: relative;
  --rough-fill-color: transparent;
  display: grid;
  width: 100%;
  min-height: 60px;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.export-action:active:not(:disabled) {
  transform: scale(0.97);
}

.export-action--primary {
  min-height: 72px;
  background: var(--ink);
  color: var(--paper);
  --rough-fill-color: var(--ink);
}

.export-action__copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.export-action strong {
  overflow: hidden;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.05;
  text-overflow: ellipsis;
}

.export-action small,
.project-file-actions small {
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas,
    monospace;
  font-size: 8px;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-transform: uppercase;
}

.project-file-actions {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr;
  gap: 8px;
}

.project-file-divider {
  width: 100%;
  height: 0;
  flex: 0 0 auto;
  margin-block: 16px;
}

.project-file-actions button,
.project-file-actions .file-button {
  flex-direction: column;
  gap: 4px;
}

.project-file-actions small {
  opacity: 0.72;
}

.file-button {
  position: relative;
  overflow: visible;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-button:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.privacy-note {
  margin: auto 0 0;
  padding-top: 22px;
  color: var(--muted);
  font-size: 14px;
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
}

.format-grid article {
  min-height: 280px;
  padding: clamp(26px, 4vw, 46px);
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}

.format-grid article:first-child {
  background: var(--paper);
}

.format-grid article:last-child {
  background: var(--paper);
}

.format-grid h3 {
  margin: 0 0 12px;
  font-size: 34px;
  font-weight: 500;
}

.format-grid article > p:last-child {
  max-width: 44ch;
  margin: 0;
}

.add-dialog {
  z-index: var(--z-dialog);
  width: min(calc(100% - 32px), 520px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--ink);
}

.add-dialog::backdrop {
  background: var(--ink);
}

.add-dialog form {
  padding: 28px;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.dialog-heading h2 {
  margin: 4px 0 0;
  font-size: 42px;
  font-weight: 400;
  line-height: 1;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 0.6fr 1fr;
  gap: 8px;
  margin-top: 24px;
}

.field-error {
  min-height: 24px;
  margin: 8px 0 0;
  color: var(--ink);
  text-decoration: underline;
  font-size: 15px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: var(--z-toast);
  max-width: min(420px, calc(100% - 36px));
  min-height: 44px;
  padding: 11px 16px;
  margin: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
}

.forge-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 34px;
  padding-block: 34px calc(34px + env(safe-area-inset-bottom));
}

.forge-footer p {
  margin: 0;
  font-size: 16px;
}

.forge-footer p:first-child {
  max-width: 640px;
}

.forge-footer a {
  text-underline-offset: 4px;
}

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

@media (hover: hover) and (pointer: fine) {
  .pill:hover:not(:disabled),
  .drawing-actions button:hover:not(:disabled),
  .project-file-actions button:hover:not(:disabled),
  .file-button:hover,
  .square-button:hover:not(:disabled) {
    background: var(--ink);
    color: var(--paper);
  }

  .export-action:not(.export-action--primary):hover:not(:disabled) {
    background: transparent;
    color: var(--paper);
    --rough-fill-color: var(--ink);
  }

  .pill--dark:hover:not(:disabled) {
    transform: translateY(-1px);
  }

  .export-action--primary:hover:not(:disabled) {
    transform: translateY(-1px);
  }

  .glyph-tile:hover:not([aria-pressed="true"]) {
    outline: 1px solid var(--ink);
    outline-offset: -2px;
  }

  .variation-thumbnail:hover:not([aria-pressed="true"]) {
    outline: 1px solid var(--ink);
    outline-offset: -2px;
  }

  .variation-thumbnail-item:hover .variation-thumbnail-delete {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
  }

  .preview-play:hover:not(:disabled) {
    transform: translateY(-1px) rotate(-1deg);
  }

  .font-card > a:hover,
  .forge-footer a:hover {
    text-decoration-thickness: 2px;
  }

  .font-card > a:hover {
    background: var(--ink);
    color: var(--paper);
  }
}

@media (hover: none), (pointer: coarse) {
  .variation-thumbnail-item[data-selected="true"] .variation-thumbnail-delete {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
  }
}

@media (min-width: 1081px) {
  .editor-section {
    padding: 0 0 var(--editor-edge-gap);
  }

  .forge-app {
    height: calc(100vh - 84px - var(--editor-edge-gap));
    height: calc(100dvh - 84px - var(--editor-edge-gap));
    min-height: 0;
    max-height: calc(100vh - 84px - var(--editor-edge-gap));
    max-height: calc(100dvh - 84px - var(--editor-edge-gap));
  }

  .glyph-browser {
    padding-bottom: 0;
  }

  .glyph-grid {
    grid-template-columns: repeat(auto-fill, minmax(var(--glyph-column-min), 1fr));
    padding-bottom: calc(clamp(20px, 2.5vw, 34px) + 12px);
  }

  .glyph-tile {
    width: 100%;
    max-width: var(--glyph-column-max);
    justify-self: center;
  }

  .drawing-panel {
    display: flex;
    height: 100%;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
  }

  .canvas-stage {
    display: grid;
    min-height: 0;
    flex: 1 1 0;
    place-items: center;
    container-type: size;
  }

  .canvas-shell {
    width: min(100cqw, 65.217391cqh, 570px);
    height: auto;
    max-width: none;
    aspect-ratio: 3 / 4.6;
  }

  .canvas-shell canvas {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }

  .project-panel {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}

@media (max-width: 1080px) {
  .forge-app {
    grid-template-columns: minmax(210px, 0.62fr) minmax(420px, 1.3fr);
  }

  .drawing-panel {
    border-right: 0;
  }

  .project-panel {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .project-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 28px;
  }

  .project-panel .panel-heading,
  .project-panel .preview-card,
  .project-panel .privacy-note,
  .project-file-divider,
  .project-file-actions {
    grid-column: 1 / -1;
  }

  .export-section,
  .project-file-actions {
    align-self: end;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 17px;
  }

  [id] {
    scroll-margin-top: 80px;
  }

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

  .format-grid {
    grid-template-columns: 1fr;
  }

  .download-section,
  .wisdom-section,
  .coverage-section,
  .format-section {
    padding-block: 64px;
  }

  .section-heading h1,
  .section-heading h2,
  .wisdom-heading h2,
  .coverage-heading h2 {
    font-size: clamp(43px, 12vw, 58px);
  }

  .font-card-grid,
  .wisdom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .font-card {
    min-height: 220px;
    padding: 20px 18px;
  }

  .font-card__sample {
    font-size: clamp(25px, 7vw, 34px);
  }

  .font-card > a {
    width: 100%;
    padding-inline: 10px;
    margin-top: 22px;
    font-size: 15px;
  }

  .wisdom-today {
    padding: 28px 22px 32px;
    margin-top: 36px;
  }

  .wisdom-today blockquote {
    margin-top: 22px;
    font-size: clamp(34px, 9vw, 46px);
  }

  .wisdom-card {
    min-height: 230px;
    gap: 24px;
    padding: 20px 16px;
  }

  .wisdom-card blockquote {
    font-size: clamp(19px, 5.3vw, 24px);
  }

  .download-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .download-heading .pill {
    width: 100%;
  }

  .compiled-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .compiled-glyph {
    min-height: 88px;
    padding: 8px 5px;
  }

  .compiled-glyph__mark {
    font-size: 39px;
  }

  .compiled-glyph__label {
    font-size: 7px;
  }

  .forge-app {
    width: calc(100% - (2 * var(--editor-edge-gap)));
    grid-template-columns: 1fr;
  }

  .glyph-browser,
  .drawing-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .glyph-browser {
    max-height: none;
    contain: none;
    overflow: visible;
    padding: 16px;
  }

  .glyph-grid {
    height: auto;
    flex: none;
    max-height: 280px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .drawing-panel {
    padding-inline: 16px;
  }

  .panel-heading--drawing {
    margin-bottom: 12px;
  }

  .variation-strip {
    padding-top: 22px;
  }

  .canvas-shell {
    width: min(84vw, 300px);
  }

  .drawing-actions {
    grid-template-columns: 1fr 1fr;
  }

  .guide-controls,
  .project-sliders,
  .project-file-actions,
  .dialog-actions {
    grid-template-columns: 1fr;
  }

  input[type="range"] {
    height: 44px;
  }

  .forge-app .rough-range-host {
    height: 44px;
  }

  .forge-app .rough-range-overlay {
    top: 50%;
    right: 0;
    bottom: auto;
    left: 0;
    transform: translateY(-50%);
  }

  .project-panel {
    display: flex;
    padding: 18px 16px;
  }

  .export-section,
  .project-file-actions {
    width: 100%;
    align-self: stretch;
  }

  .preview-card {
    min-height: 205px;
    padding: 16px 16px 64px;
    margin-top: 18px;
  }

  .preview-stage {
    min-height: 120px;
  }

  .preview-card textarea {
    min-height: 80px;
    font-size: 31px;
  }

  .export-section {
    margin-top: 22px;
  }

  .export-action {
    min-height: 54px;
  }

  .export-action--primary {
    min-height: 64px;
  }

  .format-grid {
    gap: 10px;
    margin-top: 34px;
  }

  .format-grid article {
    min-height: 220px;
    padding: 24px 20px;
  }

  .forge-footer {
    gap: 18px;
  }
}

@media (max-width: 430px) {
  .segmented {
    display: flex;
  }

  .segmented button {
    min-width: 0;
    flex: 1;
  }
}

@media (max-width: 360px) {
  .glyph-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .download-section,
  .wisdom-section,
  .coverage-section,
  .format-section {
    padding-block: 52px;
  }

  .wisdom-card {
    min-height: 210px;
    gap: 16px;
    padding: 16px 13px;
  }

  .wisdom-card blockquote {
    font-size: 18px;
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #ffffff;
    --paper: #000000;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
