/* Two threads only. Everything else is a mix of the two. */
@font-face {
  font-family: 'Alagard';
  src: url('/fonts/Alagard.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --warp: #1a1a1a;
  --weft: #f3eee4;
  --paper: var(--weft);
  --paper-deep: color-mix(in srgb, var(--warp) 7%, var(--weft));
  --card: color-mix(in srgb, var(--warp) 3%, var(--weft));
  --ink: var(--warp);
  --muted: color-mix(in srgb, var(--warp) 68%, var(--weft));
  --highlight: color-mix(in srgb, var(--warp) 14%, var(--weft));
  --federal: var(--warp);
  --blue: var(--warp);
  --pink: var(--warp);
  --yellow: var(--highlight);
  --orange: var(--warp);
  --red: var(--warp);
  --green: var(--warp);
  --purple: var(--warp);
  --mono: 'Alagard', ui-monospace, monospace;
  --serif: 'Alagard', ui-monospace, monospace;
  --wrap: 1160px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar,
*::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-track {
  display: none;
  width: 0;
  height: 0;
}

html {
  background: var(--paper);
  color: var(--ink);
  cursor: var(--weave-cursor, crosshair);
  font: 400 16px/1.6 var(--mono);
  font-synthesis: none;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  font-smooth: never;
  text-rendering: optimizeSpeed;
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}

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

  .hero-line:has(textarea:placeholder-shown:not(:focus))::before {
    animation: none;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  background-color: var(--paper);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 13%, transparent) 0.9px, transparent 1.1px);
  background-size: 7px 7px;
  background-attachment: fixed;
}

:root[data-ground='grid'] body {
  background-image:
    linear-gradient(color-mix(in srgb, var(--ink) 8%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 8%, transparent) 1px, transparent 1px);
  background-size: 16px 16px;
}

:root[data-ground='dashes'] body {
  background-image:
    repeating-linear-gradient(
      90deg,
      var(--paper) 0 8px,
      transparent 8px 16px
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0 8px,
      color-mix(in srgb, var(--ink) 11%, transparent) 8px 9px
    );
  background-size: auto auto;
}

:root[data-ground='lines'] body {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 21px,
    color-mix(in srgb, var(--ink) 9%, transparent) 21px 22px
  );
  background-size: auto auto;
}

main {
  flex: 1;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

canvas {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

a {
  cursor: pointer;
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--ink) 45%, var(--paper));
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

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

input:not([type='color']),
textarea {
  cursor: text;
}

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

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
}

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

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

.kicker {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--federal);
  margin: 0 0 0.75rem;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

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

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 40;
  background: var(--highlight);
  padding: 0.25rem 0.5rem;
}

/* header */

.site-chrome {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  background: var(--paper);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 10%, transparent);
}

.site-header {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin: 0 auto;
  padding: 1.25rem 0;
  display: flex;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  text-decoration: none;
}

.brand:hover {
  background: none;
}

.brand-mark {
  height: calc(36px * 1.04);
  width: auto;
}

/* The loading weave sits in the logo slot. The real mark keeps its width so the bar does not jump. */
html.is-loading .site-chrome {
  z-index: 90;
}

html.is-loading .brand {
  position: relative;
}

html.is-loading .brand-mark {
  visibility: hidden;
}

.brand-loader {
  position: absolute;
  left: 0;
  top: 50%;
  height: calc(36px * 1.04);
  width: auto;
  transform: translateY(-50%);
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.68rem;
  font-style: normal;
  text-transform: none;
}

.site-nav {
  display: flex;
  gap: 0.25rem 1.25rem;
  flex-wrap: wrap;
  flex: 1 1 auto;
  font-size: 0.89rem;
}

.site-nav a {
  text-decoration: none;
  padding: 0.1rem 0;
  border-bottom: 3px solid transparent;
}

.site-nav {
  align-items: center;
}

.site-nav a {
  --c: var(--ink);
}

.site-nav .nav-cta {
  background: var(--ink);
  color: var(--paper);
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  border: 0;
}

.site-nav .nav-cta:hover {
  background: var(--highlight);
  color: var(--ink);
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  border-bottom-color: var(--c);
  background: none;
}

