/* Scene: examples. Your idea, made better: three fictional updates. Two are one finished frame each on a stage, with
   Winch's pins on what changed and a legend under the frame, beside the note, what we'd build and the tests. The third is
   a text card with the fictional chip beside its game.
   Hold frame first: the pins are on in the markup, and full motion brings them in once as the stage reveals.
   A frame is a size container: 4:3 on a narrow stage and 2:1, the whole picture, from 600 px. The world is one 2:1
   picture laid over the frame's height, and --wx picks the slice a narrow frame shows. Pins sit in the world as fractions
   of it (--x, --y), so they stay on their mark in every crop. Game palettes are --game-* properties on each viewport
   (.xv--*), and chrome uses tokens only. */

@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/fredoka.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}
/* the racing game's wide numerals: one shared file with the styles scene (provenance/fonts.json) */
@font-face {
  font-family: "Archivo Wide Game";
  src: url("/assets/fonts/archivo-wide.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* section layout */
.example { padding-block: clamp(36px, 4vw, 56px); }
.ideas .example:first-of-type { padding-top: 0; }
.ideas .example:last-child { padding-bottom: 0; }
.example__grid { width: min(100% - 2 * var(--frame-gutter), var(--container)); margin-inline: auto; display: grid; gap: clamp(20px, 2vw, 24px); align-items: start; }
.example__head { display: grid; justify-items: start; gap: var(--s-3); max-width: 40rem; }
.example__title { font-size: clamp(1.625rem, 1.43rem + .8vw, 2.25rem); line-height: var(--lh-h2); letter-spacing: var(--tr-h2); text-wrap: balance; }
.example__aside { display: grid; gap: clamp(20px, 2vw, 24px); align-content: start; align-items: start; }
.example__aside > * { align-self: start; }
.example__stage { min-width: 0; }
@media (min-width: 768px) and (max-width: 1279.98px) {
  .example:not(.example--text) .example__aside { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--s-6); }
  .example:not(.example--text) .example__tests { grid-column: 2; grid-row: 1 / span 2; }
}
/* phones: the stage sits on the shared phone stage inset, like every other stage, while the text keeps the gutter */
@media (max-width: 767.98px) {
  .example__stage { margin-inline: calc(var(--stage-inset) - var(--gutter)); }
}
/* two columns: the words on the left, the stage on the right, on the page's 1200 frame */
@media (min-width: 1280px) {
  .example__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 9fr); column-gap: var(--s-7); row-gap: var(--s-5); }
  .example__head { grid-column: 1; grid-row: 1; }
  .example__aside { grid-column: 1; grid-row: 2; }
  .example__stage { grid-column: 2; grid-row: 1 / span 2; }
}
@media (min-width: 1280px) and (min-height: 820px) {
  .example__stage { position: sticky; top: calc(var(--header-h) + var(--s-5)); }
}

/* the stage: one finished frame and the legend its pins key into */
.example__body { display: grid; gap: var(--s-4); }
.xv[data-specimen] {
  position: relative;
  display: block;
  padding: 0;
  aspect-ratio: 4 / 3;
  overflow: clip;
  container: xv / size;
  color: var(--game-ink);
  background: var(--game-bg);
  font-family: var(--font-game);
  font-synthesis: none;
}
@container stage (min-width: 600px) { .xv[data-specimen] { aspect-ratio: 2 / 1; } }
.xs { position: absolute; inset: 0; font-size: clamp(11px, 100cqh / 28, 15px); line-height: 1.2; font-weight: 500; }
.xs__world { position: absolute; z-index: 0; top: 0; left: calc((100cqw - 200cqh) * var(--wx, .5)); width: 200cqh; height: 100%; }
.xs__art { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; }
.xs svg { display: block; overflow: visible; }
.xs p { margin: 0; }
:where(.xs) :is(b, em, small, i) { font-style: normal; }

.xlegend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.xlegend__key { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--ink); font-size: var(--t-small); line-height: var(--lh-small); }

/* pins: Winch's annotation, keyed to the legend */
.xpin--key {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: var(--r-round);
  background: var(--slate);
  color: var(--card);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--card), 0 2px 6px color-mix(in oklab, var(--instrument) 30%, transparent);
}
/* In the frame a pin is an anchor on what changed (the leader's end dot, at --x and --y of its box), with the numbered dot
   --len away in clear space: --n above, --s below, --e right, --w left. --len is in the frame's em. */
