/* Static site pages (T8). Colours come from /tokens.css only; no literal colours here (eslint pfl/no-literal-colours).
   No inline styles anywhere in the HTML: the CSP has no style-src 'unsafe-inline'. */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-size: var(--text-16);
  line-height: 1.6;
  overscroll-behavior: auto;
}
img,
svg {
  max-width: 100%;
}
svg {
  shape-rendering: crispEdges;
  flex: none;
}
a {
  color: var(--accent-text);
}
a:hover {
  color: var(--text);
}
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.skip {
  position: absolute;
  left: var(--space-2);
  top: -100px;
  z-index: 10;
  padding: var(--space-3) var(--space-4);
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-control);
  font-weight: 800;
}
.skip:focus {
  top: var(--space-2);
}

/* Logo (inline SVG, colours from the logo tokens) */
.px-ink { fill: var(--logo-ink); }
.px-cover { fill: var(--logo-cover); }
.px-edge { fill: var(--logo-edge); }
.px-page { fill: var(--logo-page); }

/* Layout */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}
.site-header {
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: nowrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--hit);
  color: var(--text);
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
}
.brand:hover {
  color: var(--text);
}
.spacer {
  flex: 1;
}
.nav {
  display: flex;
  gap: var(--space-1);
  flex-wrap: nowrap;
  white-space: nowrap;
}
.nav a {
  min-height: var(--hit);
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: var(--text-dim);
  text-decoration: none;
}
.nav a:hover {
  color: var(--text);
}
.nav a.nav-cta {
  color: var(--text);
  font-weight: 700;
}
/* One row on a phone: brand and the call to action. Guides and Examples are reachable from the footer and the page itself. */
@media (max-width: 480px) {
  .site-header .wrap {
    gap: var(--space-2);
  }
  .nav a:not(.nav-cta) {
    display: none;
  }
  .nav a {
    padding: 0 6px;
  }
  .brand {
    gap: 8px;
    font-size: 16px;
  }
}
@media (max-width: 360px) {
  .nav a.nav-cta .go {
    display: none;
  }
  .nav a {
    padding: 0 4px;
  }
  .brand {
    gap: 6px;
    font-size: 15px;
  }
  .brand svg {
    width: 28px;
    height: 28px;
  }
}
.nowrap {
  white-space: nowrap;
}

