/*
  Closing the Loop — shared companion styles (issue #4941): the date-and-location stamp, the info
  button and its dialog, the "while we talked" panel, chips, and the back-pocket deck's scene
  model. Loaded after /site-assets/hapimatic-dark.css and /site-assets/site.css; every token has a
  fallback so a page still reads if the site assets are not served.
*/

.tc {
  --tc-bg: var(--hb-bg, #1c1c1e);
  --tc-surface: var(--hb-surface, #2c2c2e);
  --tc-raised: var(--hb-raised, #3a3a3c);
  --tc-text: var(--hb-text, #ffffff);
  --tc-text-2: var(--hb-text-secondary, #c7c7cc);
  --tc-muted: var(--hb-muted, #8e8e93);
  --tc-mint: var(--hb-mint, #5ae6ab);
  --tc-mint-deep: var(--hb-mint-deep, #0c3327);
  --tc-violet: var(--hb-violet, #a78bfa);
  --tc-line: var(--hb-line, rgba(255, 255, 255, 0.1));
  --tc-line-strong: var(--hb-line-strong, rgba(255, 255, 255, 0.18));
  --tc-font: var(--hb-font, Inter, -apple-system, system-ui, sans-serif);
  --tc-mono: var(--hb-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  margin: 0;
  background: var(--tc-bg);
  color: var(--tc-text);
  font-family: var(--tc-font);
  -webkit-font-smoothing: antialiased;
}

.tc *,
.tc *::before,
.tc *::after {
  box-sizing: border-box;
}

.tc a {
  color: var(--tc-mint);
}

.tc :focus-visible {
  outline: 2px solid var(--tc-mint);
  outline-offset: 3px;
}

.tc-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- the stamp and the info button (R-22) ---------- */

.tc-stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font: 500 0.8rem/1.4 var(--tc-mono);
  color: var(--tc-muted);
  letter-spacing: 0.01em;
}

.tc-info-btn {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid var(--tc-line-strong);
  background: transparent;
  color: var(--tc-text-2);
  font: 700 1rem/1 var(--tc-font);
  font-style: italic;
  cursor: pointer;
}

.tc-info-btn:hover {
  border-color: var(--tc-mint);
  color: var(--tc-mint);
}

.tc-dialog {
  width: min(28rem, calc(100vw - 2rem));
  border: 1px solid var(--tc-line-strong);
  border-radius: 18px;
  background: var(--tc-surface);
  color: var(--tc-text);
  padding: 1.5rem 1.5rem 1.25rem;
  font-family: var(--tc-font);
}

.tc-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.tc-dialog h2 {
  margin: 0 0 0.25rem;
  font: 700 1.2rem/1.25 var(--tc-font);
}

.tc-dialog .tc-dialog-stamp {
  margin: 0 0 1.1rem;
  font: 500 0.8rem/1.4 var(--tc-mono);
  color: var(--tc-muted);
}

.tc-dialog h3 {
  margin: 1rem 0 0.4rem;
  font: 600 0.72rem/1 var(--tc-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tc-muted);
}

.tc-dialog ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tc-dialog li {
  padding: 0.2rem 0;
  color: var(--tc-text-2);
}

.tc-dialog .tc-event {
  display: inline-block;
  padding: 0.5rem 0;
  font-weight: 600;
}

.tc-dialog .tc-attribution {
  margin: 1.2rem 0 0;
  font: 500 0.78rem/1.4 var(--tc-mono);
  color: var(--tc-muted);
}

.tc-dialog .tc-close {
  margin-top: 1.25rem;
  width: 100%;
  min-height: 2.75rem;
  border-radius: 12px;
  border: 1px solid var(--tc-line-strong);
  background: var(--tc-raised);
  color: var(--tc-text);
  font: 600 0.95rem/1 var(--tc-font);
  cursor: pointer;
}

/* ---------- chips ---------- */

.tc-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.75rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--tc-line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--tc-text);
  text-decoration: none;
  font: 500 1rem/1.25 var(--tc-font);
}

.tc .tc-chip {
  color: var(--tc-text);
}

.tc-chip:hover {
  border-color: var(--tc-mint);
}

.tc-chip kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.6rem;
  border-radius: 7px;
  background: rgba(90, 230, 171, 0.14);
  color: var(--tc-mint);
  font: 700 0.85rem/1 var(--tc-mono);
}

/* ---------- the "while we talked" panel (R-16: counts from data/live/events.json) ---------- */

.tc-while {
  border-radius: 18px;
  background: rgba(44, 44, 46, 0.82);
  border: 1px solid var(--tc-line-strong);
  padding: 1.4rem 1.6rem;
}

.tc-while[hidden] {
  display: none;
}

.tc-while h2 {
  margin: 0 0 0.9rem;
  font: 600 0.8rem/1 var(--tc-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tc-mint);
}

.tc-while .tc-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 2.2rem;
}

.tc-while .tc-num[hidden] {
  display: none;
}

.tc-while .tc-num b {
  display: block;
  font: 800 3.2rem/1 var(--tc-font);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.tc-while .tc-num span {
  display: block;
  margin-top: 0.4rem;
  font: 500 0.9rem/1.3 var(--tc-font);
  color: var(--tc-text-2);
}

.tc-while p {
  margin: 0.9rem 0 0;
  font: 500 0.78rem/1.4 var(--tc-mono);
  color: var(--tc-muted);
}

/* ---------- the back-pocket deck: one statement, one object (prototype v1 model) ---------- */

.tc-deck {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.tc-scene {
  position: absolute;
  inset: 0;
  display: none;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: center;
  gap: 4vw;
  padding: 8vh 7vw 10vh;
}

.tc-scene.is-current {
  display: grid;
}

.tc-scene .tc-eyebrow {
  margin: 0 0 1rem;
  font: 600 0.85rem/1 var(--tc-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tc-mint);
}

.tc-scene h1 {
  margin: 0;
  font: 800 clamp(2rem, 4.2vw, 4.4rem) / 1.05 var(--tc-font);
  letter-spacing: -0.025em;
}

.tc-scene .tc-points {
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
}

.tc-scene .tc-points li {
  padding: 0.55rem 0;
  border-top: 1px solid var(--tc-line);
  font: 500 clamp(1rem, 1.35vw, 1.4rem) / 1.4 var(--tc-font);
  color: var(--tc-text-2);
}

.tc-scene [data-at] {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.tc-scene [data-at].on {
  opacity: 1;
  transform: none;
}

.tc-scene figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.tc-scene figure img {
  max-width: 100%;
  max-height: 64vh;
  border-radius: 14px;
  border: 1px solid var(--tc-line);
  object-fit: contain;
  background: var(--tc-surface);
}

.tc-scene figcaption,
.tc-scene .tc-source {
  font: 500 0.82rem/1.4 var(--tc-mono);
  color: var(--tc-muted);
  text-align: center;
}

.tc-deck-hud {
  position: fixed;
  left: 7vw;
  right: 7vw;
  bottom: 3.5vh;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 500 0.8rem/1 var(--tc-mono);
  color: var(--tc-muted);
  z-index: 2;
}

.tc-deck-hud a {
  color: var(--tc-muted);
  text-decoration: none;
  padding: 0.8rem 0;
}

.tc-tap {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 1;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.tc-tap-l {
  left: 0;
  width: 33vw;
}

.tc-tap-r {
  right: 0;
  width: 67vw;
}

@media (max-width: 760px) {
  .tc-deck {
    position: static;
    overflow: visible;
  }

  .tc-scene,
  .tc-scene.is-current {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 2.5rem 1.25rem;
    border-bottom: 1px solid var(--tc-line);
  }

  .tc-scene [data-at] {
    opacity: 1;
    transform: none;
  }

  .tc-tap {
    display: none;
  }

  .tc-deck-hud {
    position: static;
    padding: 1rem 1.25rem 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tc-scene [data-at] {
    transition: none;
  }
}