.xs .xpin { --pd: clamp(18px, 1.75em, 24px); position: absolute; z-index: 3; left: var(--x, 50%); top: var(--y, 50%); width: 0; height: 0; pointer-events: none; }
.xs .xpin::before { content: ""; position: absolute; background: var(--slate); box-shadow: 0 0 0 1px color-mix(in oklab, var(--card) 70%, transparent); }
.xs .xpin::after { content: ""; position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: var(--r-round); background: var(--slate); box-shadow: 0 0 0 1.5px var(--card); }
.xs .xpin__dot {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: var(--pd);
  height: var(--pd);
  margin: calc(var(--pd) / -2) 0 0 calc(var(--pd) / -2);
  border-radius: var(--r-round);
  background: var(--slate);
  color: var(--card);
  font: 600 clamp(11px, 1em, 13px)/1 var(--font-body);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  box-shadow: 0 0 0 2px var(--card), 0 2px 6px color-mix(in oklab, var(--instrument) 34%, transparent);
}
.xpin--n::before, .xpin--s::before { left: -.5px; width: 1px; height: calc(var(--len, 1.7em) - var(--pd) / 2); }
.xpin--e::before, .xpin--w::before { top: -.5px; height: 1px; width: calc(var(--len, 1.7em) - var(--pd) / 2); }
.xpin--n::before { bottom: 0; }
.xpin--s::before { top: 0; }
.xpin--e::before { left: 0; }
.xpin--w::before { right: 0; }
.xpin--n > .xpin__dot { top: calc(var(--len, 1.7em) * -1); }
.xpin--s > .xpin__dot { top: var(--len, 1.7em); }
.xpin--e > .xpin__dot { left: var(--len, 1.7em); }
.xpin--w > .xpin__dot { left: calc(var(--len, 1.7em) * -1); }
/* with full motion the pins come in once, from their anchors, as the stage scrolls in */
@keyframes xpin-in { from { opacity: 0; transform: scale(.5); } }
.js[data-motion="full"] .example__stage.reveal-pending.is-in .xs .xpin { animation: xpin-in var(--d-move) var(--e-settle) calc(var(--d-scene) * .55 + var(--i, 0) * 140ms) backwards; }
.xs [data-pin="2"] { --i: 1; }
.xs [data-pin="3"] { --i: 2; }

