/* Pebbon — a field notebook. Graph paper, fountain-pen ink, red pencil. */
/* metric-matched fallback so the swap to Newsreader doesn't move the layout */
@font-face { font-family: "Newsreader Fallback"; src: local("Georgia"), local("Times New Roman"); size-adjust: 90%; ascent-override: 96%; descent-override: 26%; line-gap-override: 0%; }
:root {
  color-scheme: light;
  /* colours (--paper, --ink, --text, --soft, --red, --pencil, --grid, --grid2) live in css/palette.css */
  --fiber: linear-gradient(transparent, transparent);
  --serif: "Newsreader", "Newsreader Fallback", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    var(--fiber),
    linear-gradient(var(--grid2) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid2) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 256px 256px, 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  /* the grid is registered to the text column: a major line on its left and right edges */
  background-position: 0 0, calc(50% - 541px) -1px, calc(50% - 541px) -1px, calc(50% - 589px) -1px, calc(50% - 589px) -1px;
  color: var(--text);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 18px;
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: var(--ink); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 40px; }
@media (max-width: 1279px) { body { background-position: 0 0, 39px -1px, 39px -1px, 39px -1px, 39px -1px; } }
/* phones (overflow-x below): .wrap is the screen width there, so nothing drawn (a chip's tick, a tilted phone) can widen
   the page and make the browser zoom out; clip, not hidden, so no scroll container and sticky/fixed still work */
@media (max-width: 640px) { .wrap { padding: 0 16px; overflow-x: clip; } body { font-size: 17px; background-position: 0 0, 15px -1px, 15px -1px, 15px -1px, 15px -1px; } }

.skip { position: absolute; left: 16px; top: -60px; z-index: 10; background: var(--paper); padding: 8px 12px; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; border: 1.5px solid var(--ink); }
.skip:focus { top: 12px; }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px 0 16px; }
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.mark b { font-weight: 500; font-size: 25px; letter-spacing: -.01em; line-height: 1; }
.mark .sub { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); margin-left: 6px; position: relative; top: 2px; }
/* the mark (js/figures/mark.js, LIVE_MARK): the box is the live mark's markBox(), cropped to it; mountPebbleMark
   sets the exact size too, so this only keeps the header from shifting while it loads (1A, the cairn: 21.6 x 22) */
.pebs { display: block; width: 21.6px; height: 22px; flex: none; position: relative; margin-top: -6px; }
.pebs canvas { display: block; transform-origin: 50% 95%; }
/* hover: the stones settle, a small rock on the base stone and they're still again */
/* only once the pen has finished sketching it in (pebbles.js adds .drawn) */
@media (prefers-reduced-motion: no-preference) { .mark:hover .pebs.drawn canvas { animation: pebs-settle .75s cubic-bezier(.3, .7, .3, 1); } }
@keyframes pebs-settle { 0% { transform: none; } 30% { transform: rotate(-6deg) translateY(-.5px); } 62% { transform: rotate(2.5deg); } 84% { transform: rotate(-.8deg); } 100% { transform: none; } }
.top nav { display: flex; gap: 26px; }
.top nav a { font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; color: var(--ink); padding: 6px 0; }
.top nav a:hover { color: var(--red); }
/* the sheet numbers, as on each sheet's label */
.top nav .n { color: var(--soft); margin-right: .55em; letter-spacing: .06em; }
.top nav a:hover .n { color: var(--red); }
@media (max-width: 1180px) { .mark .sub { display: none; } .top nav { gap: 20px; } }
/* tablets and phones: the index drops under the wordmark as a small table of contents */
@media (max-width: 700px) { .top nav { flex-basis: 100%; flex-wrap: wrap; gap: 4px 20px; } }
@media (max-width: 640px) { .top nav { display: grid; grid-template-columns: repeat(3, max-content); gap: 0 18px; } .top nav a { padding: 7px 0; } }
@media (max-width: 400px) { .top nav { gap: 0 13px; } .top nav a { font-size: 11px; letter-spacing: .1em; } .mark b { font-size: 23px; } }

/* ---------- type ---------- */
.label { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--soft); margin: 0 0 18px; }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); font-weight: 400; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.45rem, 4.2vw, 3.9rem); line-height: 1.03; letter-spacing: -.018em; }
h2 { font-size: clamp(2rem, 3.2vw, 2.9rem); line-height: 1.06; letter-spacing: -.014em; }
h3 { font-size: 1.5rem; line-height: 1.15; letter-spacing: -.01em; }
p { margin: 0 0 1em; text-wrap: pretty; }
.s { display: inline-block; } /* keep a short sentence of a heading on one line when it fits */
.lede { font-size: 1.2rem; line-height: 1.55; max-width: 31em; margin-top: 26px; }
.lede strong { font-weight: 500; color: var(--ink); }

/* ---------- figures ---------- */
figure { margin: 0; }
.cv { position: relative; width: 100%; aspect-ratio: var(--ar-w); }
.cv canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
@media (max-width: 819px) {
  .cv { aspect-ratio: var(--ar-n); max-width: 520px; margin-inline: auto; }
}
figcaption { text-wrap: balance; font-style: italic; font-size: .98rem; color: var(--soft); margin-top: 12px; max-width: 46em; line-height: 1.45; }
figcaption .no { font-family: var(--mono); font-style: normal; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin-right: 8px; }