.threads {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.4rem;
  padding-bottom: 0.75rem;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.mode-toggle:not([hidden]) {
  display: inline-flex;
  height: 1.65rem;
  border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
}

.threads .mode-toggle button {
  border: 0;
  height: 100%;
  padding: 0 0.45rem;
}

.threads .mode-toggle button + button {
  border-left: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
}

.threads .mode-toggle button[aria-pressed='true'],
.threads .mode-toggle button[aria-pressed='true']:hover {
  background: var(--ink);
  color: var(--paper);
}

.threads .work-mode button:hover {
  background: var(--paper);
  color: var(--ink);
}

.threads .work-mode button[aria-pressed='true'],
.threads .work-mode button[aria-pressed='true']:hover {
  background: var(--ink);
  color: var(--paper);
}

body[data-mode='draft'] .thread-style,
body[data-mode='draft'] .thread-ground {
  display: none;
}

.threads .plan-field[hidden],
.threads .thread-download[hidden] {
  display: none;
}

.threads label,
.threads button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.thread-hue,
.thread-pick {
  cursor: pointer;
}

.thread-pick {
  position: relative;
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
  border-radius: 0;
  overflow: hidden;
}

.thread-face {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
  border-radius: 0;
  pointer-events: none;
}

.thread-hue-warp .thread-face {
  background-color: var(--weft);
  background-image: repeating-linear-gradient(
    90deg,
    var(--warp) 0 18%,
    transparent 18% 25%
  );
}

.thread-hue-weft .thread-face {
  background-color: var(--warp);
  background-image: repeating-linear-gradient(
    180deg,
    var(--weft) 0 18%,
    transparent 18% 25%
  );
}

.threads input[type='color'] {
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  opacity: 0;
  cursor: pointer;
}

.threads select {
  font: inherit;
  letter-spacing: inherit;
  height: 1.65rem;
  max-width: 6.4rem;
  padding: 0 0.15rem;
  border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.threads button {
  font: inherit;
  width: auto;
  height: 1.65rem;
  padding: 0 0.4rem;
  border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.threads button:hover {
  background: var(--highlight);
}

.plan-fields {
  display: contents;
}

.threads .plan-field input {
  font: inherit;
  letter-spacing: inherit;
  width: 3.4rem;
  height: 1.65rem;
  margin: 0;
  padding: 0 0.2rem;
  border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  appearance: textfield;
}

.threads .plan-field input::-webkit-outer-spin-button,
.threads .plan-field input::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.thread-download {
  position: relative;
}

.thread-download summary {
  font: inherit;
  letter-spacing: inherit;
  display: inline-flex;
  align-items: center;
  height: 1.65rem;
  padding: 0 0.35rem;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.thread-download summary::-webkit-details-marker {
  display: none;
}

.thread-download summary:hover {
  background: var(--highlight);
}

.thread-download summary {
  width: 1.65rem;
  padding: 0;
  justify-content: center;
  border: 0;
  background: none;
}

.thread-download summary svg {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
}

.thread-download div {
  position: absolute;
  z-index: 8;
  top: calc(100% + 0.15rem);
  right: 0;
  left: auto;
  display: grid;
  min-width: 4.6rem;
  background: var(--paper);
  border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
}

.thread-download div button {
  width: 100%;
  height: 1.65rem;
  margin: 0;
  padding: 0 0.45rem;
  border: 0;
  border-radius: 0;
  appearance: none;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
}

.thread-download div button:hover {
  background: var(--highlight);
}

.thread-download div button + button {
  border-top: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
}

@media (max-width: 720px) {
  .site-header {
    padding: 0.85rem 0 0.7rem;
    gap: 0.6rem 1rem;
  }

  .brand-name {
    font-size: 1.84rem;
  }

  .site-nav {
    gap: 0.35rem 0.9rem;
    font-size: 0.99rem;
  }

  .threads {
    padding-bottom: 0.6rem;
    font-size: 0.76rem;
  }

  .threads button,
  .threads select,
  .thread-download summary,
  .mode-toggle:not([hidden]) {
    height: 1.8rem;
  }

  .thread-pick {
    width: 1.7rem;
    height: 1.7rem;
  }

  .section-head {
    flex-wrap: wrap;
    align-items: flex-end;
  }

  .page-head h1 {
    font-size: clamp(2.1rem, 11vw, 3.2rem);
  }

  .threads .plan-field input {
    font-size: 1rem;
  }

  .threads {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.35rem;
    row-gap: 0.45rem;
    max-width: 100%;
  }

  .mode-toggle:not([hidden]) {
    order: 1;
  }

  .thread-hue-warp {
    order: 2;
    margin-left: auto;
  }

  .thread-hue-weft {
    order: 3;
  }

  .threads > button[data-swap] {
    order: 4;
  }

  .threads > button[data-reset] {
    order: 5;
  }

  .threads::after {
    content: '';
    order: 5;
    flex: 0 0 100%;
    height: 0;
  }

  .thread-style {
    order: 6;
  }

  .threads .plan-field {
    order: 6;
  }

  .thread-ground {
    order: 7;
  }

  .thread-download {
    order: 8;
  }

  .thread-download summary {
    width: 1.8rem;
  }

  body[data-landing='true'][data-mode='play'] .thread-download {
    margin-left: auto;
  }

  /* Plan on a phone: four inputs across the second row, names underneath. */

  body[data-landing='true'][data-mode='draft'] .plan-fields {
    display: flex;
    order: 6;
    flex: 0 1 60%;
    width: 60%;
    max-width: 60%;
    align-items: flex-start;
    gap: 0.35rem;
    min-width: 0;
  }

  body[data-landing='true'][data-mode='draft'] .thread-download {
    align-self: flex-start;
  }

  body[data-landing='true'][data-mode='draft'] .thread-download {
    margin-left: auto;
  }

  body[data-landing='true'][data-mode='draft'] .plan-fields .plan-field {
    flex: 1 1 0;
    flex-direction: column-reverse;
    align-items: center;
    gap: 0.12rem;
    min-width: 0;
    letter-spacing: 0;
    text-align: center;
    font-size: 0.62rem;
    line-height: 1.1;
  }

  body[data-landing='true'][data-mode='draft'] .plan-fields .plan-field input {
    width: 100%;
    min-width: 0;
    height: 1.8rem;
    padding: 0 0.1rem;
    text-align: center;
  }

  .threads select {
    max-width: 6.2rem;
  }

  .threads .mode-toggle button {
    padding: 0 0.3rem;
  }

  .segmented {
    flex-wrap: wrap;
  }

  .segmented label {
    flex: 1 1 4.5rem;
  }
}

/* footer */

.site-footer {
  margin-top: 6rem;
}

.selvedge {
  width: 100%;
  height: 22px;
  object-fit: cover;
  object-position: left center;
}

.footer-row {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
  font-size: 0.8rem;
}

.footer-row p {
  margin: 0;
}

/* home: hero + tapestry */

.hero,
#play-panel,
#draft-panel {
  min-width: 0;
  max-width: 100%;
}

.hero {
  padding-top: 2rem;
}

body[data-mode='draft'] .hero {
  padding-top: 0;
}

#draft-panel {
  padding-top: 2rem;
}

.hero-lede {
  margin: 0 0 1rem;
  max-width: 42rem;
  color: var(--muted);
}

.hero-line {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  width: 100%;
  max-width: 100%;
  margin: 0 0 0.75rem;
}

.hero-line textarea {
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 1.9rem;
  margin: 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--ink);
  padding: 0.25rem 0;
  resize: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: hidden;
}

.hero-line textarea:placeholder-shown:not(:focus) {
  padding-left: 0.7rem;
}

.hero-line:has(textarea:placeholder-shown:not(:focus))::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 1.05em;
  background: var(--ink);
  transform: translateY(-50%);
  animation: caret-blink 1.05s steps(1) infinite;
  pointer-events: none;
}

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

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

.hero-line textarea:focus {
  outline: none;
  border-bottom-color: var(--ink);
}

.tapestry {
  margin: 0;
  display: grid;
  justify-items: start;
  gap: 0.75rem;
}

.tapestry-canvas {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  overflow: hidden;
}

.tapestry-canvas canvas {
  cursor: var(--weave-cursor, crosshair);
  flex: 0 0 auto;
  align-self: center;
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent), 0 18px 40px -24px color-mix(in srgb, var(--ink) 50%, transparent);
  touch-action: pan-y;
}

.tapestry-canvas canvas:hover {
  cursor: none;
}

.tapestry-canvas canvas.is-link {
  cursor: pointer;
}

.readout-touch {
  display: none;
}

.tapestry .readout,
#draft-readout {
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.68rem;
  color: var(--muted);
  justify-content: flex-start;
  gap: 0.2rem 0.7rem;
}

.draft-canvas {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: flex;
  justify-content: flex-start;
  overflow-x: auto;
}

.draft-sheet {
  position: relative;
  flex: 0 0 auto;
  padding-right: 1.15rem;
}

.draft-tags {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.draft-tag {
  position: absolute;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--muted);
  white-space: nowrap;
}

.draft-tag--side {
  transform: rotate(90deg);
  transform-origin: top left;
}

.draft-canvas canvas {
  cursor: var(--weave-cursor, crosshair);
  flex: 0 0 auto;
  max-width: none;
  touch-action: none;
}

body[data-mode='draft'] .landing-key {
  display: none;
}

.landing-key {
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
}

/* Homepage key: one row when each tile can hold its letter, even rows when it cannot. */
.landing-key .key-grid {
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 0.7rem 0.4rem;
}

.landing-key .key-grid figure {
  min-width: 0;
  font-size: 0.75rem;
}

.landing-key .key-grid figcaption {
  display: block;
  margin-top: 0.28rem;
  line-height: 1;
  letter-spacing: 0;
}

@media (min-width: 980px) {
  .landing-key .key-grid {
    grid-template-columns: repeat(27, minmax(0, 1fr));
    gap: 0.45rem 0.2rem;
  }

  .landing-key .key-grid figure {
    font-size: 0.68rem;
  }
}

.key-note {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.readout {
  width: 100%;
  max-width: 60rem;
  font-size: 0.78rem;
  color: var(--federal);
  background: var(--paper-deep);
  border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent);
  padding: 0.45rem 0.75rem;
  min-height: 2.4em;
  display: flex;
  gap: 0.25rem 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.readout b {
  font-weight: 700;
  color: var(--ink);
}

.legend {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.25rem 0.65rem 0.25rem 0.35rem;
  border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  border-radius: 999px;
  background: var(--paper);
}

.chip i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c);
  background-image: radial-gradient(var(--paper) 0.8px, transparent 1px);
  background-size: 3px 3px;
}

.chip:hover,
.chip.is-active {
  background: var(--c);
  mix-blend-mode: multiply;
}

/* sections */

.section {
  padding-top: clamp(4rem, 9vw, 7rem);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
}

.section-head h2 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin: 0;
}

/* info page */

.about-copy {
  display: grid;
  gap: 1.15em;
  margin-top: 0.25rem;
}

.page-head .about-copy p {
  max-width: 38em;
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.475rem, 2.5vw, 1.825rem);
  line-height: 1.38;
}

.about-copy a {
  white-space: nowrap;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.14em;
  background-image: linear-gradient(transparent 68%, var(--highlight) 68%);
}

