/*
 * Layouts for product sites that have one of their own (data/microsites.mjs).
 *
 * Loaded after microsites.css, and only on those sites. The masthead, colophon,
 * buttons, type scale and the shared sections all come from microsites.css;
 * this sheet changes the ground a site stands on and styles the parts that
 * only one kind of product needs.
 *
 *   1. Light grounds, for the app, paper and hardware layouts
 *   2. Tool
 *   3. App
 *   4. Paper
 *   5. Less motion
 *   6. Pieces every layout uses
 *   7. Hardware
 *   8. Game
 *   9. Local
 *  10. Inner pages, per layout
 */

/* ── 1. Light grounds ─────────────────────────────────────────────────────── */

/* The ground tokens themselves are swapped at build time, in
   paletteForLayout() (src/templates/microsite-layouts.mjs), because the
   palette is an inline style on <html> that no rule here could override. */
html[data-layout='app'],
html[data-layout='paper'],
html[data-layout='hardware'] {
  color-scheme: light;
}

/* On a paper ground the inverted section has to be told apart some other way. */
html[data-layout='app'] .paper,
html[data-layout='paper'] .paper,
html[data-layout='hardware'] .paper {
  background: var(--paper-deep);
}

/* ── 2. Tool ──────────────────────────────────────────────────────────────── */

html[data-layout='tool'] {
  --tool-glow: color-mix(in srgb, var(--accent) 16%, transparent);
}

.tool-hero {
  position: relative;
  padding-block: clamp(4rem, 10vw, 8rem) clamp(3rem, 6vw, 5rem);
  overflow: hidden;
  background:
    radial-gradient(60rem 30rem at 85% -10%, var(--tool-glow), transparent 70%),
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 100% 2.25rem;
  border-bottom: 1px solid var(--line-soft);
}

.tool-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}

.tool-hero__meta span {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.tool-hero__meta span:first-child {
  border-color: var(--accent);
  color: var(--accent);
}

.tool-hero__name {
  margin: var(--s3) 0 0;
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(3rem, 11vw, 8.5rem);
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.tool-hero__caret {
  display: inline-block;
  width: 0.5em;
  height: 0.08em;
  margin-left: 0.08em;
  background: var(--accent);
  vertical-align: baseline;
  animation: caret 1.05s steps(1) infinite;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

.tool-hero__promise {
  max-width: 34rem;
  margin: var(--s3) 0 var(--s4);
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.tool-hero__note {
  max-width: 46rem;
  margin-top: var(--s2);
  color: var(--dim);
  font-size: 0.9rem;
}

.tool-hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s3);
}

/* Install tabs: radios and labels, so they work with no script at all. */
.itabs {
  display: flex;
  flex-wrap: wrap;
  max-width: 46rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sink);
  overflow: hidden;
}

.itabs input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.itabs label {
  padding: 0.7rem 1rem;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.itabs label:hover {
  color: var(--text);
}

.itabs input:checked + label {
  background: var(--raise);
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.itabs input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.itabs__panel {
  display: none;
  order: 99;
  width: 100%;
  align-items: center;
  gap: var(--s2);
  padding: 1rem 1.1rem;
}

.itabs input:checked + label + .itabs__panel {
  display: flex;
}

.itabs__panel code {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: none;
  color: var(--text);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.itabs__panel code::before {
  content: '$ ';
  color: var(--accent);
}

.itabs__copy {
  flex: none;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--dim);
  font: 500 0.72rem var(--mono);
  cursor: pointer;
}

.itabs__copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* The capture figure. */
.cap {
  margin: 0;
}

.cap__stage {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--s3);
}

.cap-win,
.cap-log {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sink);
  overflow: hidden;
}

.cap-win__bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--dim);
  font: 0.72rem var(--mono);
}

.cap-win__bar i {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--line);
}

.cap-win__bar span {
  margin-left: 0.4rem;
}

.cap-win__rec {
  margin-left: auto;
  color: var(--accent);
  font-weight: 500;
}

.cap-win__rec::before {
  content: '';
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.05em;
  animation: rec 1.6s ease-in-out infinite;
}

@keyframes rec {
  50% {
    opacity: 0.25;
  }
}

.cap-win__body {
  height: 19rem;
  margin: 0;
  padding: 1rem 1.1rem;
  overflow: hidden;
  color: var(--text);
  font: 0.78rem/1.6 var(--mono);
  white-space: pre;
}

.cap-win__flash {
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: inherit;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  opacity: 0;
  pointer-events: none;
}

.cap.is-flash .cap-win__flash {
  animation: shutter 520ms var(--ease) forwards;
}