/* Buttons */
.btn {
  min-height: 48px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover {
  color: var(--text);
  border-color: var(--text-dim);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
}
.btn-primary:hover {
  color: var(--on-accent);
  background: var(--accent-text);
  border-color: var(--accent-text);
}
.btn-lg {
  min-height: 56px;
  padding: 0 28px;
  font-size: 18px;
}
.arrow {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Home: hero */
.hero {
  position: relative;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.hero .wrap {
  position: relative;
  padding-top: clamp(40px, 7vw, 88px);
  padding-bottom: clamp(40px, 7vw, 88px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 48px;
  align-items: center;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  align-items: flex-start;
}
.hero h1 {
  margin: 0;
  font-size: clamp(40px, 5vw, 56px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero h1 span {
  display: block;
  color: var(--accent);
}
.lede {
  margin: 0;
  font-size: 20px;
  color: var(--text-dim);
}
.stack-card {
  position: relative;
  justify-self: center;
  /* the offset pages stick out 16px to the right: keep the 16px gutter at 320 and 360 */
  width: min(calc(100% - 16px), 336px);
  margin: 0;
  aspect-ratio: 1;
}
@media (max-width: 480px) {
  .stack-card {
    justify-self: start;
  }
}
.stack-card .page {
  position: absolute;
  inset: 0;
  border: 4px solid var(--logo-ink);
}
.stack-card .page.p3 {
  background: var(--accent);
  transform: translate(16px, -16px);
}
.stack-card .page.p2 {
  background: var(--logo-edge);
  transform: translate(8px, -8px);
}
.stack-card .page.p1 {
  background: var(--logo-page);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stack-card img {
  width: 256px;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
  display: block;
}
.pause {
  position: absolute;
  right: var(--space-2);
  bottom: var(--space-2);
  width: var(--hit);
  height: var(--hit);
  border-radius: var(--radius-control);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.js .pause {
  display: flex;
}
.pause svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.pause .i-play {
  display: none;
}
.pause[aria-pressed='true'] .i-play {
  display: block;
}
.pause[aria-pressed='true'] .i-pause {
  display: none;
}

/* Home: proof row, examples */
.proof {
  padding-top: 72px;
  padding-bottom: 72px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 20px;
}
.tile {
  background: var(--surface);
  border-radius: var(--radius-sheet);
  border: 1px solid var(--border);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.tile h2,
.tile h3 {
  margin: 0;
  font-size: var(--text-20);
}
.tile p {
  margin: 0;
  color: var(--text-dim);
}
.tile-art {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}
.phone {
  width: 112px;
  height: 196px;
  border-radius: 16px;
  border: 3px solid var(--logo-edge);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.phone-top {
  height: 14px;
  background: var(--surface);
}
.phone-mid {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.phone-mid img {
  width: 80px;
  height: 80px;
  image-rendering: pixelated;
  background: repeating-conic-gradient(var(--checker-a) 0 25%, var(--checker-b) 0 50%) 0 0 / 10px 10px;
}
.touch-dot {
  position: absolute;
  right: 18px;
  bottom: 26px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--scrim);
}
.phone-bottom {
  height: 22px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 6px;
}
.phone-bottom i {
  width: 10px;
  height: 10px;
  background: var(--logo-edge);
}
.phone-bottom i:first-child {
  background: var(--accent);
}
.phone-bottom i:last-child {
  background: var(--onion-next);
}
.file-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}
.file-chip span {
  width: 64px;
  height: 80px;
  background: var(--surface-2);
  border: 2px solid var(--logo-edge);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: var(--space-2);
  color: var(--text);
}
.strip-art {
  flex-direction: column;
}
.strip-art img {
  width: 256px;
  height: 64px;
  image-rendering: pixelated;
  background: repeating-conic-gradient(var(--checker-a) 0 25%, var(--checker-b) 0 50%) 0 0 / 8px 8px;
}
code,
pre,
kbd {
  font-family: var(--font-mono);
}
.mini-code {
  font-size: 12px;
  background: var(--bg);
  border-radius: var(--radius-control);
  padding: var(--space-2) var(--space-3);
  color: var(--text-dim);
  white-space: pre;
  max-width: 100%;
  overflow: hidden;
}
.band {
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.band .wrap {
  padding-top: 72px;
  padding-bottom: 72px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.band h2 {
  margin: 0;
  font-size: var(--text-28);
  font-weight: 800;
}
.band .sub {
  margin: 8px 0 0;
  color: var(--text-dim);
}
.examples {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 20px;
}
.example {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sheet);
  padding: var(--space-4);
  color: var(--text);
}
.example:hover {
  border-color: var(--text-dim);
  color: var(--text);
}
.example .art {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  background: var(--surface-2);
}
.example .art img {
  width: 256px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  image-rendering: pixelated;
  background: repeating-conic-gradient(var(--checker-a) 0 25%, var(--checker-b) 0 50%) 0 0 / 32px 32px;
}
.example .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--hit);
}
.example strong {
  font-size: 18px;
}
.example .go {
  color: var(--accent-text);
  font-weight: 700;
}
.piskel-link {
  margin: 0;
  font-size: var(--text-16);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
}
.footer-grid {
  padding-top: 48px;
  padding-bottom: 48px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: var(--space-6);
  font-size: var(--text-14);
}
.footer-grid h2 {
  margin: 0 0 6px;
  font-size: var(--text-12);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.footer-grid nav {
  display: flex;
  flex-direction: column;
}
.footer-grid nav a {
  min-height: var(--hit);
  display: flex;
  align-items: center;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-brand .name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 800;
}
.footer-brand p {
  margin: 0;
  color: var(--text-dim);
}
.footer-simple {
  padding-top: var(--space-5);
  padding-bottom: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
  font-size: var(--text-14);
}
.footer-simple a {
  min-height: var(--hit);
  min-width: var(--hit);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Guides and info pages */
.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-6) clamp(16px, 4vw, 32px) 72px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.crumbs {
  font-size: var(--text-14);
}
.crumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--text-dim);
}
.crumbs li {
  display: flex;
  align-items: center;
}
.crumbs a {
  min-height: var(--hit);
  min-width: var(--hit);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.doc h1,
.info h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.meta {
  margin: 10px 0 0;
  color: var(--text-dim);
  font-size: 15px;
}
.tldr {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sheet);
  padding: 20px var(--space-5);
}
.tldr h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-14);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.tldr ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.prose {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 17px;
}
.prose h2 {
  margin: var(--space-3) 0 0;
  font-size: var(--text-28);
  line-height: 1.2;
}
.prose h3 {
  margin: var(--space-2) 0 0;
  font-size: var(--text-20);
}
.prose p,
.prose li {
  max-width: 68ch;
}
.prose p,
.prose ul,
.prose ol {
  margin: 0;
}
.prose ul,
.prose ol {
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.prose code,
.info code {
  font-size: 0.9em;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 1px 5px;
}
.prose pre {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: var(--space-3) var(--space-4);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
}
.prose pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}
.prose kbd {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 5px;
  font-size: 0.9em;
}
figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
figure.shot img,
.prose figure img {
  height: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}
figure img.px {
  image-rendering: pixelated;
  /* exact integer scale: a border-box border would shave 2px off the picture and resample it */
  box-sizing: content-box;
  border: 0;
  outline: 1px solid var(--border);
}
figure.phone-shot img {
  max-width: 360px;
  width: 100%;
}
figcaption {
  font-size: var(--text-14);
  color: var(--text-dim);
}
.shots {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: flex-start;
}
.shots figure {
  flex: 1 1 240px;
  max-width: 360px;
}
.cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  background: var(--surface-2);
  border-radius: var(--radius-sheet);
  padding: var(--space-4) 20px;
}
.cta-bar strong {
  font-weight: 700;
}
.callout {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius-sheet);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.callout h2 {
  margin: 0;
  font-size: var(--text-28);
  line-height: 1.2;
}
.callout p,
.callout ol,
.callout ul {
  margin: 0;
}
.callout ol,
.callout ul {
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  font-size: 15px;
}
th,
td {
  padding: 10px var(--space-3);
  text-align: left;
  vertical-align: top;
}
thead th {
  background: var(--surface-2);
}
tbody th,
tbody td {
  border-top: 1px solid var(--border);
  font-weight: 400;
}
.table-wrap {
  overflow-x: auto;
}
.related {
  border-top: 1px solid var(--border);
  padding-top: var(--space-5);
}
.related h2 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-20);
}
.related ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: var(--space-3);
}
.related a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: var(--hit);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sheet);
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  height: 100%;
}
.related a:hover {
  border-color: var(--text-dim);
}
.related a span {
  font-weight: 400;
  font-size: var(--text-14);
  color: var(--text-dim);
}

