/* The full demo. Colours, fonts and the shared pieces (header, tags, theme
   switch) come from the CV page's ../../assets/site.css; this file only adds
   what is specific to this page. */

.page { padding-top: 64px; padding-bottom: 96px; }

.page-head { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; }
.page-head h1 { font-size: clamp(32px, 6vw, 44px); max-width: 20ch; text-wrap: balance; }
.page-head .lead { max-width: 62ch; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  min-width: 0; /* let panels shrink inside the grid on narrow screens */
}
.panel h2.label { margin-bottom: 16px; }

.hint { margin: 0; font-size: 14px; line-height: 22px; color: var(--muted); }

.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }

button:not(.theme-toggle) {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font: 400 14px/22px var(--font-mono);
  cursor: pointer;
}
button:not(.theme-toggle):hover { border-color: var(--ink); }
button.danger { color: var(--accent-text); }

/* ---------------------------------------------------------- weights switch */

.model { margin-bottom: 24px; }

.switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}
.switch label { cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span {
  display: block;
  padding: 10px 16px;
  border-radius: 6px;
  color: var(--muted);
  font: 500 13px/20px var(--font-mono);
  white-space: nowrap;
}
.switch label:hover span { color: var(--ink); }
.switch input:checked + span { background: var(--primary); color: var(--on-primary); }
.switch input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 2px; }

.model-text p { margin: 16px 0 0; max-width: 78ch; color: var(--muted); }
.model-text strong { color: var(--ink); font-weight: 500; }

/* ------------------------------------------------------- draw, see, answer */

.stage {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* The drawing surfaces are dark in both themes, like on the CV page. */
#pad, #seen {
  display: block;
  border: 1px solid #6a6882;
  border-radius: 8px;
  background-color: #1b1a28;
}

#pad {
  width: 280px;
  max-width: 100%;
  aspect-ratio: 1;
  background-image: linear-gradient(#2e2c40 1px, transparent 1px), linear-gradient(90deg, #2e2c40 1px, transparent 1px);
  background-size: 12.5% 12.5%;
  cursor: crosshair;
  touch-action: none; /* drawing must not scroll the page */
}

#seen {
  width: 140px;
  height: 140px;
  border-radius: 4px;
  image-rendering: pixelated;
  margin-bottom: 12px;
}

.answer .digit {
  font: 600 clamp(72px, 14vw, 112px)/1 var(--font-display);
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
  min-height: 1em;
}
.answer .digit.unsure { color: var(--line-strong); }
.answer .detail { color: var(--muted); margin-top: 12px; min-height: 3em; }

/* ------------------------------------------------------------ the network */

.network {
  background: #12111c;
  border-color: #2e2c40;
  color: #edecf4;
}
.network .label, .network .hint { color: #a09eb4; }

.network-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
}
.network-head .hint { font-family: var(--font-mono); font-size: 13px; }

#net-wrap { position: relative; }

#net { display: block; width: 100%; touch-action: pan-y; }

#tooltip {
  position: absolute;
  z-index: 2;
  max-width: 240px;
  padding: 12px;
  background: #1b1a28f2;
  border: 1px solid #6a6882;
  border-radius: 8px;
  font-size: 13px;
  line-height: 20px;
  pointer-events: none;
  box-shadow: 0 8px 24px #0008;
}
#tooltip .name { font: 500 15px/22px var(--font-display); }
#tooltip .sub { color: #a09eb4; }
#tooltip canvas {
  display: block;
  width: 112px;
  height: 112px;
  margin-top: 8px;
  border-radius: 4px;
  image-rendering: pixelated;
}
#tooltip ul { list-style: none; margin: 6px 0 0; padding: 0; }
#tooltip li { display: flex; justify-content: space-between; gap: 12px; }
#tooltip .plus { color: #23cbb4; }
#tooltip .minus { color: #a78bfa; }

.legend { margin-top: 12px; }

.swatch {
  display: inline-block;
  width: 18px;
  height: 3px;
  vertical-align: middle;
  border-radius: 2px;
  margin: 0 4px 0 2px;
}
.swatch.warm { background: #23cbb4; }
.swatch.cool { background: #a78bfa; margin-left: 12px; }

/* ---------------------------------------------------------------- the rest */

.dev { margin-top: 24px; border-style: dashed; border-color: var(--line-strong); background: transparent; }
.dev .digits button { min-width: 44px; padding: 0; font-weight: 500; }
.dev pre { overflow-x: auto; margin: 12px 0 0; font: 400 13px/20px var(--font-mono); }

.about {
  margin-top: 64px;
  max-width: 68ch;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--muted);
}
.about h2 { color: var(--ink); font-size: 28px; line-height: 34px; letter-spacing: -0.01em; }

@media (max-width: 760px) {
  .page { padding-top: 40px; }
  .panel { padding: 16px; }
  .stage { grid-template-columns: 1fr 1fr; gap: 16px; }
  .stage .draw { grid-column: 1 / -1; }
  #pad { margin: 0 auto; }
  .stage .draw .row { justify-content: center; }
  #seen { width: 112px; height: 112px; }
}