@keyframes shutter {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.t-prompt,
.t-ok,
.t-spin {
  color: var(--accent);
}

.t-dim {
  color: var(--dim);
}

.cap-log__file {
  margin: 0;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--dim);
  font: 0.7rem var(--mono);
  overflow-wrap: anywhere;
}

.cap-log__lines {
  margin: 0;
  padding: 0.8rem 0.9rem;
  list-style: none;
  font: 0.72rem/1.55 var(--mono);
}

.cap-log__lines li {
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--line-soft);
  overflow-wrap: anywhere;
}

.cap-log__lines li:last-child {
  border-bottom: 0;
}

/* Lines and stills are in the markup from the start. With the script running,
   they wait for their moment in the session; without it, they simply show. */
.cap.is-live .cap-log__lines li,
.cap.is-live .cap-still {
  opacity: 0.12;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.cap.is-live .cap-log__lines li.is-in,
.cap.is-live .cap-still.is-in {
  opacity: 1;
}

.cap.is-live .cap-still {
  transform: translateY(6px);
}

.cap.is-live .cap-still.is-in {
  transform: none;
}

.j-k {
  color: var(--dim);
}

.j-s {
  color: var(--text);
}

.j-n {
  color: var(--counter);
}

.j-kind {
  padding: 0 0.25em;
  border-radius: 3px;
  background: var(--accent-wash);
  color: var(--accent);
}

.cap__foot {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--s3);
  margin-top: var(--s3);
}

.cap-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cap-still {
  display: grid;
  gap: 0.35rem;
}

.cap-still__shot {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sink);
  overflow: hidden;
}

.cap-still__shot pre {
  width: 400%;
  margin: 0;
  padding: 0.9rem 1rem;
  color: var(--text);
  font: 0.78rem/1.6 var(--mono);
  white-space: pre;
  transform: scale(0.25);
  transform-origin: 0 0;
}

.cap-still__kind {
  color: var(--accent);
  font: 500 0.72rem var(--mono);
}

.cap-still__time {
  color: var(--dim);
  font: 0.7rem var(--mono);
}

.cap-count {
  display: grid;
  gap: var(--s2);
  align-content: start;
  margin: 0;
}

.cap-count div {
  padding: var(--s2) 0;
  border-top: 1px solid var(--line);
}

.cap-count dt {
  color: var(--dim);
  font: 0.72rem var(--mono);
  letter-spacing: 0.04em;
}

.cap-count dd {
  margin: 0.3rem 0 0;
  font-size: 1.1rem;
}

.cap-count dd span {
  font-family: var(--mono);
  font-size: 2.2rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.cap-count div:last-child dd span {
  color: var(--accent);
}

.cap figcaption {
  max-width: 48rem;
  margin-top: var(--s3);
  color: var(--dim);
  font-size: 0.85rem;
}

/* Kinds of event. */
.kinds {
  display: grid;
  /* As many columns as fit, so three items fill a row as neatly as five. */
  grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
  overflow: hidden;
}

.kinds li {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  padding: var(--s3);
  background: var(--bg);
}

.kinds code {
  justify-self: start;
  background: var(--accent-wash);
  color: var(--accent);
  font-size: 0.75rem;
}

.kinds h3 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.kinds p {
  margin: 0;
  color: var(--dim);
  font-size: 0.92rem;
}

.tool-out__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--s5);
  align-items: center;
}

.tool-out__grid h2 {
  margin-top: var(--s2);
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
}

.tool-tree {
  margin: 0;
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sink);
  color: var(--text);
  font: 0.85rem/1.7 var(--mono);
  white-space: pre;
  overflow-x: auto;
}

@media (max-width: 60rem) {
  .cap__stage,
  .cap__foot,
  .tool-out__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cap-win__body {
    height: 15rem;
    font-size: 0.7rem;
  }
}

/* ── 3. App ───────────────────────────────────────────────────────────────── */

.app-hero {
  padding-block: clamp(3.5rem, 8vw, 7rem);
  background:
    radial-gradient(50rem 26rem at 100% 0%, var(--accent-wash), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}

.app-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.app-hero h1 {
  margin: var(--s2) 0 0;
  font-size: clamp(3.4rem, 9vw, 7rem);
  letter-spacing: -0.06em;
}

.app-hero__promise {
  max-width: 28rem;
  margin: var(--s3) 0 var(--s2);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.35;
  letter-spacing: -0.015em;
}

/* The journal entry. */
.jl {
  display: grid;
  gap: var(--s2);
  margin: 0;
}

.jl__card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--raise);
  box-shadow:
    0 1px 0 var(--line),
    0 24px 48px -24px color-mix(in srgb, var(--paper-ink) 30%, transparent);
  overflow: hidden;
}

.jl__head {
  display: flex;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.jl__no {
  color: var(--dim);
  font: 0.8rem var(--mono);
}

.jl__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.9rem 1.2rem 0;
}

