/* The explainers hub, in S4mple's simulator design language (see design/README.md). */
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

/* Every colour, radius and font below is a --sim-* token from /sim-tokens.css, which
   design/sync_tokens.py generates from the S4mple repo. Define none here. */
body.sim { background: var(--sim-paper); color: var(--sim-ink); --hub-pill: color-mix(in srgb, var(--sim-accent) 12%, var(--sim-panel)); }
.hub { max-width: 66rem; }
.hub a { color: var(--sim-accent); }
.hub .back a { color: var(--sim-ink-soft); }
.hub h1 { margin: 0; font: 600 3rem/1.05 var(--sim-serif); letter-spacing: -0.015em; }
.hub .hub-lede { margin: 0.7rem 0 0; color: var(--sim-ink-soft); font-size: 1.08rem; max-width: 52ch; }
.hub-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.4rem 0 0; padding: 0; list-style: none; }
.hub-nav li { margin: 0; padding: 0; max-width: none; }
.hub-nav li::before { content: none; }
.hub-nav a { display: block; padding: 0.3rem 0.8rem; border-radius: 999px; background: var(--hub-pill); color: var(--sim-ink); font-size: 0.88rem; text-decoration: none; }
.hub-nav a:hover { background: var(--sim-accent); color: var(--sim-on-accent); }

.shelf { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--sim-line-soft); }
.shelf h2 { margin: 0; padding: 0; border: 0; font: 600 1.6rem/1.2 var(--sim-serif); color: var(--sim-ink); }
.shelf > p { margin: 0.35rem 0 1.2rem; color: var(--sim-ink-soft); font-size: 0.98rem; max-width: 70ch; }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; list-style: none; margin: 0; padding: 0; }
.tiles li { display: flex; margin: 0; padding: 0; max-width: none; }
.tiles li::before { content: none; }
.tile {
  width: 100%; display: grid; grid-template-rows: auto 1fr auto;
  background: var(--sim-panel); border: 1px solid var(--sim-line); border-radius: var(--sim-radius-card); overflow: hidden;
  color: inherit; text-decoration: none; transition: transform 180ms cubic-bezier(0.32, 0.72, 0, 1);
}
a.tile:hover { transform: translateY(-2px); }
/* the simulators' canvas: dots on the panel */
.tile svg {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 7; border-bottom: 1px solid var(--sim-line-soft);
  background-image: radial-gradient(var(--sim-grid-dot) 1px, transparent 1.2px); background-size: 16px 16px; background-position: 8px 8px;
}
.tile-body { padding: 0.9rem 1rem 0.3rem; }
.tile h3 { margin: 0; font: 600 1.22rem/1.25 var(--sim-serif); color: var(--sim-ink); }
.tile p { margin: 0.3rem 0 0; font-size: 0.9rem; line-height: 1.5; color: var(--sim-ink-soft); }
.tile-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; padding: 0.7rem 1rem 0.9rem; font: 400 0.74rem/1.3 var(--sim-mono); color: var(--sim-ink-soft); }
.state { padding: 0.28rem 0.6rem; border-radius: var(--sim-radius-button); border: 1px solid var(--sim-line); background: var(--sim-panel); color: var(--sim-ink); white-space: nowrap; }
.state.live { background: var(--sim-accent); border-color: var(--sim-accent); color: var(--sim-on-accent); }
.tile.idea { background: transparent; border-style: dashed; }
.tile.idea .state { border-style: dashed; color: var(--sim-ink-soft); background: transparent; }

/* Drawing parts: the kit's square (a task or a byte), its slot, and the lines between. */
.tile svg .sq { filter: drop-shadow(0 1px 1.5px rgba(23, 29, 38, 0.28)); }
.tile svg text { font: 500 13px var(--sim-serif); fill: #ffffff; text-anchor: middle; dominant-baseline: central; }
.tile svg text.mono { font: 400 9px var(--sim-mono); fill: var(--sim-ink-soft); }
.tile svg .slot { fill: var(--sim-panel); stroke: var(--sim-line); stroke-width: 1; stroke-dasharray: 3 3; }
.tile svg .cell { fill: var(--sim-sunk); }
.tile svg .wire { fill: none; stroke: var(--sim-ink-soft); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.tile svg .faint { fill: none; stroke: var(--sim-line); stroke-width: 1.2; stroke-linecap: round; }
.tile svg .head { fill: var(--sim-ink-soft); }

.hub-foot { margin-top: 3rem; padding-top: 1.1rem; border-top: 1px solid var(--sim-line-soft); color: var(--sim-ink-soft); font-size: 0.9rem; max-width: 74ch; }

@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr; } .hub h1 { font-size: 2.3rem; } }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } a.tile:hover { transform: none; } }

/* The strip of live pieces on the home page. */
.home-explainers { margin-top: 2.75rem; }
.home-explainers-intro { margin: 0 0 1.1rem; color: var(--muted); max-width: 62ch; }
.home-explainers .tile h3 { font-size: 1.1rem; }