.about-press {
  margin-top: 2.75rem;
  padding-top: 1.15rem;
  border-top: 1px solid color-mix(in srgb, var(--ink) 45%, transparent);
  max-width: 100%;
}

.about-press-label {
  margin: 0 0 0.9rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: none;
  color: var(--ink);
}

.about-press ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
}

.about-press li {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  column-gap: 0.55rem;
  row-gap: 0.2rem;
  align-items: start;
  min-width: 0;
}

/* tiny 4x4 drawdown, same cell language as the favicon. each item has its own weave. */
.about-press-mark {
  grid-column: 1;
  grid-row: 1;
  display: block;
  width: 12px;
  height: 12px;
  margin-top: calc((0.78rem * 1.6 - 12px) / 2);
}

.about-press-mark .mark-up {
  fill: var(--ink);
}

.about-press-mark .mark-down {
  fill: var(--highlight);
}

.about-press span {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink);
  white-space: nowrap;
}

.about-press a {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  width: fit-content;
  max-width: none;
  min-width: 0;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: clamp(1.1375rem, 1.9vw, 1.3875rem);
  line-height: 1.25;
  color: var(--ink);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.14em;
  background-image: linear-gradient(transparent 68%, var(--highlight) 68%);
}

.about-press p {
  margin: 0;
}

.stitch-trail {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.selected-work {
  margin: 0 0 3.5rem;
  padding-top: clamp(2rem, 6vw, 4rem);
}

.tool-back {
  margin: 0 0 1.25rem;
  font-size: 0.8rem;
}

.page-head.tool-piece h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.tool-piece p a {
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.12em;
  background-image: linear-gradient(transparent 68%, var(--highlight) 68%);
}

.tool-piece .links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  margin-top: 1rem;
}

.tool-figure {
  max-width: 36rem;
  margin: 0.5rem 0 3rem;
}

/* cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.5rem;
}

.card {
  --c: var(--highlight);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-decoration: none;
  border-top: 6px solid var(--c);
  padding-top: 0.75rem;
}

.card:hover {
  background: none;
}

.card:hover h3 {
  background: var(--c);
  mix-blend-mode: multiply;
}

.card canvas {
  width: 100%;
  height: 72px;
  object-fit: cover;
  object-position: left top;
}

.card h3 {
  font-size: 1.7rem;
  margin: 0;
  display: inline;
}

.card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 0.7rem;
}

.tags li {
  border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent);
  padding: 0 0.4rem;
  border-radius: 3px;
}

/* hero extras */

.hero-side {
  display: grid;
  gap: 1.25rem;
}

.hero-ctas {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0;
}

/* teaching */

.teaching {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.teaching h2 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
}

.teaching-photo {
  margin: 0;
  transform: rotate(-1.5deg);
  max-width: 28rem;
}

.teaching-photo .riso-photo {
  aspect-ratio: 4 / 5;
  box-shadow: 0 24px 50px -30px color-mix(in srgb, var(--ink) 70%, transparent);
}

/* duotone: greyscale photo multiplied onto an ink, with a halftone screen on top */
.riso-photo {
  --c: var(--highlight);
  position: relative;
  overflow: hidden;
  background: var(--c);
  isolation: isolate;
}

.riso-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.35) brightness(1.08);
  mix-blend-mode: multiply;
  transition: filter 0.4s ease;
}

.riso-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 35%, transparent) 0.8px, transparent 1.2px);
  background-size: 4px 4px;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.riso-photo:hover img {
  filter: grayscale(0.2) contrast(1.1);
}

.teaching-photo figcaption {
  font-size: 0.72rem;
  margin-top: 0.5rem;
}

.formats {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  border-top: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
}

.formats li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  font-size: 0.85rem;
}

.formats span {
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 760px) {
  .teaching {
    grid-template-columns: 1fr;
  }
}

/* contact */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 2rem clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.contact h2 {
  font-size: clamp(2.6rem, 6vw, 5rem);
}

@media (max-width: 860px) {
  .contact {
    grid-template-columns: 1fr;
  }
}

.enquiry {
  display: grid;
  gap: 0.25rem;
  background: var(--card);
  padding: clamp(1rem, 3vw, 1.75rem);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 8%, transparent), 0 24px 50px -34px color-mix(in srgb, var(--ink) 70%, transparent);
}

.enquiry fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 0.75rem;
}

.enquiry label,
.enquiry legend {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--federal);
  margin-bottom: 0.35rem;
}

.enquiry p {
  margin: 0 0 0.6rem;
}

.enquiry input:not([type='radio']),
.enquiry textarea {
  width: 100%;
  font: inherit;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
  padding: 0.5rem 0.6rem;
  border-radius: 0;
}