.jl__presets button {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font: 500 0.8rem var(--ui);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.jl__presets button:hover {
  border-color: var(--accent);
  color: var(--text);
}

.jl__presets button[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent);
}

.jl__lines {
  width: 100%;
  margin-top: 0.6rem;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.jl__lines th,
.jl__lines td {
  padding: 0.55rem 1.2rem;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

.jl__lines thead th {
  color: var(--dim);
  font: 500 0.7rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.jl__lines td {
  width: 8.5rem;
  text-align: right;
}

.jl__lines thead th:not(:first-child) {
  text-align: right;
}

.jl__lines tbody th {
  font-weight: 500;
}

.jl__lines input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--sink);
  color: var(--text);
  font: 0.92rem var(--mono);
  text-align: right;
}

.jl__lines input:hover {
  border-color: var(--line);
}

.jl__lines input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.jl__lines tfoot th,
.jl__lines tfoot td {
  border-bottom: 0;
  font: 600 0.92rem var(--mono);
}

.jl__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: 0.9rem 1.2rem 1.1rem;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.jl__state {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent);
}

.jl__state::before {
  content: '✓';
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.75rem;
}

.jl__state[data-ok='false'] {
  color: #a3361c;
}

.jl__state[data-ok='false']::before {
  content: '!';
  background: #a3361c;
}

.jl__post:disabled {
  opacity: 0.4;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

.jl__book {
  padding: 0.9rem 1.2rem;
  border: 1px dashed var(--line);
  border-radius: 14px;
}

.jl__booktitle {
  display: flex;
  justify-content: space-between;
  margin: 0 0 0.6rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.jl__booktitle span {
  color: var(--dim);
  font: 0.78rem var(--mono);
}

.jl__posted {
  display: grid;
  gap: 0.35rem;
  max-height: 9.5rem;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.jl__posted li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  background: var(--raise);
  font-size: 0.85rem;
  animation: jl-in 0.4s var(--ease);
}

.jl__posted li.jl__empty {
  display: block;
  background: none;
  color: var(--dim);
  animation: none;
}

.jl__posted li.is-reversed .jl__what,
.jl__posted li.is-reversed .jl__amt {
  color: var(--dim);
  text-decoration: line-through;
}

.jl__posted li.is-reversal .jl__amt::before {
  content: '−';
}

@keyframes jl-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.jl__je,
.jl__amt {
  font: 0.8rem var(--mono);
}

.jl__je {
  color: var(--accent);
}

.jl__rev {
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--dim);
  font: 500 0.72rem var(--ui);
  cursor: pointer;
}

.jl__rev:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.jl figcaption {
  color: var(--dim);
  font-size: 0.82rem;
}

/* The cycle, as numbered steps along one rule. */
.cycle {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--s3);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.cycle li {
  position: relative;
  padding-top: var(--s3);
  border-top: 2px solid var(--line);
}

.cycle li::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  width: 2.5rem;
  height: 2px;
  background: var(--accent);
}

.cycle__n {
  color: var(--accent);
  font: 500 0.75rem var(--mono);
}

.cycle h3 {
  margin: 0.5rem 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.cycle p {
  margin: 0;
  color: var(--dim);
  font-size: 0.92rem;
}

.app-reports__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s5);
  align-items: center;
}

.app-reports__grid h2 {
  margin-top: var(--s2);
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
}

.reportlist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reportlist li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raise);
  font-weight: 600;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}

.reportlist li::before {
  content: '';
  width: 1.1rem;
  height: 1.3rem;
  border: 1.5px solid var(--accent);
  border-radius: 2px;
  background: linear-gradient(var(--accent) 0 0) 50% 35% / 60% 1.5px no-repeat,
    linear-gradient(var(--accent) 0 0) 50% 60% / 60% 1.5px no-repeat;
}

.reportlist li:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}


