@font-face {
  font-family: Space Grotesk;
  src: url('/type/space-grotesk.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: IBM Plex Mono;
  src: url('/type/plex-mono.woff2') format('woff2');
  font-display: swap;
}
:root {
  color-scheme: dark;
  background: #15121c;
  color: #f6edf5;
  font: 400 1rem/1.51 Space Grotesk, system-ui, sans-serif;
  --bg: #15121c;
  --board: #211a2b;
  --panel: #1c1724;
  --high: #f6edf5;
  --muted: #c2b2c8;
  --line: #59475d;
  --accent: #f4ccff;
  --warm: #ffb494;
  --mono: IBM Plex Mono, ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1,h2,p,figure { margin: 0; }
button,input,select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .21em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(100% - 82px, 1320px); margin-inline: auto; }
.skip { position: absolute; z-index: 3; top: 8px; left: 8px; transform: translateY(-160%); background: var(--accent); color: var(--bg); padding: 8px 14px; }
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nav-bar { border-bottom: 1px solid var(--line); }
.bar-content,.footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bar-content { min-height: 70px; }
.wordmark { display: inline-flex; gap: 8px; align-items: center; text-decoration: none; color: var(--high); font-size: 1.36rem; line-height: 1; letter-spacing: -.055em; font-weight: 650; }
.wordmark img { border-radius: 50%; }
nav { display: flex; align-items: center; gap: clamp(10px, 2.9vw, 32px); }
nav a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; font-size: .91rem; color: var(--muted); }
nav a[aria-current] { color: var(--high); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 22px; padding-block: clamp(24px,3.7vw,49px) 21px; }
.intro h1,.reading h1 { font-size: clamp(3.55rem,8.2vw,8.8rem); letter-spacing: -.078em; line-height: .89; font-weight: 590; }
.intro p,.reading header p { font-size: clamp(.99rem,1.47vw,1.18rem); color: var(--muted); max-width: 38ch; }
#editor { scroll-margin-top: 12px; }
.workbench { display: grid; grid-template-columns: minmax(0,2.15fr) minmax(320px,1fr); border: 1px solid var(--line); }
.preview-panel { min-width: 0; display: flex; flex-direction: column; background: var(--board); border-right: 1px solid var(--line); }
.toolbar,.transport { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 18px; }
.screen-data,.transport output { color: var(--muted); font: .74rem/1.3 var(--mono); white-space: nowrap; }
.toggle { display: flex; gap: 6px; }
.toggle button,.form-options button,.primary-exports button,.text-button,.play,.primary { min-height: 37px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--high); cursor: pointer; font-weight: 610; font-size: .84rem; line-height: 1.15; }
.toggle button:hover,.form-options button:hover,.primary-exports button:hover,.play:hover { border-color: var(--accent); }
.toggle button[aria-pressed='true'],.form-options button[aria-pressed='true'] { background: #f4ccff1c; border-color: #d6addd; color: var(--accent); }
#screen { display: grid; align-items: center; flex: 1; position: relative; min-width: 0; background: #120e17; border-block: 1px solid var(--line); }
.screen-wrap { width: 100%; max-width: 100%; aspect-ratio: 16/9; margin-inline: auto; }
.screen-wrap[data-ratio='square'] { aspect-ratio: 1; width: min(100% - 24px, 474px); }
.screen-wrap[data-ratio='tall'] { aspect-ratio: 9/16; width: min(100% - 24px, 273px); }
#preview,.seam-grid canvas { display: block; width: 100%; height: 100%; }
.transport { justify-content: start; padding-block: 10px 13px; }
.transport output { min-width: 10ch; text-align: right; }
.play { min-width: 68px; }
input[type='range'] { min-width: 0; width: 100%; margin: 0; cursor: pointer; accent-color: var(--accent); height: 25px; }
#seam { flex: 1; display: grid; align-content: center; padding: 13px 15px; border-top: 1px solid var(--line); }
#seam p { color: var(--muted); font-size: .86rem; margin-top: 12px; }
.seam-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.seam-grid figure { min-width: 0; }
.seam-grid canvas { height: auto; aspect-ratio: 16/9; border: 1px solid var(--line); }
#seam[data-ratio='square'] canvas { aspect-ratio: 1; }
#seam[data-ratio='tall'] figure { width: min(100%,208px); justify-self: center; }
#seam[data-ratio='tall'] canvas { aspect-ratio: 9/16; }
.seam-grid figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px; color: var(--high); font-size: .79rem; padding-top: 5px; }
.seam-grid figcaption span { color: var(--muted); font: .71rem/1.3 var(--mono); }
.controls { min-width: 0; background: var(--panel); padding: clamp(13px,1.65vw,22px); }
.controls h2 { font-size: 1.12rem; line-height: 1.2; letter-spacing: -.028em; }
.controls-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 7px; }
.controls-head p { color: var(--muted); font: .73rem/1.3 var(--mono); }
.controls > section+section { border-top: 1px solid var(--line); margin-top: 13px; padding-top: 13px; }
.form-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; margin-bottom: 8px; }
.form-options button { padding-inline: 5px; }
.text-button { border: 0; min-height: 28px; padding: 5px 0; color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }
.text-button:hover { color: #fff3ff; }
.control { display: grid; align-items: center; grid-template-columns: 1fr auto; gap: 0 4px; }
.control label { font-size: .79rem; }
.control output { color: var(--accent); font: .72rem/1.1 var(--mono); }
.control input { grid-column: 1/-1; }
.swatches { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.swatches button { padding: 3px; height: 35px; border-radius: 3px; background: transparent; border: 1px solid var(--line); }
.swatches button[aria-pressed='true'],.swatches button:hover { border-color: var(--accent); }
.swatches button span { display: flex; height: 100%; }
.swatches i { flex: 1; background: var(--c); }
.swatches i:nth-child(1) { background: var(--c0); }
.swatches i:nth-child(2) { background: var(--c1); }
.swatches i:nth-child(3) { background: var(--c2); }
.swatches i:nth-child(4) { background: var(--c3); }
[data-palette='ember'] { --c0:#180e22; --c1:#ff8173; --c2:#ffe3a6; --c3:#aa68db; }
[data-palette='tide'] { --c0:#0a1726; --c1:#55c6db; --c2:#b6edcb; --c3:#6278b8; }
[data-palette='paper'] { --c0:#ebe0ce; --c1:#981f51; --c2:#5c305e; --c3:#c85c41; }
[data-palette='citrine'] { --c0:#1f200e; --c1:#ffc55e; --c2:#fbf4b9; --c3:#85ab53; }
.export-options { display: grid; grid-template-columns: 1.15fr 1fr .83fr; gap: 6px; margin-top: 7px; }
.export-options label { display: grid; gap: 2px; color: var(--muted); font-size: .74rem; min-width: 0; }
.export-options select,#copy-link { width: 100%; min-width: 0; height: 34px; border: 1px solid var(--line); border-radius: 2px; padding: 3px 5px; color: var(--high); background: #1b1622; font-size: .79rem; }
.primary-exports { display: flex; gap: 7px; margin-top: 10px; }
.primary-exports button { flex: 1; padding: 8px 6px; min-width: 0; }
.primary,.primary-exports button.primary { background: var(--accent); border-color: var(--accent); color: #261932; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; }
.primary:hover,.primary-exports button.primary:hover { color: #241a2b; background: #fce2ff; }
.secondary { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 3px 10px; margin-top: 4px; }
#copy-field { margin-top: 4px; font-size: .76rem; color: var(--muted); }
#copy-field input { margin-top: 3px; }
#message { margin-top: 5px; font-size: .8rem; color: var(--warm); }
#progress { display: grid; grid-template-columns: minmax(60px,1fr) 4ch auto; align-items: center; gap: 6px; }
#progress progress { width: 100%; height: 12px; accent-color: var(--accent); }
#fraction { color: var(--accent); font: .7rem var(--mono); }
.below { display: flex; justify-content: space-between; align-items: start; gap: 13px; padding-block: 10px 27px; font-size: .83rem; color: var(--muted); }
.below a { color: var(--accent); }
.fallback { border: 1px solid var(--line); }
.fallback img { width: 100%; }
.fallback p { padding: 12px 14px; }
.footer { border-top: 1px solid var(--line); padding-block: 13px 21px; color: var(--muted); font-size: .81rem; }
.footer .wordmark { font-size: 1.06rem; }
.reading { padding-block: clamp(30px,6vw,72px) 52px; min-height: 64vh; }
.reading header { border-bottom: 1px solid var(--line); padding-bottom: 22px; }
.reading header p { margin: 14px 0; }
.reading h1 { font-size: clamp(3.7rem,7.65vw,7.7rem); }
.guide-body { max-width: 830px; }
.guide-body section { margin-top: 20px; padding-top: 12px; }
.guide-body section+section { border-top: 1px solid var(--line); }
.guide-body h2 { font-size: clamp(1.65rem,3.22vw,3rem); line-height: 1.09; letter-spacing: -.045em; }
.guide-body p { margin-top: 7px; }
.guide-body p a { color: var(--accent); }
pre { overflow: auto; background: #261b30; padding: 10px 12px; border: 1px solid var(--line); }
code { color: var(--accent); font: .83rem var(--mono); }
@media (max-width: 990px) {
  .wrap { width: calc(100% - 52px); }
  .workbench { grid-template-columns: minmax(0,1.5fr) minmax(300px,1fr); }
}
@media (max-width: 730px) {
  .wrap { width: calc(100% - 32px); }
  .intro { display: block; }
  .intro p { margin-top: 9px; }
  .workbench { grid-template-columns: 1fr; }
  .preview-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .screen-wrap[data-ratio='tall'] { width: min(100% - 24px, 220px); }
  .screen-wrap[data-ratio='square'] { width: min(100% - 24px, 350px); }
  .controls { padding: 14px; }
  .controls > section+section { margin-top: 12px; padding-top: 11px; }
  .toggle button,.form-options button,.swatches button,.primary-exports button { min-height: 42px; }
}
@media (max-width: 410px) {
  .wrap { width: calc(100% - 24px); }
  .bar-content { min-height: 60px; }
  .wordmark { font-size: 1.13rem; gap: 5px; }
  .wordmark img { width: 25px; height: 25px; }
  nav a { font-size: .77rem; }
  .toolbar,.transport { padding-inline: 9px; gap: 6px; }
  .toggle button { font-size: .74rem; padding-inline: 7px; }
  .screen-data,.transport output { font-size: .64rem; }
  .play { min-width: 53px; padding-inline: 7px; }
  .below { display: block; }
  .below a { display: inline-block; margin-top: 5px; }
}