/* a key (parts list) under a figure: only on narrow screens, where the drawn labels give way to numbers */
.key { display: none; list-style: none; counter-reset: k; margin: 14px auto 0; padding: 0; max-width: 520px; font-size: 1rem; line-height: 1.4; }
.key li { counter-increment: k; position: relative; padding: 0 0 10px 36px; }
.key li::before { content: counter(k); position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border: 1.3px solid var(--ink); border-radius: 50%; font-family: var(--mono); font-size: 11px; display: grid; place-items: center; color: var(--ink); }
.key li.red::before, .fig3 .key li::before { border-color: var(--pencil); }
.key b { font-weight: 500; color: var(--ink); }
@media (max-width: 819px) { .key { display: block; } }

.rule { width: 100%; margin: 52px 0 44px; height: 18px; }
.rule canvas { display: block; }

/* ---------- sheet 01 ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 4.3fr) minmax(0, 7.7fr); gap: 44px; align-items: center; padding: 26px 0 26px; }
.hero-text { padding-bottom: 40px; }
@media (max-width: 960px) { .hero { grid-template-columns: 1fr; gap: 22px; } .hero-text { padding-bottom: 0; } }

/* ---------- sheet 02 ---------- */
section { scroll-margin-top: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 14px; } }
.split p { max-width: 32em; }
.uses { list-style: none; margin: 6px 0 0; padding: 0; max-width: 34em; }
.uses li { position: relative; padding: 0 0 12px 30px; }
.uses li::before { content: ""; position: absolute; left: 2px; top: .78em; width: 16px; height: 1.5px; background: var(--ink); transform: rotate(-3deg); }
.uses li:nth-child(2)::before { transform: rotate(2deg); width: 15px; }
.uses li:nth-child(3)::before { transform: rotate(-1deg); width: 17px; }

.fig2a { margin-top: 30px; display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 14px; align-items: center; max-width: 420px; }
.pebble-fig { position: relative; width: 168px; aspect-ratio: 120 / 108; }
.pebble-fig canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fig2a figcaption { margin: 0 0 6px; }
@media (max-width: 900px) { .fig2a { margin: 14px 0 20px; grid-template-columns: 120px minmax(0, 1fr); } .pebble-fig { width: 120px; } }

.worked { margin-top: 32px; }
.worked-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-bottom: 26px; }
.try { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--soft); }
.stamps { display: flex; flex-wrap: wrap; gap: 14px 16px; }
.stamp {
  position: relative; appearance: none; -webkit-appearance: none; background: transparent; border: 0; margin: 0;
  padding: 12px 20px 12px; min-height: 60px; font: inherit; color: var(--ink); cursor: pointer; text-align: left;
  border-radius: 4px; -webkit-tap-highlight-color: transparent;
}
.stamp:nth-child(1) { transform: rotate(-.8deg); }
.stamp:nth-child(2) { transform: rotate(.5deg); }
.stamp:nth-child(3) { transform: rotate(-.3deg); }
.stamp .k { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); line-height: 1.3; }
.stamp .v { display: block; font-size: 1.2rem; line-height: 1.3; white-space: nowrap; }
.stamp:hover .v { color: var(--red); }
.stamp[aria-selected="true"] .k { color: var(--red); }
.stamp:focus-visible { outline: 2px dashed var(--red); outline-offset: 7px; }
.stamp-ink { position: absolute; inset: 0; pointer-events: none; }
.stamp-ink canvas { position: absolute; left: 0; top: 0; display: block; }
.stamp-ink canvas.mk { left: -20px; top: -20px; }
.no-js .stamp, html:not(.tabs-ready) .stamp { outline: 1.2px solid rgba(var(--ink-rgb), .55); outline-offset: -6px; }
.no-js .stamp:focus-visible, html:not(.tabs-ready) .stamp:focus-visible { outline: 2px dashed var(--red); outline-offset: 7px; }
@media (max-width: 640px) { .stamp { padding: 11px 16px; } .stamp .v { font-size: 1.08rem; } .worked-head { gap: 12px; } }

.worked-body { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 52px; align-items: start; }
@media (max-width: 1079px) { .worked-body { grid-template-columns: 1fr; gap: 30px; } }
.ledger .layer { position: absolute; inset: 0; }
.ledger .ghost { opacity: 0; }
.ledger .ghost.erase { animation: erase 1.5s ease-out forwards; }
@keyframes erase {
  0% { opacity: 1; filter: none; transform: none; }
  22% { opacity: .3; filter: blur(.4px); transform: translate(.5px, .2px); }
  60% { opacity: .12; filter: blur(.9px); transform: translate(1px, .4px); }
  100% { opacity: 0; filter: blur(1.4px); transform: translate(1.4px, .6px); }
}

