/*
 * deltaloop-marketing/hero-signal - block stylesheet.
 *
 * Auto-extracted from the monolithic style.css. References
 * design tokens from assets/css/tokens.css. Loaded by
 * WordPress when the block renders (via block.json `style`).
 */

.hs-frame {
  position: relative;
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  perspective: 1200px;
}

.hs-frame-ticks {
  position: absolute;
  inset: -14px;
  pointer-events: none;
}

.hs-frame-ticks span {
  position: absolute;
  width: 18px; height: 18px;
  border-color: var(--hairline-strong);
  border-style: solid;
}

.hs-frame-ticks span:nth-child(1) { top: 0; left: 0;     border-width: 1px 0 0 1px; }

.hs-frame-ticks span:nth-child(2) { top: 0; right: 0;    border-width: 1px 1px 0 0; }

.hs-frame-ticks span:nth-child(3) { bottom: 0; left: 0;  border-width: 0 0 1px 1px; }

.hs-frame-ticks span:nth-child(4) { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

/* Signal card */

.hs-card {
  position: relative;
  background: var(--surface-paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 30px 60px -20px rgba(0,0,0,0.5),
    0 0 0 1px rgba(20,227,156,0.04) inset;
}

.hs-card::after {
  content: "";
  position: absolute; inset: 0;
  background-image: var(--noise-url);
  background-size: 180px 180px;
  opacity: 0.2;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.hs-card--signal {
  padding: 18px 20px 16px;
  transform: rotate(-1.4deg);
  animation: hs-float-a 8s ease-in-out infinite;
}

.hs-card--feed {
  padding: 14px 16px;
  transform: rotate(1deg) translateX(14px);
  animation: hs-float-b 9s ease-in-out infinite;
  animation-delay: -2s;
}

/* Card head */

.hs-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 12px;
}

.hs-card-head-l { display: flex; align-items: center; gap: 10px; }

.hs-live-dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--primary-container);
  box-shadow: 0 0 10px var(--primary-container);
  animation: signal-pulse 1.8s ease-in-out infinite;
}

.hs-card-url {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--on-surface);
}

.hs-caret {
  color: var(--primary-container);
  animation: hs-caret-blink 1s steps(2) infinite;
}

/* Orbit area */

.hs-orbit {
  position: relative;
  aspect-ratio: 420 / 260;
  width: 100%;
}

.hs-orbit svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Core KPI badge */

.hs-core-kpi {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hs-core-kpi-val {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.035em;
}

.hs-core-kpi-delta {
  font-size: 22px;
  color: var(--primary-container);
}

.hs-core-kpi-num {
  font-size: 44px;
  line-height: 1;
  transition: transform 240ms var(--ease-expo), color 240ms var(--ease-expo);
}

.hs-core-kpi-num.is-tick {
  color: var(--primary-container);
  transform: scale(1.04);
}

.hs-core-kpi-unit {
  font-size: 18px;
  color: var(--on-surface-variant);
  margin-left: 2px;
}

.hs-core-kpi-spark {
  width: 80px;
  height: 16px;
}

.hs-core-kpi-spark svg {
  width: 100%; height: 100%;
  display: block;
}

/* Card foot */

.hs-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  margin-top: 6px;
  border-top: 1px solid var(--hairline);
}

.hs-card-foot-time { color: var(--primary-container); }

/* Agent feed */

.hs-feed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--hairline);
}

.hs-feed-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hs-feed-row {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  font-size: 11.5px;
  color: var(--on-surface);
  position: relative;
  opacity: 0;
  transform: translateX(-6px);
  animation: hs-feed-in 0.5s var(--ease-expo) forwards;
}

.hs-feed-row::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--hairline-strong);
  border-radius: 1px;
}

.hs-feed-row.is-crit::before { background: #ff6b6b; }

.hs-feed-row.is-warn::before { background: #e5b84b; }

.hs-feed-row.is-ok::before { background: var(--primary-container); }

.hs-feed-agent {
  color: var(--outline);
  font-size: 9.5px;
}

.hs-feed-msg {
  color: var(--on-surface);
  font-family: var(--font-sans);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hs-feed-chip {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  padding: 3px 7px;
  border-radius: 3px;
  border: 1px solid currentColor;
  text-transform: uppercase;
}

.hs-feed-row.is-crit .hs-feed-chip { color: #ff6b6b; }

.hs-feed-row.is-warn .hs-feed-chip { color: #e5b84b; }

.hs-feed-row.is-ok .hs-feed-chip { color: var(--primary-container); }

@media (max-width: 900px) {
  .hs-frame { max-width: 480px; margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .hs-card--signal,
.hs-card--feed,
.hs-core-kpi-num { animation: none !important; }
}

/* ────────────────── PHONE (< 640px) ────────────────── */

@media (max-width: 640px) {
  /* Hero signal card - tighten */
  .hs-frame { gap: 12px; }
  .hs-card { padding: 14px; }
  .hs-orbit svg { height: auto; }
  .hs-core-kpi-num { font-size: 34px; }
  .hs-feed-row { gap: 8px; font-size: 11px; }
}

/* Respect user's motion preference - pause the expensive stuff. */

@media (prefers-reduced-motion: reduce) {
  .hs-live-dot,
.hs-caret {
    animation: none !important;
  }
}

/* ────────────────── PHONE overrides (refined) ────────────────── */

@media (max-width: 640px) {
  /* Hero signal card gets real minimum height so the orbit renders */
  .hs-orbit { aspect-ratio: 420 / 240; }
  /* Agent feed rows - make sure text doesn't overflow */
  .hs-feed-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hs-feed-agent { flex: 0 0 auto; }
  .hs-feed-chip { flex: 0 0 auto; }
}