.enquiry textarea {
  resize: vertical;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

@media (max-width: 520px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.enquiry .topics label {
  font-size: 0.82rem;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
}

.enquiry .topics input:checked + label {
  background: var(--c);
  color: var(--ink);
}

.enquiry-preview {
  background: var(--paper);
  margin: 0.25rem 0 0.75rem;
  min-height: 40px;
}

.enquiry-preview canvas {
  width: 100%;
  height: auto;
}

.enquiry-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.enquiry-actions span {
  font-size: 0.72rem;
}

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

/* work page */

body:has(#work-folio) {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

body:has(#work-folio) .site-chrome,
body:has(#work-folio) .site-footer {
  flex: 0 0 auto;
}

body:has(#work-folio) .site-footer {
  margin-top: 0;
}

body:has(#work-folio) main,
body:has(#work-folio) main > .wrap {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.work-folio {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.work-folio.is-chaos {
  padding-bottom: 0.35rem;
  overflow: hidden;
}

.work-filter {
  flex: 0 0 auto;
}

.work-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
  margin: 0 0 0.7rem;
}

.work-filter-tabs button,
.work-filter-drop select,
.wall-set h2,
.wall-tile button {
  font-family: var(--mono);
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
}

.work-filter-tabs button {
  font-size: 0.95rem;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0.2rem 0;
  cursor: pointer;
}

.work-filter-tabs button[aria-pressed='true'] {
  background-image: linear-gradient(transparent 68%, var(--highlight) 68%);
}

.work-filter-drop {
  display: none;
  margin: 0 0 0.7rem;
}

.work-filter-drop select {
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
  height: 2rem;
  padding: 0 0.4rem;
}

.work-scroll {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.work-wall {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  min-height: 0;
  gap: 0;
  overflow: visible;
}

.wall-set {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 0;
  padding: 0;
  gap: 0.08rem;
  min-width: 0;
  min-height: 0;
  overflow: visible;
}

.wall-set-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.4rem;
  row-gap: 0.22rem;
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  padding: 0.14rem 0 0.06rem;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.wall-mark {
  display: block;
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.wall-mark .mark-ink {
  fill: var(--ink);
}

.wall-mark .mark-hi {
  fill: var(--highlight);
}

.wall-set-name {
  flex: 0 0 auto;
  background-image: none;
}

.wall-set-rule {
  flex: 0 0 100%;
  display: block;
  width: 100%;
  height: 3px;
  min-width: 0;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 100% 2px;
  background-image: repeating-linear-gradient(to bottom, var(--ink) 0 2px, transparent 2px 16px);
}

.wall-set[data-set='jacquard'] .wall-set-rule {
  background-image: repeating-linear-gradient(to bottom, var(--ink) 0 2px, transparent 2px 22px);
}

.wall-set[data-set='toast-workroom'] .wall-set-rule {
  background-image: repeating-linear-gradient(to bottom, var(--ink) 0 5px, transparent 5px 11px);
}

.wall-set[data-set='studio'] .wall-set-rule {
  background-image: repeating-linear-gradient(
    to bottom,
    var(--ink) 0 2px,
    transparent 2px 6px,
    var(--ink) 6px 12px,
    transparent 12px 18px
  );
}

.wall-set[data-set='scarves'] .wall-set-rule {
  background-image: repeating-linear-gradient(
    to bottom,
    var(--ink) 0 2px,
    transparent 2px 5px,
    var(--ink) 5px 7px,
    transparent 7px 16px
  );
}

.wall-set[data-set='blankets'] .wall-set-rule {
  background-image: repeating-linear-gradient(
    to bottom,
    var(--ink) 0 6px,
    transparent 6px 10px,
    var(--ink) 10px 12px,
    transparent 12px 18px
  );
}

.wall-set[data-set='belts'] .wall-set-rule {
  background-image: repeating-linear-gradient(to bottom, var(--ink) 0 3px, transparent 3px 5px);
}

.wall-set[data-set='bags'] .wall-set-rule {
  background-image: repeating-linear-gradient(
    to bottom,
    var(--ink) 0 2px,
    transparent 2px 7px,
    var(--ink) 7px 9px,
    transparent 9px 11px,
    var(--ink) 11px 13px,
    transparent 13px 22px
  );
}

.wall-set[data-set='upholstery'] .wall-set-rule {
  background-image: repeating-linear-gradient(
    to bottom,
    var(--ink) 0 5px,
    transparent 5px 7px,
    var(--ink) 7px 12px,
    transparent 12px 18px
  );
}

.wall-set-label[aria-pressed='true'] .wall-set-name {
  background-image: linear-gradient(transparent 68%, var(--highlight) 68%);
}

.wall-set[hidden] {
  display: none !important;
}

.wall-set h2 {
  writing-mode: horizontal-tb;
  transform: none;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  margin: 0;
  color: var(--ink);
}

.wall-set-photos {
  display: flex;
  flex-flow: row wrap;
  align-items: flex-start;
  align-content: flex-start;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  gap: 3px;
  padding: 0;
  overflow: visible;
}

.wall-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.22rem;
  flex: 0 0 auto;
}

.wall-tile {
  margin: 0;
  min-width: 0;
  line-height: 0;
  flex: 0 0 auto;
  height: 30vh;
  position: relative;
  z-index: 0;
  overflow: visible;
}

.wall-tile button {
  display: block;
  width: auto;
  height: 30vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
}

.wall-tile img {
  display: block;
  width: auto;
  max-width: none;
  height: 30vh;
  vertical-align: top;
  filter: grayscale(0);
  -webkit-user-drag: none;
  user-select: none;
}

.work-wall:not(.is-chaos) .wall-tile {
  height: auto;
  overflow: visible;
}

.work-wall:not(.is-chaos) .wall-tile button,
.work-wall:not(.is-chaos) .wall-tile img {
  width: 100%;
  height: 100%;
  max-width: none;
}

.work-wall.is-focused .wall-tile.is-expanded {
  z-index: 4;
}

.work-wall.is-focused .wall-tile:not(.is-expanded) img {
  filter: grayscale(1);
}

.wall-hover {
  position: fixed;
  z-index: 40;
  margin: 0;
  padding: 0;
  border: 0;
  line-height: 0;
  background: none;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.5);
  transform-origin: center center;
  transition: opacity 240ms ease-out, transform 240ms ease-out;
}

.wall-hover.is-shown {
  opacity: 1;
}

.wall-hover[hidden] {
  display: none !important;
}

.wall-hover img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: fill;
  filter: none;
  background: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease-out;
}

.wall-hover img.is-live {
  opacity: 1;
}

.work-wall:not(.is-chaos) {
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  height: 100%;
  gap: 0.4rem;
  overflow: hidden;
}

.work-wall:not(.is-chaos) .wall-set {
  position: relative;
  align-self: stretch;
  height: auto;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  padding-left: 8px;
  overflow: hidden;
}

.work-wall:not(.is-chaos) .wall-set-label {
  position: static;
  flex-wrap: nowrap;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: 0.79rem;
}

.work-wall:not(.is-chaos) .wall-set-lead {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  column-gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.work-wall:not(.is-chaos) .wall-set-lead .wall-mark {
  flex: 0 0 auto;
  margin-top: 0.08rem;
}

.work-wall:not(.is-chaos) .wall-set-name {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
}

.work-wall:not(.is-chaos) .wall-set-rule {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  flex: none;
  width: 3px;
  height: auto;
  min-height: 0;
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 2px 100%;
}

.work-wall:not(.is-chaos) .wall-set-photos {
  flex: 1 1 0;
  flex-flow: column nowrap;
  align-items: flex-start;
  align-content: flex-start;
  justify-content: flex-start;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

.work-wall:not(.is-chaos) .wall-set.is-open .wall-set-photos {
  flex-flow: row nowrap;
  align-items: flex-start;
  align-content: flex-start;
  justify-content: flex-start;
}

.work-wall:not(.is-chaos) .wall-set.is-open .wall-col {
  gap: 3px;
  min-width: 0;
  height: auto;
}

.work-wall.is-chaos {
  flex-flow: row nowrap;
  align-items: stretch;
  height: 100%;
  width: max-content;
  gap: 0;
}

.work-wall.is-chaos .wall-set {
  flex-flow: row nowrap;
  align-items: stretch;
  height: 100%;
  gap: 0;
  padding: 0;
  border-top: 0;
  overflow: visible;
}

.work-wall.is-chaos .wall-set h2,
.work-wall.is-chaos .wall-set-label {
  display: none;
}

.work-wall.is-chaos .wall-set-photos {
  flex-flow: row nowrap;
  align-items: flex-start;
  align-content: flex-start;
  height: 100%;
  width: max-content;
  min-height: 0;
  gap: 0.22rem;
  padding: 0;
  overflow: visible;
}

.work-wall.is-chaos .wall-tile {
  height: auto;
  overflow: hidden;
  transform: none;
}

.work-wall.is-chaos .wall-tile button {
  width: 100%;
  height: auto;
}

.work-wall.is-chaos .wall-tile img {
  width: 100%;
  height: auto;
}

@media (max-width: 720px) {
  .work-filter-tabs {
    display: none;
  }

  .work-filter-drop {
    display: block;
  }
}

.work-index {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 1.5rem 2.5rem;
  align-items: start;
  min-width: 0;
  max-width: 100%;
  padding-top: clamp(2rem, 6vw, 4rem);
}

.work-index-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  position: sticky;
  top: 5.5rem;
  border-right: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
  padding-right: 1.25rem;
}

.work-index-stage {
  min-width: 0;
  max-width: 100%;
}

.work-index-nav button {
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.3;
  text-align: left;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0.28rem 0;
  cursor: pointer;
}

.work-index-nav button[aria-selected='true'] {
  background-image: linear-gradient(transparent 68%, var(--highlight) 68%);
}

.work-strip {
  display: flex;
  gap: 1.35rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 0.35rem;
}

.work-frame {
  flex: 0 0 auto;
  scroll-snap-align: start;
  margin: 0;
}

.work-frame img {
  display: block;
  height: clamp(220px, 46vh, 340px);
  width: auto;
  max-width: none;
  background: var(--paper-deep);
}

.work-frame figcaption {
  margin-top: 0.45rem;
  max-width: 16rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--ink);
}

@media (max-width: 640px) {
  .work-index {
    grid-template-columns: 9.5rem minmax(0, 1fr);
    gap: 1rem;
  }

  .work-index-nav {
    padding-right: 0.75rem;
  }
}

.page-head {
  padding-top: clamp(2rem, 6vw, 4rem);
}

.page-head h1 {
  font-size: clamp(3rem, 9vw, 7rem);
  margin: 0 0 1rem;
}

.page-head p {
  max-width: 42rem;
  color: var(--muted);
}

.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: clamp(2rem, 6vw, 4rem);
  margin: 0 0 0.5rem;
}

.filter {
  --c: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  cursor: pointer;
}

.filter[aria-pressed='true'] {
  background: var(--c);
  color: var(--paper);
  border-color: var(--c);
}

.project {
  --c: var(--warp);
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 1.5rem clamp(1.5rem, 4vw, 3rem);
  padding: 2.5rem 0;
  border-top: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
}

.project-strip {
  width: 64px;
  height: auto;
  align-self: start;
}

.project h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.project h2 span {
  background: linear-gradient(transparent 55%, var(--highlight) 55%);
}

.project .meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.project figure {
  margin: 0;
}

.project .placeholder {
  aspect-ratio: 4 / 3;
  background: var(--highlight);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 18%, transparent) 1.3px, transparent 1.5px);
  background-size: 6px 6px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  color: var(--ink);
}