.reply { border-top: 1.5px solid var(--ink); padding-top: 14px; }
@media (max-width: 1079px) { .reply { max-width: 40em; } }
.reply .label { margin-bottom: 12px; }
.panel .say { font-size: 1.42rem; line-height: 1.25; color: var(--ink); margin-bottom: 14px; letter-spacing: -.005em; text-wrap: balance; }
/* Fig. 2b's reply panels only: the chat (Fig. 4) has its own .why/.tail in css/fig4.css */
.panel .why { margin: 0 0 12px; padding: 0 0 0 1.4em; font-size: 1rem; line-height: 1.5; }
.panel .why li { padding-left: .2em; margin-bottom: 8px; }
.panel .why li::marker { font-family: var(--mono); font-size: .8em; color: var(--soft); }
.panel .why li:first-child::marker { color: var(--red); }
.panel .tail { font-size: 1rem; font-style: italic; color: var(--soft); }
.samples { margin-top: 26px; padding-top: 14px; border-top: 1px solid rgba(var(--ink-rgb), .35); }
.samples .label span { text-transform: none; letter-spacing: .02em; font-family: var(--serif); font-style: italic; font-size: 13px; }
.samples dl { margin: 0; font-size: .95rem; line-height: 1.45; }
.samples dl > div { margin-bottom: 10px; }
.samples dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.samples dd { margin: 2px 0 0; }

/* ---------- sheet 03 ---------- */
.split.head { align-items: end; margin-bottom: 28px; }
.split.head p { margin: 0; }
.fig3 { margin: 0; }
.map { container-type: inline-size; }
.bubble { font-family: var(--serif); line-height: 1.3; color: var(--text); }
.bubble b { font-weight: 600; color: var(--ink); }
.bubble .src { display: block; margin-top: .5em; font-family: var(--mono); font-size: .74em; letter-spacing: .04em; color: var(--soft); line-height: 1.35; }
.js .bubble { position: absolute; opacity: 0; transition: opacity .6s ease; overflow: hidden; }
.js .bubble.on { opacity: 1; }
.js .bubble.ask { text-align: right; }
.no-js .bubble { margin: 10px 0; max-width: 30em; }

/* ---------- sheet 04 ---------- */
.notes { list-style: none; margin: 30px 0 0; padding: 0; max-width: 760px; }
.notes li { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 14px; padding: 0 0 28px; }
.balloon { width: 52px; height: 52px; margin-top: -6px; }
.balloon canvas { display: block; }
.notes h3 { margin-bottom: 6px; }
.notes p { max-width: 34em; margin: 0; }
.rules-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; align-items: start; }
.rules-grid .tag { margin-top: 40px; }
@media (max-width: 900px) { .rules-grid { grid-template-columns: 1fr; gap: 0; } .rules-grid .tag { margin: 0 auto; max-width: 420px; width: 100%; } }
.rules-grid .tag .cv { max-width: none; aspect-ratio: 440 / 400; }
.u { position: relative; display: inline-block; white-space: nowrap; }
.u canvas { position: absolute; left: -4px; bottom: -10px; pointer-events: none; }

.contact { margin-top: 70px; }
.contact p { max-width: 32em; margin-top: 18px; }
.contact .mail { font-size: clamp(1.6rem, 3.4vw, 2.4rem); text-decoration: none; color: var(--ink); letter-spacing: -.01em; }
.contact .mail:hover { color: var(--red); }

/* footer: a hairline and two quiet lines (the studio's colophon lives on playnice.si) */
.site-foot { margin-top: 76px; padding: 18px 0 40px; border-top: 1px solid rgba(var(--ink-rgb), .35); font-size: 14px; line-height: 1.5; color: var(--soft); }
.site-foot .foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 32px; }
.site-foot .foot-op { margin: 0; max-width: 40em; }
.site-foot .foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-foot a { color: var(--ink); text-underline-offset: 3px; }
.site-foot a:hover { color: var(--red); }
.site-foot .foot-links a[aria-current] { text-decoration: none; color: var(--soft); }
.site-foot .foot-note { margin: 14px 0 0; padding: 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }

/* ---------- 404 ---------- */
.lost { padding: 60px 0 40px; max-width: 40em; }
.lost .cv { max-width: 460px; margin: 30px 0 10px; }
@media (max-width: 819px) { .lost .cv { margin: 24px 0 10px; } }

/* ---------- robustness (tech review): JavaScript off, very narrow screens ---------- */
/* the top bar wraps instead of pushing "Contact" off a 320 px screen (or 400% zoom) */
.top { flex-wrap: wrap; }
/* JavaScript off: nothing is drawn, so collapse the empty figure boxes, show the parts lists
   at every width, and show all three Fig. 2b answers, each with its purchase */
.no-js .cv { aspect-ratio: auto; }
.no-js .key { display: block; margin-inline: 0; }
.no-js .pebble-fig { display: none; }
.no-js .fig2a { grid-template-columns: minmax(0, 1fr); }
.no-js .stamps, .no-js .try { display: none; }
.no-js .worked-body { grid-template-columns: minmax(0, 1fr); gap: 20px; }
.no-js .panel[hidden] { display: block; }
.panel .for { display: none; }
.no-js .panel .for { display: block; margin: 22px 0 6px; }
.no-js .panel:first-child .for { margin-top: 0; }