@media (max-width: 64rem) {
  .app-hero__grid,
  .app-reports__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cycle {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 40rem) {
  .cycle,
  .reportlist {
    grid-template-columns: minmax(0, 1fr);
  }

  .jl__lines th,
  .jl__lines td {
    padding: 0.5rem 0.7rem;
  }

  .jl__lines td {
    width: 6.5rem;
  }
}

/* ── 4. Paper ─────────────────────────────────────────────────────────────── */

html[data-layout='paper'] body {
  font-size: 1.05rem;
}

.pp-col {
  max-width: 46rem;
}

.pp-head {
  padding-block: clamp(4rem, 10vw, 8rem) var(--s5);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.pp-head .pp-col {
  margin-inline: auto;
}

.pp-head__kind {
  margin: 0;
  color: var(--accent);
  font: 500 0.72rem var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pp-head h1 {
  margin: var(--s3) 0 var(--s2);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.2rem, 10vw, 7rem);
  letter-spacing: -0.035em;
  line-height: 1;
}

.pp-head__sub {
  max-width: 32rem;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  font-style: italic;
  line-height: 1.3;
  color: var(--dim);
}

.pp-head__by {
  margin-top: var(--s3);
  color: var(--dim);
  font: 0.75rem var(--mono);
  letter-spacing: 0.04em;
}

.pp > .wrap {
  margin-inline: auto;
  padding-block: var(--s5) var(--s6);
}

.pp-abstract {
  padding: var(--s3) var(--s4);
  border-left: 3px solid var(--accent);
  background: var(--raise);
}

.pp-abstract h2,
.pp-toc h2 {
  margin: 0 0 0.6rem;
  font: 600 0.72rem var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.pp-abstract p {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.55;
}

.pp-toc {
  margin: var(--s4) 0 var(--s2);
}

.pp-toc ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pp-toc a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 0.25em;
}

.pp-toc a:hover {
  text-decoration-color: var(--accent);
}

.pp-sec {
  padding-top: var(--s5);
  scroll-margin-top: 5rem;
}

.pp-sec h2 {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin: 0 0 var(--s3);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  letter-spacing: -0.02em;
}

.pp-sec__n {
  color: var(--accent);
  font: 500 0.9rem var(--mono);
}

.pp-sec > p {
  font-family: var(--serif);
  font-size: 1.22rem;
  line-height: 1.65;
}

.pp-callout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: var(--s3);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.pp-callout > div {
  padding: var(--s3);
}

.pp-callout > div + div {
  border-left: 1px solid var(--line);
  background: var(--raise);
}

.pp-callout h3 {
  margin: 0 0 0.5rem;
  font: 600 0.72rem var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.pp-callout > div + div h3 {
  color: var(--dim);
}

.pp-callout p {
  margin: 0;
  line-height: 1.6;
}

.pp-table,
.ks__compare {
  width: 100%;
  margin-top: var(--s3);
  border-collapse: collapse;
  font-size: 0.95rem;
}

.pp-table th,
.pp-table td,
.ks__compare th,
.ks__compare td {
  padding: 0.75rem 0.9rem 0.75rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.pp-table thead th,
.ks__compare thead th {
  border-bottom: 2px solid var(--text);
  font: 600 0.7rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pp-table tbody th {
  width: 7rem;
  font-weight: 600;
}

/* Fig. 1: the keystroke figure. Wider than the text column, the way a paper
   lets a table run into the margins, and centred on it. */
.ks {
  position: relative;
  left: 50%;
  width: min(62rem, calc(100vw - 2 * var(--gutter)));
  transform: translateX(-50%);
  margin: var(--s4) 0 0;
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raise);
}

.ks__compare {
  margin-top: 0;
}

.ks__compare tbody th {
  font-weight: 500;
  white-space: nowrap;
}

.ks__compare td:nth-child(3) {
  line-height: 1.9;
}

.tok {
  display: inline-block;
  min-width: 1.6em;
  margin: 0 0.15rem 0.15rem 0;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  font: 0.8rem var(--mono);
  text-align: center;
}

.tok--del {
  border-color: var(--counter-deep);
  background: color-mix(in srgb, var(--counter) 22%, var(--paper));
  color: var(--paper-ink);
}

.ks__hash {
  background: var(--accent-wash);
  color: var(--accent);
  white-space: nowrap;
}

.ks__try {
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px dashed var(--line);
}

.ks__try label {
  display: block;
  font-weight: 600;
}

.ks__row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.ks__row input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: 1.05rem var(--mono);
}

.ks__row input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.ks__row button {
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: 500 0.85rem var(--ui);
  cursor: pointer;
}

.ks__row button:hover {
  border-color: var(--accent);
}

.ks__tokens {
  min-height: 2.2rem;
  margin: var(--s2) 0 0;
}

.ks__tokens .tok {
  animation: tok-in 0.22s var(--ease);
}

@keyframes tok-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.9);
  }
}

.ks__hint {
  color: var(--dim);
  font-size: 0.9rem;
}

.ks__out {
  margin: 0.4rem 0 0;
  color: var(--dim);
  font-size: 0.9rem;
}

.ks figcaption {
  margin-top: var(--s3);
  color: var(--dim);
  font-size: 0.88rem;
  line-height: 1.6;
}

@media (max-width: 40rem) {
  .pp-callout {
    grid-template-columns: minmax(0, 1fr);
  }

  .pp-callout > div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .ks {
    padding: var(--s2);
  }

  .ks__compare thead {
    display: none;
  }

  .ks__compare tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--line);
  }

  .ks__compare th,
  .ks__compare td {
    padding: 0.2rem 0;
    border: 0;
  }
}

