/* Curation insight widget — a fixed square, everything sized relative to it (cqw = 1% of the square).
   Brand values from the Curation style guide and DeepDive Auto: neutral-900 #171717, neutral-100 #f5f5f5,
   yellow-300 #fde047, pink-400 #f472b6, cyan-300 #67e8f9, purple-400 #c084fc. Corners: 7%, the logo square's corner;
   the coloured panels and the input share the yellow ask square's corner. */
:root {
  --c-bg: #171717;
  --c-ink: #f5f5f5;
  --c-pill-ink: #171717;
  --r-sq: 7%;          /* square things: the logo square's corner */
  --r-btn: calc(7.8cqw * 0.07);  /* the yellow square's corner (7% of the 7.8cqw ask button), so pills and inputs match it */
  --c-ghost: #333333;      /* wordmark */
  --c-ghost-ink: #6b6b6b;  /* tagline, labels */
  --c-muted: #9a9a9a;
  --c-line: #2c2c2c;
  --c-surface: #212121;
  --c-pink: #f472b6;
  --c-cyan: #67e8f9;
  --c-purple: #c084fc;
  --c-yellow: #fde047;
  --c-input: #3a3836;
  --c-up: #34d399;
  --c-down: #f87171;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* The square: as big as the frame allows, centred if the frame isn't square */
.cw {
  width: min(100vw, 100vh);
  aspect-ratio: 1;
  margin: calc((100vh - min(100vw, 100vh)) / 2) auto 0;
  container-type: size;
  overflow: hidden;
  position: relative;
}
.cw-field { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.cw-view {
  position: absolute; inset: 0; z-index: 1;
  padding: 5cqw 7.7cqw 6cqw;   /* the margin round the square, the same on every screen (from the mockup) */
  display: flex; flex-direction: column;
}
.cw-view[hidden] { display: none; }

button { font: inherit; color: inherit; cursor: pointer; }

/* ================= Home ================= */
.cw-brand { padding-left: 0.3cqw; }
.cw-wordmark { display: block; width: 54cqw; height: auto; }
.cw-tagline {
  color: var(--c-ink);   /* same #f5f5f5 as the logo's wordmark */
  white-space: nowrap;
  margin-top: 1.4cqw;
  font-size: 3.2cqw;   /* widget.js stretches this to the wordmark's width */
}

.cw-label {
  font-size: 3.3cqw;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--c-ink);   /* same #f5f5f5 as the logo's wordmark */
  margin: 4.2cqw 0 1.5cqw;
}

.cw-list { display: flex; flex-direction: column; align-items: flex-start; gap: 1.1cqw; }

.cw-pill {
  display: inline-flex; align-items: center; gap: 1.2cqw;
  max-width: 100%;
  font-size: 4.9cqw;
  line-height: 1.15;
  text-align: left;
  color: var(--c-pill-ink);
  background: var(--c-pink);
  border: 0;
  border-radius: var(--r-btn);
  padding: 1.1cqw 2.6cqw 1.1cqw 1.6cqw;
  transition: transform .12s ease, box-shadow .12s ease;
}
.cw-pill > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-pill:hover { transform: translateX(0.6cqw); box-shadow: -0.6cqw 0 0 var(--c-yellow); }
.cw-pill:focus-visible { outline: 0.5cqw solid var(--c-yellow); outline-offset: 0.4cqw; }
.cw-pill--cyan { background: var(--c-cyan); }
.cw-pill .arrow { flex: none; font-size: 0.55em; opacity: .75; }

.cw-askwrap { margin-top: auto; }
.cw-askwrap .cw-label { margin-top: 0; }
.cw-ask {
  display: flex; gap: 1.2cqw;
  height: 7.8cqw;
}
.cw-ask input {
  flex: 1; min-width: 0;
  border: 0; outline: none;
  background: var(--c-input);
  color: #fff;
  font: inherit; font-size: 3.6cqw;
  padding: 0 2.5cqw;
  border-radius: var(--r-btn);
}
.cw-ask input::placeholder { color: #8a8784; }
.cw-ask button {               /* a brand square, like the logo's */
  width: 7.8cqw; border: 0;
  border-radius: var(--r-sq);
  background: var(--c-yellow);
  display: grid; place-items: center;
}
.cw-ask button svg { width: 4.2cqw; height: 4.2cqw; }

/* ================= Stage (one of: the headline, the impact, bull / bear) ================= */
.cw-logo-btn { display: block; background: none; border: 0; padding: 0; }   /* the logo takes you back to the headlines */
.cw-logo-btn:focus-visible { outline: 0.5cqw solid var(--c-yellow); outline-offset: 1cqw; }

.cw-kind {
  margin-top: 7cqw;
  font-size: 3.8cqw; font-weight: 400; letter-spacing: 0;
  text-transform: uppercase;
  color: var(--c-purple);
}
.cw-kind.impact { color: var(--c-pink); }
.cw-kind.bull_bear { color: var(--c-yellow); }

.cw-part {
  margin-top: 4.6cqw;
  font-size: 3.8cqw;   /* widget.js shrinks this if a long part would overflow the square */
  line-height: 1.32;
  animation: partIn .35s ease;
}
.cw-part span {        /* a dark highlight behind each line keeps the text readable over the squares */
  background: rgba(20, 20, 20, .92);
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  padding: .06em 0;
}
.cw-part.err span { color: var(--c-muted); }
@keyframes partIn { from { opacity: 0; transform: translateY(1.5cqw); } }

.cw-more {
  align-self: flex-start;
  margin-top: 4.4cqw;
  display: inline-flex; align-items: center; gap: 1.4cqw;
  font-size: 3.8cqw; text-transform: uppercase;
  color: var(--c-cyan);
  background: none; border: 0; padding: 0;
  text-decoration: none;
  cursor: pointer;
}
.cw-more svg { width: 3.2cqw; height: 3.2cqw; }
.cw-more:hover { color: var(--c-ink); }
.cw-more:focus-visible { outline: 0.5cqw solid var(--c-yellow); outline-offset: 0.8cqw; }
.cw-more[hidden] { display: none; }

.cw-typing { display: flex; gap: 1cqw; align-items: center; height: 5cqw; }
.cw-typing i { width: 1.6cqw; height: 1.6cqw; border-radius: 50%; background: var(--c-ghost-ink); animation: pulse 1s infinite; }
.cw-typing i:nth-child(2) { animation-delay: .2s; }
.cw-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 50% { opacity: .25; } }
