/* Live wins feed, bottom right. Paired with wins-widget.js and wins.json.
   See docs/wins-widget.md.

   THIS IS A REAL STYLESHEET AND NOT AN INJECTED <style> ON PURPOSE. The app
   origin serves its copy of the landing page under a CSP whose style-src has no
   'unsafe-inline' (see netlify.toml), so a stylesheet the script injects at
   runtime is blocked there and the widget renders as unstyled text. A file
   loaded from our own origin satisfies style-src 'self' on every surface. */

.clw-root {
  --clw-brand: #2563eb;
  --clw-brand-2: #06b6d4;
  --clw-ink: #0f172a;
  --clw-muted: #94a3b8;
  --clw-line: rgba(15, 23, 42, 0.09);
  --clw-ease: cubic-bezier(0.16, 1, 0.3, 1);

  position: fixed;
  right: 24px;
  bottom: 24px;
  /* Under the nav (1000) and the mobile menu (999) so it can never cover
     navigation. A social proof card that swallows the menu button is worse
     than no social proof card. */
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  pointer-events: none;
}
.clw-root * { box-sizing: border-box; }
.clw-root button { font: inherit; color: inherit; }

/* ---------- the rotating card ---------- */

.clw-toast {
  position: relative;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.42s var(--clw-ease), transform 0.52s var(--clw-ease);
  will-change: opacity, transform;
}
.clw-toast[hidden] { display: none; }
.clw-toast.clw-in { opacity: 1; transform: translateY(0) scale(1); }

.clw-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 340px;
  padding: 12px 14px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--clw-line);
  border-radius: 14px;
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.13), 0 2px 6px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  transition: transform 0.25s var(--clw-ease), box-shadow 0.25s var(--clw-ease);
}
.clw-card:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(15, 23, 42, 0.17); }
.clw-card:focus-visible { outline: 2px solid var(--clw-brand); outline-offset: 3px; }

.clw-ico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--clw-brand);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.11), rgba(6, 182, 212, 0.13));
}
.clw-ico svg { width: 16px; height: 16px; display: block; }

.clw-body { min-width: 0; flex: 1 1 auto; }
.clw-text {
  display: block;
  font-size: 13.5px;
  line-height: 1.42;
  color: var(--clw-ink);
  letter-spacing: -0.005em;
}
.clw-text b { font-weight: 600; }
.clw-meta {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--clw-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The illustrative-example marker. Deliberately on the CARD and not only in
   the panel: most visitors never open the panel, so a disclosure that lives
   there is a disclosure most people never see. Muted enough to stay out of the
   way, boxed so it reads as a label rather than as more metadata. */
.clw-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 5px;
  border: 1px solid rgba(100, 116, 139, 0.28);
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: #94a3b8;
  vertical-align: 1px;
}

.clw-chev { flex: 0 0 auto; color: #cbd5e1; transition: color 0.2s, transform 0.25s var(--clw-ease); }
.clw-chev svg { width: 14px; height: 14px; display: block; }
.clw-card:hover .clw-chev { color: var(--clw-brand); transform: translateX(2px); }

.clw-x {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--clw-line);
  color: var(--clw-muted);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
}
.clw-x svg { width: 10px; height: 10px; display: block; }
.clw-toast:hover .clw-x,
.clw-toast:focus-within .clw-x { opacity: 1; }
.clw-x:hover { color: var(--clw-ink); }
.clw-x:focus-visible { opacity: 1; outline: 2px solid var(--clw-brand); outline-offset: 2px; }

/* ---------- the history panel ---------- */

.clw-panel {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  width: 360px;
  max-height: min(470px, 72vh);
  background: #fff;
  border: 1px solid var(--clw-line);
  border-radius: 16px;
  box-shadow: 0 18px 54px rgba(15, 23, 42, 0.19), 0 2px 8px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.985);
  transition: opacity 0.28s var(--clw-ease), transform 0.36s var(--clw-ease);
}
.clw-panel[hidden] { display: none; }
.clw-panel.clw-in { opacity: 1; transform: translateY(0) scale(1); }

.clw-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--clw-line);
}
.clw-title { font-size: 13.5px; font-weight: 600; color: var(--clw-ink); letter-spacing: -0.01em; }
.clw-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; flex: 0 0 auto; }
.clw-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid rgba(34, 197, 94, 0.45);
  animation: clw-pulse 2.2s var(--clw-ease) infinite;
}
@keyframes clw-pulse {
  0% { transform: scale(0.75); opacity: 0.9; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}
.clw-head-close {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 7px;
  color: var(--clw-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.clw-head-close svg { width: 12px; height: 12px; display: block; }
.clw-head-close:hover { background: #f1f5f9; color: var(--clw-ink); }
.clw-head-close:focus-visible { outline: 2px solid var(--clw-brand); outline-offset: 2px; }

.clw-list {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.clw-day {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 14px 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--clw-muted);
  background: linear-gradient(#fff 72%, rgba(255, 255, 255, 0));
}
.clw-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 8px 14px 11px;
}
.clw-row + .clw-day { margin-top: 2px; border-top: 1px solid var(--clw-line); }
.clw-row .clw-ico { width: 28px; height: 28px; margin-top: 1px; }
.clw-row .clw-ico svg { width: 13px; height: 13px; }
.clw-row-body { min-width: 0; flex: 1 1 auto; }
.clw-row .clw-text { font-size: 13px; }
.clw-row .clw-meta { font-size: 11px; white-space: normal; }

/* flex-end plus margin-right:auto on the note, rather than space-between: the
   note is optional, and space-between with a single child left-aligns the CTA. */
.clw-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--clw-line);
  background: #f8fafc;
  font-size: 11.5px;
  color: var(--clw-muted);
}
.clw-foot > span { margin-right: auto; }
.clw-foot a {
  font-weight: 600;
  color: var(--clw-brand);
  text-decoration: none;
  white-space: nowrap;
}
.clw-foot a:hover { text-decoration: underline; }

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .clw-root { right: 14px; left: 14px; bottom: 16px; align-items: stretch; }
  .clw-card { width: 100%; }
  .clw-panel { width: 100%; max-height: 68vh; }
  .clw-x { opacity: 1; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .clw-toast, .clw-panel { transform: none; transition: opacity 0.2s linear; }
  .clw-toast.clw-in, .clw-panel.clw-in { transform: none; }
  .clw-card { transition: box-shadow 0.2s linear; }
  .clw-card:hover { transform: none; }
  .clw-card:hover .clw-chev { transform: none; }
  .clw-dot::after { animation: none; opacity: 0; }
}