.project .links {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  margin-top: 1rem;
}

.project[hidden] {
  display: none;
}

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

  .project-strip {
    width: 40px;
  }

  .project figure {
    grid-column: 2;
  }
}

.work-below {
  padding-bottom: 3rem;
}

.work-software {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.work-below .work-commissions {
  margin-top: 1.5rem;
}

.work-cta {
  border-top: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  padding-top: 3rem;
  text-align: center;
}

.work-commissions {
  margin-top: 4rem;
  padding: 2rem 1.5rem 2.25rem;
  background: var(--paper-deep);
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
}

.work-commissions h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin: 0 0 0.75rem;
}


.work-cta h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* weave a word page */

.studio {
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.studio .output {
  position: sticky;
  top: 7.5rem;
  align-self: start;
}

@media (max-width: 860px) {
  .studio {
    grid-template-columns: 1fr;
  }

  .studio .output {
    order: -1;
    position: static;
  }

  .studio .output-frame {
    max-height: 40vh;
  }
}

.controls {
  display: grid;
  gap: 1.1rem;
}

.controls label,
.controls legend {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--federal);
  margin-bottom: 0.35rem;
}

.controls fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.controls textarea,
.controls select,
.controls input[type='number'],
.controls input[type='file'] {
  width: 100%;
  font: inherit;
  background: var(--card);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
  padding: 0.5rem 0.6rem;
  border-radius: 0;
}

.controls input[type='number'] {
  width: 5.5rem;
}

.controls .check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.82rem;
  color: var(--ink);
  cursor: pointer;
}

.controls .check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--ink);
}

.download-menu {
  width: fit-content;
}

.download-menu summary {
  list-style: none;
  cursor: pointer;
}

.download-menu summary::-webkit-details-marker {
  display: none;
}

.download-menu div {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.download-menu .button {
  width: 100%;
  text-align: left;
}

.controls textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.swatches {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.swatches input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.swatches label {
  width: 28px;
  height: 28px;
  margin: 0;
  border-radius: 50%;
  background: var(--c);
  cursor: pointer;
  border: 2px solid transparent;
  outline: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
}

.swatches input:checked + label {
  border-color: var(--paper);
  outline: 2px solid var(--ink);
}

.swatches input:focus-visible + label {
  outline: 2px dashed var(--ink);
}

.segmented {
  display: flex;
  border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
}

.segmented label {
  flex: 1;
  margin: 0;
  text-align: center;
  padding: 0.35rem;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.82rem;
  color: var(--ink);
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented input:checked + label {
  background: var(--ink);
  color: var(--paper);
}

.segmented input:focus-visible + label {
  outline: 2px dashed var(--federal);
  outline-offset: -4px;
}

.buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.button {
  font: inherit;
  font-size: 0.82rem;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.button.ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.button:hover {
  background: var(--highlight);
  color: var(--ink);
  mix-blend-mode: normal;
}

.button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.output {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
}

.output-frame {
  width: 100%;
  overflow: auto;
  max-height: calc(100vh - 8rem);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  background: var(--paper-deep);
}

.output-frame canvas {
  flex: 0 0 auto;
  align-self: center;
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  box-shadow: 0 18px 40px -24px color-mix(in srgb, var(--ink) 50%, transparent);
}

.stats {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.key-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 0.75rem;
  margin-top: 0;
}

@media (max-width: 720px) {
  .tapestry .readout-hover {
    display: none;
  }

  .tapestry .readout-touch {
    display: inline;
  }

  .tapestry-canvas {
    overflow: hidden;
  }

  .tapestry-canvas canvas {
    max-width: 100%;
    height: auto;
  }

  .tapestry .readout,
  .readout {
    width: 100%;
    max-width: 100%;
  }

  .landing-key {
    padding-top: 1.75rem;
  }

  .key-grid {
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 0.4rem;
  }

  .key-grid figure {
    font-size: 0.68rem;
  }

  .about-copy a,
  .about-press a,
  .about-press span {
    white-space: normal;
  }

  .about-press {
    max-width: 100%;
  }

  .work-index,
  .work-index-stage,
  .cards,
  .section,
  main {
    min-width: 0;
    max-width: 100%;
  }
}

.key-grid figure {
  margin: 0;
  text-align: center;
  font-size: 0.75rem;
}

@media (max-width: 720px) {
  .key-grid figure {
    font-size: 0.68rem;
  }
}

body.alphabet-page .key-grid {
  grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr));
  gap: 0.85rem 0.55rem;
}

body.alphabet-page .key-grid figure {
  font-size: 0.72rem;
}

body.alphabet-page .key-grid figcaption {
  display: block;
  margin-top: 0.3rem;
  line-height: 1;
  letter-spacing: 0;
}

@media (max-width: 720px) {
  body.alphabet-page .key-grid {
    grid-template-columns: repeat(auto-fill, minmax(3.6rem, 1fr));
    gap: 0.6rem 0.35rem;
  }

  body.alphabet-page .key-grid figure {
    font-size: 0.68rem;
  }
}

.key-grid canvas {
  width: 100%;
  height: auto !important;
  outline: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
}

/* ASCII key only: hinted mono glyphs at the tile size, not a stretched bitmap. */
.key-ascii {
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  background: var(--weft);
  color: var(--ink);
  font-family: var(--mono);
  line-height: 1;
  text-rendering: optimizeSpeed;
  font-variant-ligatures: none;
  font-feature-settings: 'liga' 0, 'calt' 0;
  outline: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
}

.key-ascii span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  font-weight: 400;
  font-size: 4px;
  font-size: calc(100cqw / 12 * 0.72);
  font-size: max(1px, round(down, calc(100cqw / 12 * 0.72), 1px));
}

.key-ascii span[data-up] {
  font-weight: 400;
  font-size: 5px;
  font-size: calc(100cqw / 12);
  font-size: max(1px, round(down, calc(100cqw / 12), 1px));
}

/* shop */

.notice {
  border: 1px dashed var(--federal);
  padding: 1.25rem 1.5rem;
  max-width: 42rem;
  background: var(--highlight);
}

.notice p {
  margin: 0;
}

.product {
  display: grid;
  gap: 0.6rem;
}

.product .art {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--paper-deep);
  overflow: hidden;
}

.product .art canvas,
.product .art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product .art img.alt {
  opacity: 0;
}

.product:hover .art img.alt,
.product:focus .art img.alt,
.product:focus-within .art img.alt {
  opacity: 1;
}

.product h3 {
  font-size: 1.3rem;
  margin: 0;
}

.product .button {
  justify-self: start;
}