/* ── 5. Less motion ───────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .tool-hero__caret,
  .cap-win__rec::before {
    animation: none;
  }

  .jl__posted li,
  .ks__tokens .tok {
    animation: none;
  }

  .reportlist li:hover {
    transform: none;
  }
}

/* ── 6. Pieces every layout uses ──────────────────────────────────────────── */

.lay-split__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--s5);
  align-items: center;
}

.lay-split__grid h2 {
  margin-top: var(--s2);
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
}

.lay-n {
  color: var(--accent);
  font: 500 0.72rem var(--mono);
  letter-spacing: 0.06em;
}

.lay-state {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
}

.lay-state::before {
  content: '';
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: currentColor;
}

/* The features list, in each layout's own shape. All share the markup:
   <li><span class="lay-n"/><h3/><p/></li>. */
.kinds .lay-n,
.cycle .lay-n {
  display: block;
}

.kinds li {
  gap: 0.5rem;
}

.cycle {
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.hw-notes,
.game-loop,
.local-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A signature with nothing to show yet falls back to the shared drawing. */
.lay-sig .stage,
.lay-sig > .wrap > .demo {
  margin: 0;
}

@media (max-width: 60rem) {
  .lay-split__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── 7. Hardware ──────────────────────────────────────────────────────────── */

/* An engineering drawing: paper on a fine grid, a sheet frame with a title
   block in its corner, and ruled notes. */
html[data-layout='hardware'] {
  --hw-grid: color-mix(in srgb, var(--paper-line) 55%, transparent);
}

html[data-layout='hardware'] body {
  background:
    linear-gradient(var(--hw-grid) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--hw-grid) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--bg);
}

.hw-hero {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
  border-bottom: 1px solid var(--line);
}

.hw-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hw-hero h1 {
  margin: var(--s2) 0 0;
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(2.6rem, 6.5vw, 5.2rem);
  letter-spacing: -0.05em;
  line-height: 1;
  text-transform: uppercase;
}

.hw-hero__promise {
  max-width: 30rem;
  margin: var(--s3) 0 var(--s4);
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  line-height: 1.35;
}

/* The sheet: a double frame, the drawing, and the title block. */
.hw-sheet {
  position: relative;
  padding: 10px;
  border: 1.5px solid var(--text);
  background: var(--raise);
  box-shadow: 0 0 0 4px var(--raise), 0 0 0 5px var(--line);
}

.hw-sheet__draw {
  border: 1px solid var(--line);
  background: var(--bg);
}

.hw-sheet__draw .hero__stage,
.hw-sheet__draw figure {
  margin: 0;
}

.hw-sheet__draw figcaption {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.75rem;
}

.hw-tb {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.9fr) minmax(0, 0.8fr) minmax(0, 1.3fr) minmax(0, 1.2fr);
  margin: 10px 0 0;
  border: 1px solid var(--text);
}

.hw-tb > div {
  padding: 0.45rem 0.6rem;
  border-left: 1px solid var(--line);
}

.hw-tb > div:first-child {
  border-left: 0;
}

.hw-tb dt {
  color: var(--dim);
  font: 500 0.6rem var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hw-tb dd {
  margin: 0.15rem 0 0;
  font: 500 0.8rem var(--mono);
  overflow-wrap: break-word;
}

.hw-tb__title dd {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 0.95rem;
}

.hw-band {
  background: var(--raise);
  border-block: 1px solid var(--line);
}

/* Notes, numbered as a drawing numbers them. */
.hw-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1.5px solid var(--text);
}

.hw-notes li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: var(--s2);
  padding: var(--s3) var(--s2) var(--s3) 0;
  border-bottom: 1px solid var(--line);
}

.hw-notes li:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.hw-notes li:nth-child(even) {
  padding-left: var(--s3);
}

.hw-notes .lay-n {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  font-size: 0.75rem;
}

.hw-notes h3 {
  margin: 0.25rem 0 0.4rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.hw-notes p {
  margin: 0;
  color: var(--dim);
  font-size: 0.92rem;
}

@media (max-width: 64rem) {
  .hw-hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 46rem) {
  .hw-notes {
    grid-template-columns: minmax(0, 1fr);
  }

  .hw-notes li:nth-child(odd) {
    border-right: 0;
  }

  .hw-notes li:nth-child(even) {
    padding-left: 0;
  }

  .hw-tb {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hw-tb > div {
    border-top: 1px solid var(--line);
  }

  .hw-tb__title {
    grid-column: 1 / -1;
    border-top: 0;
  }

  .hw-tb > div:nth-child(even) {
    border-left: 0;
  }
}

/* ── 8. Game ──────────────────────────────────────────────────────────────── */

/* Dark, saturated, and big: the art leads and the type shouts a little. */
.game-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4rem, 9vw, 7.5rem);
  background:
    radial-gradient(45rem 30rem at 80% 30%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%),
    radial-gradient(35rem 25rem at 10% 110%, color-mix(in srgb, var(--counter) 22%, transparent), transparent 70%),
    var(--bg);
}