/* the weekend event: the village on Friday */
.xv--event { --game-bg: #86B4E2; --game-ink: #2B2F45; }
.xs--av { --wx: .5; }
.av-pin1 { --x: 49.7%; --y: 64%; --len: 2.1em; }
.av-pin2 { --x: 76.3%; --y: 52%; --len: 2em; }
.av-pin3 { --x: 43.4%; --y: 26%; --len: 2.1em; }

/* the second car: the night harbor, in the racing game's kit (the styles scene's Night kit) */
.xv--shop {
  --game-bg: #0B1030;
  --game-ink: #F7F3EA;
  --game-panel: rgb(11 15 36 / .92);
  --game-panel-hi: rgb(255 255 255 / .07);
  --game-teal-hi: #83F7E2;
  --game-lime: #C8FF3E;
  --game-lime-a: rgb(200 255 62 / .55);
  --game-lime-ink: #1C2A04;
}
.xs--rc { --wx: .528; color: var(--game-ink); }
/* the car's name over it, for the whole server to see, with the same top speed as the car in the shop */
.rc-tag {
  position: absolute;
  z-index: 2;
  left: 57.5%;
  top: 66.5%;
  display: grid;
  justify-items: start;
  gap: .22em;
  padding: .36em .55em .4em;
  border: 1px solid var(--game-lime-a);
  border-radius: .5em;
  background: var(--game-panel);
  box-shadow: 0 0 1.4em -.3em var(--game-lime-a), inset 0 1px 0 var(--game-panel-hi);
  transform: translate(-50%, -100%);
}
.rc-tag::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: .9em; background: var(--game-lime); }
.rc-tag__name { display: flex; align-items: center; gap: .5em; }
.rc-tag__name b, .rc-speed b { font-family: "Archivo Wide Game", var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; }
.rc-tag__name b { font-size: 1.05em; letter-spacing: -.01em; line-height: 1; transform: skewX(-8deg); white-space: nowrap; }
.rc-tag__rare { padding: .14em .42em .16em; border-radius: .25em; background: var(--game-lime); color: var(--game-lime-ink); font-size: .92em; font-weight: 700; line-height: 1; transform: skewX(-8deg); }
.rc-speed { display: inline-flex; align-items: center; gap: .3em; color: var(--game-teal-hi); }
.rc-speed svg { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.rc-speed b { font-size: .95em; line-height: 1; transform: skewX(-8deg); }
@container xv (min-width: 700px) {
  .rc-tag { padding: .45em .7em .5em; }
  .rc-tag__name b { font-size: 1.2em; }
}
.rc-pin1 { --x: 58%; --y: 78%; --len: 1.6em; }
.rc-pin2 { --x: 0; --y: 72%; --len: 1.45em; }
.rc-pin3 { --x: 42%; --y: 84%; --len: 1.6em; }

/* the words: the note, what we'd build, what wasn't in the note, the tests and what your team supplies */
.example__brief { padding: var(--s-4) var(--s-5); }
.example__note { margin-top: var(--s-2); font-family: var(--font-display); font-size: var(--t-h3); line-height: var(--lh-h3); letter-spacing: var(--tr-h3); font-weight: var(--wght-heading); font-stretch: var(--wdth-heading); text-wrap: pretty; }
.example__takes { margin: 0; display: grid; gap: var(--s-4); align-content: start; }
.example__take dt { color: var(--ink-3); font-size: var(--t-meta); font-weight: 500; line-height: var(--lh-meta); }
.example__take dd { margin: var(--s-1) 0 0; color: var(--ink); text-wrap: pretty; }
.example__take--past { display: grid; justify-items: start; }
.example__take--past dd { color: var(--ink-2); font-size: var(--t-small); line-height: var(--lh-small); }
.example__take dt.notein { color: var(--ink); font-size: var(--t-mono); font-weight: 400; line-height: var(--lh-mono); }
.example__take dd.example__call { color: var(--ink-3); font-size: var(--t-meta); line-height: var(--lh-meta); }
.example__label { color: var(--ink-3); font-family: var(--font-body); font-size: var(--t-meta); font-weight: 500; font-stretch: 100%; letter-spacing: var(--tr-meta); line-height: var(--lh-meta); }
.example__tests { display: grid; gap: var(--s-1); align-content: start; }
/* what we test before you see it: open boxes, since an example claims no result */
.example__test-list { list-style: none; margin: 0; padding: 0; display: grid; }
.example__test-list li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; font-size: var(--t-small); line-height: var(--lh-small); }
.example__test-list li + li { border-top: 1px solid var(--line); }
.example__todo { width: 14px; height: 14px; margin: 4px 0 0 3px; border-radius: var(--r-xs); box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.example__team { display: grid; gap: var(--s-1); margin-top: var(--s-4); }
.example__noted { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; font-size: var(--t-small); line-height: var(--lh-small); }
.example__noted .glyph { width: 20px; height: 20px; color: var(--open); }

/* the quest: a text card, no picture */
.example__card { display: grid; gap: var(--s-5); padding: clamp(24px, 3vw, 40px); }
.example__chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.example--text .example__brief { background: var(--chalk); box-shadow: inset 0 0 0 1px var(--line); }
@media (min-width: 768px) {
  .example--text .example__aside { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--s-6); }
  .example--text .example__tests { grid-column: 2; grid-row: 1 / span 2; }
}
@media (min-width: 1024px) {
  .example--text .example__aside { grid-template-columns: minmax(0, 4fr) minmax(0, 4fr) minmax(0, 5fr); }
  .example--text .example__takes { grid-column: 2; grid-row: 1; }
  .example--text .example__tests { grid-column: 3; grid-row: 1; }
}

/* forced colours and print */
@media (forced-colors: active) {
  .xv[data-specimen], .xpin, .xpin__dot, .xpin--key { forced-color-adjust: none; }
}
@media print {
  .xv { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
