@font-face {
  font-family: "Open Sans";
  src: url("ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("ExtraBoldItalic.woff2") format("woff2");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}
:root {
  color-scheme: light dark;
  --paper: #f7f2e6;
  --ink: #193f35;
  --clay: #a43b26;
  --ochre: #e4ba71;
  --line: #b8baaa;
  --soft: #eae7d9;
  --focus: #005fd4;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 800 1rem/1.5 "Open Sans", Arial, sans-serif;
  font-synthesis: none;
}
button, output { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: .48; cursor: default; }
a { color: inherit; text-decoration-thickness: .1em; text-underline-offset: .2em; }
a:hover, summary:hover { color: var(--clay); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip { position: fixed; top: 0; left: 1rem; z-index: 5; padding: .8rem; background: var(--paper); transform: translateY(-130%); }
.skip:focus { transform: none; }
.masthead, main { width: min(92%, 1280px); margin-inline: auto; }
.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1.1rem .85rem; border-bottom: 3px solid var(--ink); font-size: .88rem;
}
.brand { display: inline-flex; align-items: center; gap: .65rem; }
.brand span { font-size: 1.45rem; }
main {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  grid-template-areas: "intro board" "palette board";
  grid-template-rows: auto 1fr; align-items: start;
  gap: 1.5rem clamp(2rem, 5vw, 5rem); padding-block: 2rem 3rem;
}
.intro { grid-area: intro; }
h1 { margin: 0 0 1.15rem; font-size: clamp(2.6rem, 4.4vw, 4.8rem); line-height: 1.04; font-style: italic; }
h1 span { display: block; color: var(--clay); font-size: 1.55em; }
.lead { max-width: 34ch; margin: 0 0 .75rem; font-size: clamp(1rem, 1.3vw, 1.22rem); line-height: 1.45; }
.editorial, .social { margin: 0; font-size: .84rem; line-height: 1.65; }
.editorial { max-width: 46ch; }
.editorial a { color: var(--clay); }
.board { grid-area: board; min-width: 0; }
.frame {
  padding: clamp(10px, 1.4vw, 22px); background: var(--ochre);
  border: 1px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
}
.viewport { aspect-ratio: 1; overflow: auto; background: white; overscroll-behavior: contain; }
.drawing { width: 100%; position: relative; background: white; }
.original { display: block; width: 100%; height: auto; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: manipulation; }
canvas:focus-visible { outline-offset: -4px; }
#cursor {
  position: absolute; display: none; pointer-events: none; left: 50%; top: 50%;
  width: 16px; height: 16px; transform: translate(-50%, -50%); border: 2px solid #111;
  border-radius: 50%; box-shadow: 0 0 0 2px white;
}
canvas:focus-visible + #cursor { display: block; }
.sheet-tools { display: flex; gap: 1rem; justify-content: space-between; margin-block: 1rem .65rem; }
.scale, .actions { display: flex; align-items: center; gap: .25rem; }
.scale { border: 1px solid var(--line); }
.scale button, .actions button {
  background: transparent; border: 0; min-width: 44px; min-height: 44px;
}
.scale button { font-size: 1.2rem; }
.scale output { min-width: 4ch; text-align: center; font-size: .81rem; }
#save { border: 0; background: var(--ink); color: var(--paper); padding: .65rem 1rem; min-height: 46px; }
#save span { margin-left: .55rem; }
#save:hover:enabled { background: var(--clay); }
.palette { grid-area: palette; min-width: 0; border-top: 2px solid var(--ink); }
.palette::before {
  content: ""; display: block; height: 20px; margin-block: .55rem .9rem;
  background: url("cenefa.png") repeat-x left center / auto 20px;
}
h2 { margin: 0 0 .6rem; font-size: 1.45rem; line-height: 1.2; }
#swatches { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 1px; }
.chip { border: 0; background: transparent; padding: 4px; min-height: 48px; }
.chip span {
  display: block; height: 40px; background: var(--c); border: 1px solid #0004;
  border-radius: 50% 50% 2px 2px; position: relative;
}
.chip[aria-pressed="true"] span { outline: 2px solid var(--ink); outline-offset: 1px; }
.chip[aria-pressed="true"] span::after {
  content: ""; position: absolute; bottom: 6px; left: calc(50% - 3px);
  width: 6px; height: 6px; border-radius: 50%; background: white; box-shadow: 0 0 0 1px #222;
}
.selection { display: flex; align-items: center; gap: .6rem; font-size: .88rem; margin: .7rem 0; }
#sample { width: 15px; height: 15px; border-radius: 50%; border: 1px solid #0005; }
.actions { border-block: 1px solid var(--line); }
.actions button { padding-inline: .65rem; }
.actions button:hover:enabled, .scale button:hover:enabled { background: var(--soft); }
#status, details { font-size: .78rem; }
#status { min-height: 1.5em; margin: .65rem 0 0; }
summary { cursor: pointer; padding-block: .7rem; min-height: 44px; }
details p { max-width: 52ch; margin: 0 0 .7rem; }
@media (max-width: 799px) {
  main, .masthead { width: min(92%, 620px); }
  .masthead { font-size: .75rem; }
  main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "board" "palette"; gap: 1rem; padding-block: 1.3rem env(safe-area-inset-bottom, 0px); }
  h1 { font-size: clamp(1.95rem, 6vw, 3.3rem); }
  h1 span { display: inline; font-size: inherit; }
  .palette { position: sticky; bottom: 0; z-index: 1; background: var(--paper); padding: .5rem 0 max(.25rem, env(safe-area-inset-bottom)); }
  .palette::before { display: none; }
  .palette h2 { display: inline; font-size: 1rem; }
  #swatches { display: flex; overflow-x: auto; scrollbar-width: thin; }
  .chip { flex: 1 0 44px; }
  .chip span { height: 33px; }
  .selection { margin: .25rem 0; }
  .actions { float: right; border: 0; font-size: .78rem; }
  #status { margin-top: .35rem; }
  details[open] { clear: both; }
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #192820; --ink: #f6efdd; --clay: #ffad90; --ochre: #997443; --line: #788776; --soft: #34483b; --focus: #78caff; }
  .palette::before { filter: brightness(0) invert(90%); }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .chip span { transition: transform 120ms ease-out; }
  .chip:hover span { transform: translateY(-2px); }
}
