/* Styles for /imaging/heart/. Tokens come from site.css; only what this page adds lives here. */

.heart-page {
  max-width: 68rem;
}

.heart-viewer {
  margin: 0 0 2.5rem;
}

.heart-stage {
  position: relative;
  background: linear-gradient(170deg, #11161f 0%, #1d2531 60%, #262d38 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.heart-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

.heart-stage canvas:active {
  cursor: grabbing;
}

.heart-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.heart-btn {
  font: inherit;
  min-height: 44px;
  min-width: 5.5rem;
  padding: 0 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
}

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

.heart-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.heart-phase {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 18rem;
  min-height: 44px;
}

.heart-phase__label {
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
}

.heart-phase input[type="range"] {
  flex: 1;
  min-height: 24px;
  accent-color: var(--accent);
}

.heart-phase input[type="range"]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.heart-status {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

.heart-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.25rem 1.25rem;
  margin-top: 1rem;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  font-size: 0.9375rem;
  cursor: pointer;
}

.toggle input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
  flex: none;
}

.toggle input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.toggle .swatch {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 3px;
  border: 1px solid rgba(28, 36, 48, 0.25);
  flex: none;
}

.toggle .name {
  flex: 1;
}

.toggle .count {
  font-size: 0.8125rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.heart-viewer figcaption {
  margin-top: 0.85rem;
  font-size: 0.875rem;
  color: var(--faint);
}

.heart-method {
  margin: 0 0 2.5rem;
}


.heart-method h2 {
  font-size: 1.25rem;
  margin: 0 0 1rem;
}









.heart-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1.25rem;
  counter-reset: step;
}

.heart-steps li {
  counter-increment: step;
  padding-left: 2.5rem;
  position: relative;
  max-width: 68ch;
}

.heart-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.heart-steps h3 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
}

.heart-steps p {
  margin: 0;
  color: var(--muted);
}

.heart-steps code,
.heart-method code {
  font-size: 0.875em;
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.heart-honest {
  font-size: 1rem;
  margin: 1.75rem 0 0.25rem;
}

.heart-method > p {
  margin: 0;
  color: var(--muted);
  max-width: 68ch;
}

@media (max-width: 40rem) {
  .heart-stage {
    aspect-ratio: 4 / 5;
  }

}

.heart-volume {
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  color: var(--text);
  min-width: 5rem;
  text-align: right;
  white-space: nowrap;
}

.heart-toggles--slices {
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
}

.toggle .swatch--slice {
  background: linear-gradient(135deg, #2c3340 0%, #9aa5b4 50%, #f2f4f7 100%);
}

/* Steps sit side by side as cards. The list stays an <ol> because the order is the pipeline. */
.heart-steps--cards {
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.heart-steps--cards li {
  margin: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.heart-steps--cards li::before {
  position: static;
  margin-bottom: 0.6rem;
}

.heart-steps--cards h3 {
  margin-bottom: 0.4rem;
}

.heart-steps--cards p {
  font-size: 0.9375rem;
}

/* Class names are longer than a card column, so they wrap instead of spilling out of it. */
.heart-steps--cards code {
  overflow-wrap: anywhere;
  word-break: break-word;
}