/* custom listing only. press-link highlight, a 4 by 4 weave, stitch-and-dot row. */
.product .product-contact {
  font: inherit;
  font-size: 0.68rem;
  line-height: 1.2;
  letter-spacing: 0.03em;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-grid;
  grid-template-columns: 12px auto;
  column-gap: 0.4rem;
  row-gap: 0.22rem;
  align-items: center;
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  text-align: left;
}

.product .product-contact::before {
  content: '';
  grid-column: 1;
  grid-row: 1;
  width: 12px;
  height: 12px;
  background: repeating-conic-gradient(var(--ink) 0% 25%, var(--highlight) 0% 50%) 0 0 / 6px 6px;
}

.product .product-contact span {
  grid-column: 2;
  grid-row: 1;
  background-image: linear-gradient(transparent 68%, var(--highlight) 68%);
}

.product .product-contact::after {
  content: '';
  grid-column: 1 / -1;
  grid-row: 2;
  height: 8px;
  background-image:
    radial-gradient(circle, var(--ink) 1.15px, transparent 1.35px),
    repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 16px);
  background-size: 16px 8px, 100% 2px;
  background-repeat: repeat-x, no-repeat;
  background-position: left center, left center;
}

.product .product-contact:hover,
.product .product-contact:focus-visible {
  background: none;
  color: var(--ink);
}

.product .product-contact:hover span,
.product .product-contact:focus-visible span {
  background-image: linear-gradient(transparent 55%, var(--highlight) 55%);
}

/* one contact card for the custom listing. weft and ink scrim, square slip of paper. */
.contact-card {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 1.25rem;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-family: var(--mono);
}

.contact-card:not([open]) {
  display: none;
}

.contact-card[open] {
  display: grid;
  place-items: center;
  overflow: auto;
}

.contact-card::backdrop {
  background-color: color-mix(in srgb, var(--ink) 18%, var(--weft));
  background-image: repeating-conic-gradient(
    color-mix(in srgb, var(--ink) 28%, var(--weft)) 0% 25%,
    color-mix(in srgb, var(--ink) 10%, var(--weft)) 0% 50%
  );
  background-size: 12px 12px;
}

.contact-card-scrim {
  position: fixed;
  inset: 0;
  z-index: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: color-mix(in srgb, var(--ink) 18%, var(--weft));
  background-image: repeating-conic-gradient(
    color-mix(in srgb, var(--ink) 28%, var(--weft)) 0% 25%,
    color-mix(in srgb, var(--ink) 10%, var(--weft)) 0% 50%
  );
  background-size: 12px 12px;
}

.contact-card-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 15.5rem);
  padding: 0.8rem 0.85rem 0.9rem;
  display: grid;
  gap: 0.7rem;
  background: var(--weft);
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  box-shadow: none;
  font: inherit;
}

.contact-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.contact-card-weave {
  width: 12px;
  height: 12px;
  background: repeating-conic-gradient(var(--ink) 0% 25%, var(--highlight) 0% 50%) 0 0 / 6px 6px;
}

.contact-card-close {
  position: relative;
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.contact-card-close span {
  width: 8px;
  height: 8px;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 100% 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 1px 100% no-repeat;
  transform: rotate(45deg);
}

.contact-card-close:hover,
.contact-card-close:focus-visible {
  background: var(--highlight);
}

.contact-card-id {
  display: grid;
  gap: 0.22rem;
}

.contact-card-name {
  margin: 0;
  width: fit-content;
  font: inherit;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0.03em;
  color: var(--ink);
  background-image: linear-gradient(transparent 68%, var(--highlight) 68%);
}

.contact-card-stitch {
  display: block;
  height: 8px;
  background-image:
    radial-gradient(circle, var(--ink) 1.15px, transparent 1.35px),
    repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 16px);
  background-size: 16px 8px, 100% 2px;
  background-repeat: repeat-x, no-repeat;
  background-position: left center, left center;
}

.contact-card-links {
  display: grid;
  gap: 0.4rem;
}

.contact-card-links a {
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--ink);
  width: fit-content;
  max-width: 100%;
}

.contact-card-email {
  display: grid;
  gap: 0.08rem;
}

.contact-card-address {
  font-size: 0.68rem;
  overflow-wrap: anywhere;
}

.product .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
}

.status {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: var(--highlight);
  padding: 0 0.4rem;
}

/* 404 */

.lost {
  display: grid;
  justify-items: center;
  text-align: center;
  padding-top: 4rem;
  gap: 1.5rem;
}

.lost canvas {
  width: min(100%, 420px);
}

.thread-strip {
  width: 100%;
  overflow: auto;
  background: var(--paper-deep);
  padding: 0.4rem;
}

.thread-strip canvas {
  height: 72px;
  width: auto;
}

.note {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.commission-list {
  margin: 0.6rem 0 1.25rem;
  padding: 0;
  list-style: none;
}

.commission-list li {
  padding: 0.12rem 0;
}

.commission-list li::before {
  content: '▞ ';
  color: var(--muted);
}

.photo-todo {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  background: var(--highlight);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 18%, transparent) 1px, transparent 1.2px);
  background-size: 7px 7px;
  font-size: 0.78rem;
  color: var(--muted);
}

.commission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem;
}

.commission-grid figure {
  margin: 0;
}

.commission-grid img {
  width: 100%;
  height: auto;
  display: block;
}

.commission-grid figcaption {
  font-size: 0.75rem;
  margin-top: 0.4rem;
}

.video-block {
  margin: 1.5rem 0 0;
}

.video {
  aspect-ratio: 16 / 9;
  background: var(--paper-deep);
}

.video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-block figcaption,
.key-photo figcaption {
  font-size: 0.75rem;
  margin-top: 0.4rem;
}

.key-photo {
  margin: 0 0 1.5rem;
}

.key-photo img {
  width: min(100%, 28rem);
  height: auto;
}

.file-pick {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.file-pick input[type='file'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
  background: none;
}

.file-pick-btn {
  pointer-events: none;
}

.file-pick-name {
  font-size: 0.82rem;
  color: var(--muted);
}

.file-pick:focus-within .file-pick-btn {
  background: var(--highlight);
  color: var(--ink);
}

.pick-glass {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  pointer-events: none;
  z-index: 30;
  display: block;
}

/* boot: one letter from the clean-twills key, woven until the page is ready */

html.is-loading {
  overflow: hidden;
}

html.is-loading main,
html.is-loading .site-footer {
  visibility: hidden;
}

#weave-loader {
  position: fixed;
  z-index: 80;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  margin: 0;
  background: var(--weft, #f3eee4);
}

#weave-loader canvas {
  width: min(52vw, 10.5rem);
  height: min(52vw, 10.5rem);
  background: var(--weft, #f3eee4);
}


/* loom notes: readable index, chapters stay in view */

body.loom-notes .work-mode {
  display: none;
}

body.loom-notes {
  --wrap: 1240px;
}

.loom-shell {
  display: grid;
  grid-template-columns: minmax(13.5rem, 17rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.25rem);
  align-items: start;
  padding-top: clamp(1.4rem, 4vw, 2.6rem);
  padding-bottom: 4rem;
}

.loom-index {
  position: sticky;
  top: 6.4rem;
  padding-bottom: 1rem;
}

.loom-index-kicker,
.loom-kicker {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
}

.loom-index-lead {
  margin: 0 0 1.1rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

.loom-chapters {
  display: grid;
  gap: 0.2rem;
}

.loom-chapters a {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
  padding: 0.45rem 0.35rem;
  text-decoration: none;
  color: inherit;
  background: none;
}

.loom-chapters a:hover,
.loom-chapters a[aria-current='page'] {
  background: color-mix(in srgb, var(--ink) 6%, var(--paper));
}

.loom-chapters a[aria-current='page'] {
  box-shadow: inset 2px 0 0 var(--ink);
}

.loom-mark {
  display: block;
  width: 12px;
  height: 12px;
  margin-top: 0.28rem;
}

.loom-mark .mark-up {
  fill: var(--ink);
}

.loom-mark .mark-down {
  fill: var(--highlight);
}

.loom-chapters strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.2;
}

.loom-chapters em {
  display: block;
  margin-top: 0.12rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-style: normal;
  color: var(--muted);
  line-height: 1.35;
}

.loom-article {
  min-width: 0;
  max-width: 42rem;
}

.loom-hero {
  margin-bottom: 1.6rem;
}

.loom-article h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.05;
}

