/* Standalone styles for the coffeetableviz 8x8 pixel art experiment. */
.pixel-page { padding-bottom: clamp(4rem, 8vw, 8rem); }
.pixel-page-header { padding: clamp(3.2rem, 6vw, 6rem) 0 clamp(2rem, 4vw, 3.5rem); }
.pixel-page-header h1 { margin: 0; max-width: 850px; font: 700 clamp(3.1rem, 8vw, 6.7rem)/.96 "Space Grotesk",sans-serif; letter-spacing: -.06em; }
.pixel-page-header h1 span { color: var(--accent); }
.pixel-lede { max-width: 730px; margin: 1.8rem 0 0; color: #414141; font-size: clamp(1.12rem, 2.3vw, 1.35rem); line-height: 1.55; }
.pixel-studio { display: grid; grid-template-columns: minmax(270px, .78fr) minmax(0, 1.2fr); gap: clamp(1.5rem, 4vw, 4rem); padding: clamp(1.25rem, 3vw, 3rem); background: #fff; border: 1px solid #d4d4d4; }
.pixel-panel { padding: .35rem 0; }
.pixel-kicker { margin: 0; color: #737373; font: 500 .71rem/1.4 "IBM Plex Mono",monospace; text-transform: uppercase; letter-spacing: .08em; }
.pixel-panel h2 { margin: .85rem 0 .75rem; font: 700 clamp(1.5rem, 3.5vw, 2.1rem)/1.15 "Space Grotesk",sans-serif; letter-spacing: -.03em; }
.pixel-panel > p:not(.pixel-kicker) { margin: .5rem 0 1.2rem; font-size: .93rem; color: #555; line-height: 1.6; }
.pixel-palette { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-top: 1.5rem; }
.pixel-swatch { min-width: 0; padding: .35rem .2rem .45rem; background: #fff; color: #444; border: 2px solid transparent; border-radius: 4px; font: 500 .68rem/1.3 "IBM Plex Sans",sans-serif; cursor: pointer; text-align: center; }
.pixel-swatch-chip { display: block; width: 100%; aspect-ratio: 1.25; max-height: 62px; background: var(--swatch); border: 1px solid rgb(0 0 0 / .08); margin-bottom: .4rem; }
.pixel-swatch.is-active { border-color: #111; color: #111; }
.pixel-swatch:hover { background: #f2f2f2; }
.pixel-eraser { margin-top: 1rem; width: 100%; padding: .7rem 1rem; border: 1px solid #b7b7b7; color: #222; background: #fafafa; font: 600 .82rem "IBM Plex Sans",sans-serif; cursor: pointer; text-align: left; }
.pixel-eraser.is-active { border: 2px solid #111; }
.pixel-divider { border-top: 1px solid #d2d2d2; margin: 2rem 0 1.3rem; }
.pixel-presets { display: flex; gap: .6rem; flex-wrap: wrap; }
.pixel-presets button { padding: .62rem .85rem; border: 1px solid #bdbdbd; background: #f6f6f6; color: #161616; font: 600 .8rem "IBM Plex Sans",sans-serif; cursor: pointer; }
.pixel-presets button:hover, .pixel-eraser:hover { background: #e7e7e7; }
.pixel-workspace { min-width: 0; }
.pixel-canvas-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .85rem; }
.pixel-count { color: #555; font: 500 .74rem "IBM Plex Mono",monospace; }
.pixel-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; background: #c8c8c8; border: 2px solid #c8c8c8; width: 100%; max-width: 620px; aspect-ratio: 1; touch-action: none; user-select: none; -webkit-user-select: none; }
.pixel-cell { display: block; border: 0; border-radius: 0; min-width: 0; min-height: 0; width: 100%; height: 100%; padding: 0; background: #fff; cursor: crosshair; touch-action: none; appearance: none; -webkit-appearance: none; }
.pixel-cell:focus-visible { position: relative; z-index: 1; outline: 3px solid #111; outline-offset: -4px; }
.pixel-canvas-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 0; border-bottom: 1px solid #dedede; }
.pixel-canvas-foot p { margin: .15rem 0 0; font-size: .8rem; color: #666; }
#pixel-preview { width: 66px; height: 66px; border: 1px solid #ccc; image-rendering: pixelated; image-rendering: crisp-edges; flex: none; }
.pixel-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }
.pixel-actions button { border: 1px solid #bdbdbd; padding: .7rem .9rem; background: #f7f7f7; font: 600 .77rem/1.35 "IBM Plex Sans",sans-serif; color: #1a1a1a; cursor: pointer; }
.pixel-actions button:hover:not(:disabled) { background: #e5e5e5; }
.pixel-actions button:disabled { opacity: .42; cursor: not-allowed; }
.pixel-actions .pixel-primary { background: #111; border-color: #111; color: white; }
.pixel-actions .pixel-primary:hover:not(:disabled) { background: #343434; }
.pixel-status { margin: .85rem 0 0; min-height: 1.5rem; color: #595959; font-size: .78rem; line-height: 1.5; }
.pixel-story { max-width: 760px; padding: clamp(4rem, 8vw, 7rem) 0 0; }
.pixel-story h2 { margin: .55rem 0 1.4rem; font: 700 clamp(2rem, 5vw, 3.6rem)/1.1 "Space Grotesk",sans-serif; letter-spacing: -.045em; }
.pixel-story p:not(.eyebrow) { font-size: 1rem; line-height: 1.75; margin: 0 0 1.2rem; }
.pixel-story .pixel-attribution { margin-top: 2rem !important; padding-top: 1.2rem; border-top: 1px solid #ccc; font-size: .85rem !important; color: #555; }
.pixel-page button:not(.pixel-cell):focus-visible { outline: 3px solid #c94545; outline-offset: 3px; }
@media (max-width: 760px) {
  .pixel-studio { grid-template-columns: minmax(0,1fr); }
  .pixel-palette { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
  .pixel-swatch { font-size: .73rem; padding-inline: .15rem; }
  .pixel-swatch-chip { aspect-ratio: 1.5; }
  .pixel-panel h2 { font-size: 1.55rem; }
  .pixel-divider { margin: 1.2rem 0; }
}
@media (max-width: 420px) {
  .pixel-studio { padding: 1rem; }
  .pixel-palette { gap: .35rem; }
  .pixel-swatch { font-size: .68rem; }
  .pixel-grid { gap: 1px; border-width: 1px; }
  .pixel-actions button { padding: .65rem .72rem; }
}

/* Pixel art PNG export: always show a saving route when mobile downloads are blocked. */
.pixel-export-panel[hidden] { display: none; }
.pixel-export-panel { margin-top: 1.25rem; padding: 1.15rem; border: 1px solid #cfcfcf; background: #f3f4f6; display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, .48fr); gap: 1rem; align-items: center; }
.pixel-export-copy { min-width: 0; }
.pixel-export-copy p:not(.pixel-kicker) { margin: .5rem 0 0; color: #444; font-size: .84rem; line-height: 1.55; }
#pixel-export-preview { width: 100%; max-width: 240px; height: auto; aspect-ratio: 1; border: 1px solid #bdbdbd; image-rendering: pixelated; image-rendering: crisp-edges; }
.pixel-export-link { display: inline-flex; grid-column: 1 / -1; width: fit-content; padding: .7rem 1rem; color: #fff; background: #111; text-decoration: none; font: 600 .82rem/1.4 "IBM Plex Sans",sans-serif; }
.pixel-export-link:hover { background: #343434; }
.pixel-export-link:focus-visible { outline: 3px solid #c94545; outline-offset: 3px; }
@media (max-width: 560px) {
  .pixel-export-panel { grid-template-columns: 1fr; }
  #pixel-export-preview { max-width: min(100%, 340px); justify-self: center; }
}

/* 8×8 Classic / 16×16 Detail: one accessible studio, two saved drawings. */
.pixel-size-switch { padding-bottom: 1.15rem; margin-bottom: 1.25rem; border-bottom: 1px solid #d3d3d3; }
.pixel-size-buttons { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .55rem; margin-top: .7rem; }
.pixel-size-button { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; padding: .8rem .65rem; background: #f6f6f6; border: 1px solid #bcbcbc; color: #242424; cursor: pointer; font: .83rem "IBM Plex Sans",sans-serif; text-align: left; }
.pixel-size-button strong { font-weight: 600; }
.pixel-size-button span { font-size: .69rem; color: #555; }
.pixel-size-button.is-active { background: #111; border-color: #111; color: #fff; }
.pixel-size-button.is-active span { color: #d5d5d5; }
.pixel-grid-viewport { width: 100%; max-width: 620px; overflow: auto; overscroll-behavior: contain; }
.pixel-grid { grid-template-columns: repeat(var(--pixel-dimension, 8), minmax(0, 1fr)); }
.pixel-grid.is-zoomed { width: 200%; max-width: none; }
.pixel-grid.is-panning, .pixel-grid.is-panning .pixel-cell { touch-action: pan-x pan-y; cursor: grab; }
.pixel-zoom-tools[hidden] { display: none; }
.pixel-zoom-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .85rem 0; }
.pixel-zoom-tools button { border: 1px solid #aaa; padding: .58rem .7rem; color: #222; background: #f4f4f4; font: 600 .77rem "IBM Plex Sans",sans-serif; cursor: pointer; }
.pixel-zoom-tools button[aria-pressed="true"] { background: #111; color: #fff; border-color: #111; }
.pixel-zoom-tools button:disabled { opacity: .5; cursor: not-allowed; }
.pixel-zoom-tools p { flex-basis: 100%; margin: 0; color: #5c5c5c; font-size: .76rem; line-height: 1.5; }
@media (max-width: 390px) {
  .pixel-size-buttons { gap: .35rem; }
  .pixel-size-button { padding: .7rem .5rem; }
  .pixel-size-button span { font-size: .65rem; }
}