/* Info pages */
.info {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px clamp(16px, 4vw, 32px) 72px;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: flex-start;
}
.info-nav {
  flex: 1 1 200px;
  max-width: 240px;
  display: flex;
  flex-direction: column;
}
.info-nav a {
  min-height: var(--hit);
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  border-radius: var(--radius-control);
  text-decoration: none;
  color: var(--text-dim);
}
.info-nav a[aria-current='page'] {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
}
.info-main {
  flex: 999 1 560px;
  min-width: 0;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.info-main p {
  margin: 0;
  max-width: 68ch;
}
.info-main .big {
  font-size: var(--text-20);
}
.info-main section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.info-main h2 {
  margin: 0;
  font-size: 22px;
}
.info-main section p {
  color: var(--text);
}
.info-main ul {
  margin: 0;
  padding-left: 22px;
}
.small {
  color: var(--text-dim);
  font-size: 15px;
}
.report-box {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sheet);
  padding: 20px;
}
.report-box label {
  font-weight: 700;
}
.report-box input {
  min-height: var(--hit);
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  padding: 0 var(--space-3);
  font: inherit;
  font-family: var(--font-mono);
  font-size: var(--text-14);
}
.report-box .out {
  font-family: var(--font-mono);
  font-size: var(--text-14);
  word-break: break-all;
  color: var(--text-dim);
}
.report-box .note {
  color: var(--text-dim);
  font-size: var(--text-14);
}
.actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
[hidden] {
  display: none !important;
}
.js-only {
  display: none;
}
.js .js-only {
  display: block;
}
.js .btn.js-only {
  display: inline-flex;
}
.tile .arrow {
  color: var(--accent);
}

/* 404 */
.lost {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 48px clamp(16px, 4vw, 32px);
  text-align: center;
}
.lost::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.lost > * {
  position: relative;
}
.lost h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.1;
  font-weight: 800;
  text-wrap: balance;
}
.lost p {
  margin: 0;
  color: var(--text-dim);
  max-width: 44ch;
}
.lost .code {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: var(--text-14);
}
.page-404 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Print: no navigation, readable dark on light. System colour keywords follow color-scheme, so no literal colours. */
@media print {
  :root {
    color-scheme: light;
  }
  html,
  body {
    background: Canvas;
    color: CanvasText;
  }
  body *,
  body *::before,
  body *::after {
    color: CanvasText !important;
    background: transparent !important;
    border-color: CanvasText !important;
    box-shadow: none !important;
  }
  .site-header,
  .site-footer,
  .nav,
  .info-nav,
  .crumbs,
  .cta-bar,
  .skip,
  .pause,
  .related {
    display: none !important;
  }
  .doc,
  .info {
    padding: 0;
    max-width: none;
  }
  a {
    text-decoration: underline;
  }
  figure,
  .tldr,
  .callout {
    break-inside: avoid;
  }
}