.loom-hero p,
.loom-article p,
.loom-article li {
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.5;
}

.loom-article h2 {
  margin: 2.1rem 0 0.7rem;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.12em;
}

.loom-article h3 {
  margin: 1.4rem 0 0.45rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
}

.loom-article p,
.loom-article ul,
.loom-article ol {
  margin: 0 0 0.9rem;
}

.loom-article ul,
.loom-article ol {
  padding-left: 1.2rem;
}

.loom-article a {
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.14em;
  background-image: linear-gradient(transparent 68%, var(--highlight) 68%);
}

.loom-article code {
  font-size: 0.82em;
}

.loom-plain {
  padding: 0.7rem 0.85rem;
  background: color-mix(in srgb, var(--ink) 5%, var(--paper));
}

.loom-status {
  display: grid;
  gap: 0;
  margin: 0 0 1.6rem;
  border-top: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
}

.loom-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  font-size: 0.86rem;
}

.loom-status-row .is-yes {
  color: var(--ink);
}

.loom-status-row .is-no {
  color: var(--muted);
  font-weight: 400;
}

.loom-cards {
  list-style: none;
  margin: 0 0 1.6rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.loom-cards a {
  display: block;
  padding: 0.85rem 0.95rem;
  background-image: none;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  text-decoration: none;
}

.loom-cards a:hover {
  background: color-mix(in srgb, var(--ink) 5%, var(--paper));
}

.loom-cards strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 0.3rem;
}

.loom-cards span {
  display: block;
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.45;
  color: var(--muted);
}

.loom-facts {
  padding-left: 1.2rem;
}

.loom-note {
  padding: 0.75rem 0.9rem;
  border-left: 2px solid var(--ink);
}

.loom-onpage {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0 0 1.4rem;
  font-size: 0.75rem;
}

.loom-onpage a {
  background-image: none;
}

.loom-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.loom-timeline > li {
  position: relative;
  padding: 0 0 1.5rem 1.15rem;
  border-left: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
}

.loom-timeline > li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.loom-timeline h3 {
  margin-top: 0;
}

.loom-timeline h3 span {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.loom-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.1rem;
  font-size: 0.82rem;
}

.loom-article th,
.loom-article td {
  text-align: left;
  vertical-align: top;
  padding: 0.45rem 0.55rem 0.45rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
}

.loom-article th {
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.loom-flow {
  margin: 0 0 1.3rem;
  padding-left: 1.2rem;
}

.loom-flow li + li {
  margin-top: 0.55rem;
}

.loom-stack {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 1.3rem;
}

.loom-stack-block {
  padding: 0.75rem 0.85rem;
  background: color-mix(in srgb, var(--ink) 5%, var(--paper));
}

.loom-stack-block span,
.loom-stack-block small {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.loom-stack-block b {
  display: block;
  margin: 0.2rem 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
}

.loom-stack-arrow {
  margin: 0;
  padding-left: 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.loom-stack-arrow::before {
  content: '↓ ';
}

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

  .loom-index {
    position: static;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
    margin-bottom: 0.4rem;
  }

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

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

/* notes: strips in the wide column, tools as a side list */

.notes-page {
  min-width: 0;
  overflow-x: clip;
}

.notes-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.5fr) minmax(12rem, 1fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: start;
  padding-top: clamp(2rem, 6vw, 4rem);
  padding-bottom: 4rem;
  min-width: 0;
}

.notes-strips,
.notes-tools,
.note-article,
.note-copy,
.note-mast-copy {
  min-width: 0;
}

.notes-strips::after {
  content: '';
  display: block;
  height: 8px;
  background-image:
    radial-gradient(circle, var(--ink) 1.15px, transparent 1.35px),
    repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 16px);
  background-size: 16px 8px, 100% 2px;
  background-repeat: repeat-x, no-repeat;
  background-position: left center, left center;
}

.note-strip > a {
  display: grid;
  grid-template-columns: minmax(4.75rem, 7.25rem) minmax(0, 1fr);
  column-gap: 0.8rem;
  row-gap: 0.45rem;
  align-items: start;
  padding: 0.55rem 0 0.8rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.note-strip > a:hover {
  background: none;
}

.note-rule {
  display: block;
  height: 8px;
  grid-column: 1 / -1;
  background-repeat: repeat-x, no-repeat;
  background-position: left center, left center;
}

.note-rule--twill {
  background-image:
    radial-gradient(circle, var(--ink) 1.15px, transparent 1.35px),
    repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 16px);
  background-size: 16px 8px, 100% 2px;
}

.note-rule--checker {
  background-image:
    radial-gradient(circle, var(--ink) 1.15px, transparent 1.35px),
    repeating-linear-gradient(90deg, var(--ink) 0 5px, transparent 5px 11px);
  background-size: 11px 8px, 100% 2px;
}

.note-rule--satin {
  background-image:
    radial-gradient(circle, var(--ink) 1.15px, transparent 1.35px),
    repeating-linear-gradient(
      90deg,
      var(--ink) 0 2px,
      transparent 2px 6px,
      var(--ink) 6px 12px,
      transparent 12px 18px
    );
  background-size: 18px 8px, 100% 2px;
}

.note-rule--ticks {
  background-image:
    radial-gradient(circle, var(--ink) 1.15px, transparent 1.35px),
    repeating-linear-gradient(90deg, var(--ink) 0 3px, transparent 3px 5px);
  background-size: 10px 8px, 100% 2px;
}

.note-photo {
  margin: 0;
  min-width: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.note-strip .note-photo {
  aspect-ratio: 1 / 1;
}

.note-photo img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
}

.note-photo--mark {
  background: var(--highlight);
  display: grid;
  place-items: center;
}

.adacad-mark {
  display: block;
  width: 58%;
  height: 78%;
  background: var(--ink);
  -webkit-mask: url("/images/notes/adacad-mark.svg") center / contain no-repeat;
  mask: url("/images/notes/adacad-mark.svg") center / contain no-repeat;
}

.note-photo--loom img {
  object-position: center 30%;
}

.note-photo--room img {
  object-position: center 68%;
}

.note-photo--key img {
  object-position: 18% center;
}

.note-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.45rem;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.note-mark {
  display: block;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.note-mark .mark-up,
.note-draft .mark-up {
  fill: var(--ink);
}

.note-mark .mark-down,
.note-draft .mark-down {
  fill: var(--highlight);
}

.note-strip h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.1rem, 1.3vw, 1.35rem);
  line-height: 1.05;
}

.note-strip h2 span,
.note-article h1 span,
.notes-pointer a {
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.12em;
  background-image: linear-gradient(transparent 68%, var(--highlight) 68%);
}

.note-strip > a:hover h2 span,
.notes-pointer a:hover {
  background-color: var(--highlight);
}

.note-copy > p {
  max-width: 38em;
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.35;
}

.note-copy > .note-meta {
  max-width: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.2;
}

.notes-tools {
  padding-top: 0.15rem;
}

.notes-tools h2 {
  margin: 0 0 0.55rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1;
}

.notes-tools .note-rule {
  margin-bottom: 0.95rem;
}

.notes-tools ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.35rem;
}

.notes-tools a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
}

.notes-tools a:hover {
  background: none;
}