.game-hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 6px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 14px, transparent 14px 28px);
  opacity: 0.6;
}

.game-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.game-hero__tag {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
}

.game-hero__tag > * {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font: 600 0.75rem var(--ui);
  letter-spacing: 0.02em;
}

.game-hero h1 {
  margin: var(--s3) 0 0;
  font-size: clamp(2.6rem, 5.4vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.92;
  overflow-wrap: break-word;
  background: linear-gradient(180deg, var(--text) 30%, var(--accent-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.game-hero__promise {
  max-width: 30rem;
  margin: var(--s3) 0 var(--s4);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.4;
}

.game-hero__stage .hero__stage,
.game-hero__stage figure {
  margin: 0;
}

.game-hero__stage > figure,
.game-hero__stage > .hero__stage {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--accent) 50%, transparent);
}

.game-band {
  background: var(--raise);
}

.game-loop {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--s2);
}

.game-loop li {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  padding: var(--s3);
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--raise);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}

.game-loop li:hover {
  border-color: var(--accent);
  transform: translateY(-3px) rotate(-0.4deg);
}

.game-loop .lay-n {
  justify-self: start;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.game-loop h3 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.game-loop p {
  margin: 0;
  color: var(--dim);
  font-size: 0.92rem;
}

@media (max-width: 60rem) {
  .game-hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── 9. Local ─────────────────────────────────────────────────────────────── */

/* Warm and close: software that lives on your own desk. A soft lamp-light
   glow, rounded device frames, and a status light that says "on". */
html[data-layout='local'] {
  --local-glow: color-mix(in srgb, var(--accent) 18%, transparent);
}

.local-hero {
  padding-block: clamp(4rem, 9vw, 7rem);
  background:
    radial-gradient(40rem 26rem at 70% 20%, var(--local-glow), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--line-soft);
}

.local-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.local-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0.4rem 0.85rem 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font: 500 0.78rem var(--ui);
}

.local-hero__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
  animation: local-on 2.4s ease-in-out infinite;
}

@keyframes local-on {
  50% {
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 6%, transparent);
  }
}

.local-hero h1 {
  margin: var(--s3) 0 0;
  font-size: clamp(3rem, 7.5vw, 6rem);
  letter-spacing: -0.055em;
}

.local-hero__promise {
  max-width: 30rem;
  margin: var(--s3) 0 var(--s2);
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.3vw, 1.75rem);
  line-height: 1.3;
}

.local-hero__stage > figure,
.local-hero__stage > .hero__stage {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--raise);
  padding: 12px;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.6);
}

.local-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s2);
}

.local-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--s2);
  padding: var(--s3);
  border-radius: 16px;
  background: var(--raise);
}

.local-list .lay-n {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  background: var(--accent-wash);
}

.local-list h3 {
  margin: 0.2rem 0 0.35rem;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.local-list p {
  margin: 0;
  color: var(--dim);
  font-size: 0.92rem;
}

@media (max-width: 60rem) {
  .local-hero__grid,
  .local-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .local-hero__dot {
    animation: none;
  }

  .game-loop li:hover {
    transform: none;
  }
}

/* ── 10. Inner pages, per layout ──────────────────────────────────────────── */

/* Every page past the splash is built from the same blocks: a page head, a
   document with an index, a legal index, a FAQ, a roadmap track, a gallery
   stage and the call to action. Each layout reshapes those blocks so a site
   reads as one piece from the splash to the privacy policy. */

/* Tool: a manual. Mono heads, a prompt above each title, a terminal frame
   around the gallery, and an index that reads like `ls`. */
html[data-layout='tool'] .pagehead {
  background: linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 100% 2.25rem;
}

.ph-prompt {
  margin: var(--s3) 0 0;
  color: var(--dim);
  font: 0.85rem var(--mono);
}

.ph-prompt span {
  color: var(--accent);
}

html[data-layout='tool'] .pagehead h1 {
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: -0.05em;
}

html[data-layout='tool'] .doc__body h2 {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: -0.03em;
}

html[data-layout='tool'] .doc__body h2::before {
  content: '## ';
  color: var(--accent);
}

html[data-layout='tool'] .doc__index a {
  font-family: var(--mono);
  font-size: 0.8rem;
}

html[data-layout='tool'] .docindex a {
  font-family: var(--mono);
}

html[data-layout='tool'] .docindex strong {
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

html[data-layout='tool'] .docindex strong::before {
  content: '-rw-r--r--  ';
  color: var(--dim);
  font-size: 0.8rem;
}

html[data-layout='tool'] .stage {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sink);
  overflow: hidden;
}

html[data-layout='tool'] .stage::before {
  content: '●  ●  ●';
  display: block;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--line);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
}

