/* 248 Anthems — /labs/tempofinder · "Tempo Finder"
 * Loaded after /css/labs.css; reuses its instrument shell, readout, scale
 * and figure tiles. Only what is new to this page lives here. */

.tf-frame { position: relative; }
.tf-grid { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: clamp(1.4rem, 3.5vw, 2.6rem); align-items: stretch; }

/* the listen button — the same footprint as the tap pad on /labs */
.tf-listen {
  position: relative; width: 100%; min-height: 250px;
  display: grid; place-content: center; justify-items: center; gap: .5rem;
  border: 2px solid var(--lime); background: rgba(204,255,0,.05);
  color: var(--bone); cursor: pointer; user-select: none;
  transition: background .18s ease;
}
.tf-listen:hover { background: rgba(204,255,0,.1); }
.tf-listen[aria-pressed="true"] { background: rgba(204,255,0,.14); }
.tf-listen:disabled { opacity: .5; cursor: wait; }
.tf-ring { width: 92px; height: 92px; }
.tf-ring circle { fill: none; stroke: var(--lime); stroke-width: 2; }
.tf-ring .halo { stroke-opacity: .35; transform-origin: 50% 50%; transition: transform .08s ease-out, stroke-opacity .08s ease-out; }
.tf-ring .core { transform-origin: 50% 50%; transition: transform .08s ease-out; }
.tf-listen.beat .halo { transform: scale(1.22); stroke-opacity: .9; }
.tf-listen.beat .core { transform: scale(1.06); }
.tf-listen[aria-pressed="true"] .halo { animation: tf-breathe 2.4s ease-in-out infinite; }
@keyframes tf-breathe { 0%, 100% { stroke-opacity: .3; } 50% { stroke-opacity: .6; } }
.tf-listen.beat[aria-pressed="true"] .halo { animation: none; }
.tf-listen-label { font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; text-transform: uppercase; letter-spacing: .04em; }
.tf-listen-hint { font-family: var(--font-mono); font-size: .625rem; letter-spacing: .12em; text-transform: uppercase; color: var(--d-dim); text-align: center; padding-inline: 1rem; }

/* the readout column */
.tf-out { display: flex; flex-direction: column; gap: 1.2rem; }
.tf-octave { display: inline-flex; gap: .5rem; margin-left: auto; }
.tf-octave .btn-ghost:disabled { opacity: .35; cursor: default; }
.tf-octave .btn-ghost:disabled:hover { border-color: var(--d-line); color: var(--d-dim); }

.tf-conf { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; }
.tf-conf-label { font-size: .5625rem; letter-spacing: .14em; color: var(--d-dim); min-width: 9ch; }
.tf-conf-track { height: 6px; background: rgba(246,244,241,.13); position: relative; overflow: hidden; }
.tf-conf-fill { position: absolute; inset: 0 auto 0 0; width: 0%; background: var(--d-dim); transition: width .35s ease, background-color .35s ease; }
.tf-conf-fill.fair { background: var(--bone); }
.tf-conf-fill.strong { background: var(--lime); }

#tf-scale { display: block; width: 100%; height: auto; }

/* figure tiles: four across, reusing .rfig from /labs */
.tf-figs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--d-line); border: 1px solid var(--d-line); margin-top: clamp(1.2rem, 2.6vw, 1.8rem); }
.tf-figs[hidden] { display: none; }
.tf-figs .rfig { background: var(--charcoal); }
.tf-figs-dim .rfig b { color: var(--d-dim); font-weight: 600; }
.tf-figs-dim { margin-top: 1px; }
.tf-figs-5 { grid-template-columns: repeat(5, 1fr); }
.tf-figs-5 .rfig:first-child b { color: var(--lime); }

.tap-verdict .warn { color: var(--orange); }

@media (max-width: 980px) { .tf-figs, .tf-figs-5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) { .tf-grid { grid-template-columns: 1fr; } .tf-listen { min-height: 190px; } }
@media (max-width: 560px) { .tf-figs, .tf-figs-5 { grid-template-columns: 1fr; } .tf-octave { margin-left: 0; } }
@media (prefers-reduced-motion: reduce) {
  .tf-listen[aria-pressed="true"] .halo { animation: none; }
  .tf-ring circle { transition: none; }
}