.notes-tools canvas {
  width: auto;
  max-width: 100%;
  height: auto;
}

.notes-tools .tool-name {
  max-width: 100%;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.25;
}

.notes-tools .tool-name span {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.12em;
  background-image: linear-gradient(transparent 68%, var(--highlight) 68%);
}

.notes-tools a:hover .tool-name span {
  background-color: var(--highlight);
}

.page-head.note-article {
  max-width: none;
  padding-bottom: 4rem;
}

.page-head.note-article h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.2rem, 1.6vw, 1.55rem);
  line-height: 1.05;
}

.note-mast-grid {
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr);
  gap: 0.85rem 1.35rem;
  align-items: start;
  min-width: 0;
}

.page-head.note-article .note-summary {
  max-width: 38em;
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.4;
}

.note-draft {
  display: block;
  width: 9.5rem;
  max-width: 100%;
  height: auto;
  margin-top: 0.95rem;
}

.note-article .about-copy {
  margin-top: 1.5rem;
  padding-top: 1.05rem;
  background-image: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 16px);
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: left top;
}

.page-head.note-article .about-copy p {
  font-size: 1.02rem;
}

.note-article .about-copy ol,
.note-article .about-copy ul {
  max-width: 38em;
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.38;
}

.note-article .about-copy li + li {
  margin-top: 0.45rem;
}

.note-article .about-copy a,
.note-article .note-summary a,
.note-article .tool-back a {
  white-space: normal;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.12em;
  background-image: linear-gradient(transparent 68%, var(--highlight) 68%);
}

.notes-page button,
.notes-page input,
.notes-page select,
.note-article button,
.note-article input,
.note-article select,
.note-article code,
.notes-pointer {
  font: inherit;
}

.notes-pointer {
  padding-top: clamp(2rem, 6vw, 4rem);
}

.note-kicker {
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.page-head.note-article .about-copy p.note-kicker {
  max-width: 38em;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.note-flow {
  margin: 1.15rem 0 0;
  max-width: 40rem;
  display: grid;
  gap: 0.4rem;
}

.note-flow .note-kicker,
.note-flow-aside,
.note-flow-back,
.note-flow-box p,
.note-flow-row li {
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.35;
}

.note-flow-row {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.2rem, 1fr));
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}

.note-flow-row li,
.note-flow-box,
.note-flow-aside,
.note-flow-back {
  padding: 0.4rem 0.5rem;
  background: var(--highlight);
}

.note-flow .note-rule {
  margin: 0.1rem 0;
}

.note-warp {
  margin: 1.15rem 0 0;
  max-width: 38em;
}

.note-warp-picks {
  --stitch: 1.15rem;
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.note-warp-pick {
  position: relative;
  display: grid;
  grid-template-columns: var(--stitch) minmax(0, 1fr);
  column-gap: 0.85rem;
  align-items: start;
  padding-bottom: 1.2rem;
}

.note-warp-pick:last-child {
  padding-bottom: 0;
}

.note-warp-pick::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--stitch);
  background-image:
    linear-gradient(var(--ink), var(--ink)),
    linear-gradient(var(--ink), var(--ink)),
    linear-gradient(var(--ink), var(--ink));
  background-size: 2px 100%, 2px 100%, 2px 100%;
  background-position: left top, center top, right top;
  background-repeat: no-repeat;
}

.note-warp-pick:first-child::before {
  top: 0.12rem;
}

.note-warp-pick:last-child::before {
  bottom: auto;
  height: calc(0.12rem + var(--stitch));
}

.note-warp-stitch {
  position: relative;
  z-index: 1;
  display: block;
  width: var(--stitch);
  height: var(--stitch);
  margin-top: 0.12rem;
}

.note-warp-stitch::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: calc(100% + 0.4rem);
  height: 2px;
  background: var(--ink);
  transform: translateY(-50%);
}

.note-warp-stitch::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.62rem;
  height: 0.62rem;
  background: var(--ink);
  transform: translate(-50%, -50%);
}

.note-warp-pick--gap .note-warp-stitch::after {
  background: var(--highlight);
  border: 1.5px solid var(--ink);
}

.note-warp-label,
.note-warp-label p {
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.35;
}

.note-warp-label p + p {
  margin-top: 0.1rem;
}

.note-warp-pick--gap .note-warp-step {
  background-image: linear-gradient(transparent 68%, var(--highlight) 68%);
}

.note-stills {
  list-style: none;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin: 1.35rem 0 0;
  padding: 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

.note-stills li {
  margin: 0;
  flex: 0 0 auto;
}

.note-stills img {
  display: block;
  height: clamp(200px, 36vh, 280px);
  width: auto;
  max-width: none;
  filter: grayscale(1) contrast(1.05);
}

@media (max-width: 720px) {
  .notes-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.25rem;
  }

  .note-strip > a {
    grid-template-columns: 4.5rem minmax(0, 1fr);
    column-gap: 0.65rem;
  }

  .notes-tools {
    padding-top: 0.35rem;
  }

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

  .note-article .note-photo {
    aspect-ratio: 4 / 3;
    max-width: 28rem;
  }
}

/* 12 dimensions: full pictures, no crop */
.note-article--12d .note-mast-grid {
  grid-template-columns: minmax(0, 1fr);
}

.note-article--12d .note-summary + .note-summary {
  margin-top: 0.7rem;
}

.note-article--12d .note-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  margin-top: 1.15rem;
  min-width: 0;
}

.note-article--12d .note-full {
  margin: 0;
  min-width: 0;
}

.note-article--12d .note-full img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  filter: grayscale(1) contrast(1.05);
}

@media (max-width: 720px) {
  .note-article--12d .note-pair {
    grid-template-columns: minmax(0, 1fr);
  }
}

.note-strip .note-photo--key {
  aspect-ratio: auto;
  overflow: visible;
}

.note-strip .note-photo--key img {
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
}

.note-path {
  margin: 1.35rem 0 0;
  max-width: 38em;
  overflow-x: auto;
}

.note-path-steps {
  --stitch: 1.15rem;
  list-style: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(max-content, 1fr);
  margin: 0.75rem 0 0;
  padding: 0;
}

.note-path-step {
  position: relative;
  display: grid;
  grid-template-rows: var(--stitch) auto;
  row-gap: 0.55rem;
  align-items: start;
  justify-items: start;
  min-width: 0;
  padding-right: 0.9rem;
}

.note-path-step:last-child {
  padding-right: 0;
}

.note-path-step::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  right: 0;
  height: var(--stitch);
  background-image:
    linear-gradient(var(--ink), var(--ink)),
    linear-gradient(var(--ink), var(--ink)),
    linear-gradient(var(--ink), var(--ink));
  background-size: 100% 2px, 100% 2px, 100% 2px;
  background-position: left top, left center, left bottom;
  background-repeat: no-repeat;
}

.note-path-step:last-child::before {
  right: auto;
  width: var(--stitch);
}

.note-path-stitch {
  position: relative;
  z-index: 1;
  display: block;
  width: var(--stitch);
  height: var(--stitch);
}

.note-path-stitch::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: calc(100% + 0.4rem);
  background: var(--ink);
  transform: translateX(-50%);
}

.note-path-stitch::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.62rem;
  height: 0.62rem;
  background: var(--ink);
  transform: translate(-50%, -50%);
}

.note-path-step--gap .note-path-stitch::after {
  background: var(--highlight);
  border: 1.5px solid var(--ink);
}

.note-path-label,
.note-path-label p {
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.35;
}

.note-path-label p + p {
  margin-top: 0.1rem;
}

.note-path-step--gap .note-path-label p:first-child {
  width: fit-content;
  background-image: linear-gradient(transparent 68%, var(--highlight) 68%);
}