html[data-layout='tool'] .faq summary {
  font-family: var(--mono);
  font-weight: 500;
}

html[data-layout='tool'] .faq summary::before {
  content: '? ';
  color: var(--accent);
}

html[data-layout='tool'] .track__when {
  font-family: var(--mono);
}

/* App: a help centre. Soft cards, rounded corners, and the index as tiles. */
html[data-layout='app'] .pagehead {
  background: radial-gradient(50rem 22rem at 100% 0%, var(--accent-wash), transparent 70%);
}

html[data-layout='app'] .pagehead::before {
  display: none;
}

html[data-layout='app'] .doc__body {
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--raise);
}

html[data-layout='app'] .docindex {
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: var(--s2);
  background: none;
  border: 0;
}

html[data-layout='app'] .docindex a {
  grid-template-columns: minmax(0, 1fr);
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--raise);
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

html[data-layout='app'] .docindex a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

html[data-layout='app'] .faq details {
  margin-bottom: 0.6rem;
  padding-inline: var(--s3);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--raise);
}

html[data-layout='app'] .track > li {
  margin-bottom: var(--s2);
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--raise);
}

html[data-layout='app'] .stage,
html[data-layout='app'] .plate {
  border-radius: 16px;
  overflow: hidden;
}

/* Paper: a document. Centred serif heads, numbered sections, the index as a
   table of contents, and appendix letters on the legal documents. */
.ph-paper {
  margin: var(--s3) 0 0;
  color: var(--accent);
  font: 500 0.72rem var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

html[data-layout='paper'] .pagehead {
  text-align: center;
}

html[data-layout='paper'] .pagehead::before {
  display: none;
}

html[data-layout='paper'] .pagehead .wrap {
  display: grid;
  justify-items: center;
}

html[data-layout='paper'] .pagehead h1 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.03em;
}

html[data-layout='paper'] .pagehead .lead {
  max-width: 36rem;
  font-family: var(--serif);
  font-style: italic;
}

html[data-layout='paper'] .doc__body {
  counter-reset: pp;
  font-family: var(--serif);
  font-size: 1.12rem;
}

html[data-layout='paper'] .doc__body h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
}

html[data-layout='paper'] .doc__body section {
  counter-increment: pp;
}

html[data-layout='paper'] .doc__body h2::before {
  content: counter(pp) '  ';
  color: var(--accent);
  font: 500 0.9rem var(--mono);
  vertical-align: 0.25em;
}

html[data-layout='paper'] .docindex {
  counter-reset: appx;
}

html[data-layout='paper'] .docindex a {
  counter-increment: appx;
}

html[data-layout='paper'] .docindex strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.4rem;
}

html[data-layout='paper'] .docindex strong::before {
  content: 'Appendix ' counter(appx, upper-alpha) '. ';
  display: block;
  color: var(--accent);
  font: 500 0.7rem var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

html[data-layout='paper'] .faq summary {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
}

/* Hardware: drawing sheets. Each page carries a title block, documents are
   numbered notes, and the index is a drawing list. */
html[data-layout='hardware'] .pagehead::before {
  display: none;
}

html[data-layout='hardware'] .pagehead h1 {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.hw-tb--page {
  max-width: 46rem;
  margin-top: var(--s4);
  background: var(--raise);
}

html[data-layout='hardware'] .doc__body {
  counter-reset: note;
}

html[data-layout='hardware'] .doc__body section {
  counter-increment: note;
  padding-left: 3rem;
  position: relative;
}

html[data-layout='hardware'] .doc__body h2::before {
  content: counter(note);
  position: absolute;
  left: 0;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font: 500 0.75rem var(--mono);
}

html[data-layout='hardware'] .docindex {
  border-top: 1.5px solid var(--text);
  background: var(--line);
  counter-reset: dwg;
}

html[data-layout='hardware'] .docindex a {
  counter-increment: dwg;
  background: var(--raise);
}

html[data-layout='hardware'] .docindex strong::before {
  content: 'DWG ' counter(dwg, decimal-leading-zero) '  ';
  color: var(--accent);
  font: 500 0.72rem var(--mono);
}

html[data-layout='hardware'] .stage,
html[data-layout='hardware'] .plate {
  border: 1.5px solid var(--text);
  background: var(--raise);
}

html[data-layout='hardware'] .faq details {
  border-bottom: 1px solid var(--line);
}

/* Game: bold panels, chunky borders, the accent turned up. */
html[data-layout='game'] .pagehead {
  background:
    radial-gradient(40rem 20rem at 85% 0%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%),
    var(--bg);
}

html[data-layout='game'] .pagehead h1 {
  font-weight: 800;
  letter-spacing: -0.055em;
}

html[data-layout='game'] .doc__body section {
  margin-bottom: var(--s2);
  padding: var(--s3);
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--raise);
}

html[data-layout='game'] .doc__body section + section {
  border-top: 2px solid var(--line);
}

html[data-layout='game'] .docindex {
  gap: var(--s2);
  background: none;
  border: 0;
}

html[data-layout='game'] .docindex a {
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--raise);
}

html[data-layout='game'] .docindex a:hover {
  border-color: var(--accent);
}

html[data-layout='game'] .faq details {
  margin-bottom: 0.6rem;
  padding-inline: var(--s3);
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--raise);
}

html[data-layout='game'] .stage,
html[data-layout='game'] .plate {
  border-radius: 18px;
  overflow: hidden;
}

/* Local: warm cards with soft corners, and a status light on the head. */
html[data-layout='local'] .pagehead::before {
  inset: -60% -10% 30% 40%;
}

html[data-layout='local'] .pagehead h1::after {
  content: '';
  display: inline-block;
  width: 0.18em;
  height: 0.18em;
  margin-left: 0.25em;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.6em;
  box-shadow: 0 0 0 0.08em color-mix(in srgb, var(--accent) 25%, transparent);
}

html[data-layout='local'] .doc__body {
  padding: var(--s4);
  border-radius: 20px;
  background: var(--raise);
}

html[data-layout='local'] .docindex {
  gap: var(--s2);
  background: none;
  border: 0;
}

html[data-layout='local'] .docindex a {
  border-radius: 16px;
  background: var(--raise);
}

html[data-layout='local'] .faq details {
  margin-bottom: 0.6rem;
  padding-inline: var(--s3);
  border-radius: 14px;
  background: var(--raise);
}

html[data-layout='local'] .stage,
html[data-layout='local'] .plate {
  border-radius: 20px;
  overflow: hidden;
}

@media (max-width: 46rem) {
  html[data-layout='hardware'] .doc__body section {
    padding-left: 2.6rem;
  }

  html[data-layout='app'] .doc__body,
  html[data-layout='local'] .doc__body {
    padding: var(--s3);
  }
}

/* The gallery, where a product's own piece replaces the shared drawing. */
.gallery-sig__title {
  margin: 0 0 var(--s2);
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
}

/* A highlight in any layout's list: one sentence, set as the item's text. */
ol > li > .lay-feat {
  margin: 0;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

/* Chips default to the paper style, because the specification sheet they were
   made for is a paper section. Anywhere else they take the page's own ground. */
.section:not(.paper) .chips li {
  border-color: var(--line);
  color: var(--accent-soft);
}

/* Product names in the heroes are sized to fit their column. Each h1 carries
   its name's length as --n, and its column is a size container, so a long
   one-word name (Honeycomb, CRATEWAVE, Mission City Motorsport) gets smaller
   instead of breaking mid-word. The factor is roughly each face's average
   glyph width in em at that weight and tracking. */
.tool-hero > .wrap,
.app-hero__copy,
.hw-hero__copy,
.game-hero__copy,
.local-hero__copy {
  container-type: inline-size;
}

.tool-hero__name {
  font-size: min(clamp(3rem, 11vw, 8.5rem), calc(100cqi / (var(--n, 8) * 0.62)));
}

.app-hero h1 {
  font-size: min(clamp(3.4rem, 9vw, 7rem), calc(100cqi / (var(--n, 8) * 0.58)));
}

.hw-hero h1 {
  font-size: min(clamp(2.6rem, 6.5vw, 5.2rem), calc(100cqi / (var(--n, 8) * 0.64)));
}

.game-hero h1 {
  font-size: min(clamp(2.6rem, 5.4vw, 6rem), calc(100cqi / (var(--n, 8) * 0.66)));
}

.local-hero h1 {
  font-size: min(clamp(3rem, 7.5vw, 6rem), calc(100cqi / (var(--n, 8) * 0.58)));
}

/* A tool's hero is type and a command, so it stays short: the interactive
   piece below it should start inside the first screen. */
.tool-hero {
  padding-block: clamp(3.5rem, 7vw, 6rem) clamp(2.5rem, 4vw, 3.5rem);
}

.tool-hero__name {
  font-size: min(clamp(3rem, 9vw, 7rem), calc(100cqi / (var(--n, 8) * 0.62)));
}

.tool-demo {
  padding-top: clamp(2.5rem, 5vw, 4.5rem);
}
