/* ============================================================================
   ATLAS REDESIGN — Video Research (AI Tools) screen styles  ·  Phase 2
   Branch: atlas-redesign-2026-06-29

   Prefix: .rd-rd. Tokens only (--r-*) so Calm (almanac) + Operator themes both
   work automatically. No hardcoded hex. Theme-specific selectors
   (html[data-rtheme="operator"] …) are used only where a token can't express
   the tweak (rare).
   ========================================================================== */

.rd-rd {
  font-family: var(--r-font-body);
  color: var(--r-body);
  padding: var(--r-gutter);
  max-width: var(--r-page-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---- header -------------------------------------------------------------- */
.rd-rd-head {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.rd-rd-eyebrow {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-eyebrow);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--r-clay);
}
.rd-rd-h1 {
  font-family: var(--r-font-display);
  font-size: var(--r-fs-h1);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--r-ink);
  margin: 0;
}
.rd-rd-sub {
  margin: 4px 0 0;
  font-size: var(--r-fs-body);
  line-height: 1.5;
  color: var(--r-muted);
  max-width: 600px;
}
.rd-rd-scope {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.rd-rd-org {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-meta);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--r-muted);
}

/* ---- input row (paste link + analyze) ------------------------------------ */
.rd-rd-inputrow {
  display: flex;
  gap: 10px;
}
.rd-rd-field {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  background: var(--r-surface);
  border: 1px solid var(--r-border);
  border-radius: var(--r-radius-control);
  transition: border-color var(--r-dur) var(--r-ease),
              box-shadow var(--r-dur) var(--r-ease);
}
.rd-rd-field > i {
  flex: 0 0 auto;
  font-size: 16px;
  color: var(--r-faint);
}
.rd-rd-field:focus-within {
  border-color: var(--r-primary);
  box-shadow: 0 0 0 3px var(--r-select);
}
.rd-rd-input {
  flex: 1 1 auto;
  min-width: 0;
  appearance: none;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--r-font-body);
  font-size: 13.5px;
  color: var(--r-ink);
}
.rd-rd-input::placeholder { color: var(--r-faint); }

.rd-rd-analyze {
  flex: 0 0 auto;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  background: var(--r-primary);
  color: var(--r-primary-ink);
  border: none;
  border-radius: var(--r-radius-control);
  font-family: var(--r-font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: filter var(--r-dur) var(--r-ease),
              transform var(--r-dur) var(--r-ease),
              box-shadow var(--r-dur) var(--r-ease),
              opacity var(--r-dur) var(--r-ease);
}
.rd-rd-analyze i { font-size: 15px; }
.rd-rd-analyze:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: var(--r-shadow-hover);
  transform: translateY(-1px);
}
.rd-rd-analyze:active:not(:disabled) { transform: translateY(0); }
.rd-rd-analyze:disabled { opacity: .5; cursor: not-allowed; }
.rd-rd-analyze:focus-visible { outline: var(--r-focus); outline-offset: 2px; }

/* ---- category filter pills ----------------------------------------------- */
.rd-rd-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rd-rd-pill {
  appearance: none;
  border: 1px solid var(--r-border);
  background: var(--r-surface);
  color: var(--r-body);
  font-family: var(--r-font-body);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  padding: 7px 14px;
  border-radius: var(--r-radius-pill);
  cursor: pointer;
  transition: color var(--r-dur) var(--r-ease),
              background var(--r-dur) var(--r-ease),
              border-color var(--r-dur) var(--r-ease);
}
.rd-rd-pill { transition: color var(--r-dur) var(--r-ease), background var(--r-dur) var(--r-ease), border-color var(--r-dur) var(--r-ease), transform var(--r-dur) var(--r-ease); }
.rd-rd-pill:hover { background: var(--r-canvas-raised); border-color: var(--r-primary-2); transform: translateY(-1px); }
.rd-rd-pill:active { transform: translateY(0) scale(.96); }
.rd-rd-pill.is-active {
  background: var(--r-primary);
  color: var(--r-primary-ink);
  border-color: var(--r-primary);
  font-weight: 600;
}
.rd-rd-pill.is-active:hover { transform: translateY(-1px); filter: brightness(1.05); }
.rd-rd-pill:focus-visible { outline: var(--r-focus); outline-offset: 2px; }

/* ---- results region ------------------------------------------------------ */
.rd-rd-results {
  min-height: 0;
  overflow: auto;
  max-height: calc(100vh - 320px);
  padding: 2px;
  margin: -2px;
}
.rd-rd-results.is-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* ---- one analyzed-video card --------------------------------------------- */
.rd-rd-tile {
  background: var(--r-surface);
  border: 1px solid var(--r-border);
  border-radius: var(--r-radius-card);
  box-shadow: var(--r-shadow-card);
  overflow: hidden;
  display: flex;
  animation: rdRdCardIn .28s var(--r-ease);
  transition: transform var(--r-dur) var(--r-ease),
              box-shadow var(--r-dur) var(--r-ease);
}
.rd-rd-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--r-shadow-hover);
}
.rd-rd-tile:focus-visible { outline: var(--r-focus); outline-offset: 2px; }
@keyframes rdRdCardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* thumbnail (diagonal hatch placeholder — no fabricated imagery) */
.rd-rd-thumb {
  position: relative;
  width: 150px;
  flex: 0 0 auto;
  background:
    repeating-linear-gradient(45deg,
      var(--r-well), var(--r-well) 10px,
      var(--r-canvas-raised) 10px, var(--r-canvas-raised) 20px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rd-rd-play {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--r-surface);
  box-shadow: var(--r-shadow-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--r-primary);
}
.rd-rd-play i { font-size: 16px; }
.rd-rd-plat {
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: var(--r-font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--r-body);
  background: var(--r-surface);
  border-radius: 5px;
  padding: 1px 6px;
}
.rd-rd-dur {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-family: var(--r-font-mono);
  font-size: 9px;
  color: var(--r-primary-ink);
  background: color-mix(in srgb, var(--r-ink) 70%, transparent);
  border-radius: 5px;
  padding: 1px 6px;
}

.rd-rd-body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 13px 14px;
}
.rd-rd-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--r-ink);
}
.rd-rd-meta {
  font-size: 12px;
  color: var(--r-faint);
  margin-top: 3px;
}
.rd-rd-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--r-muted);
  margin-top: 8px;
}
.rd-rd-insight {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--r-hairline);
}
.rd-rd-insight i {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--r-primary);
  margin-top: 1px;
}
.rd-rd-insight span {
  font-size: 12px;
  line-height: 1.45;
  color: var(--r-body);
}

/* ---- honest empty state (house pattern: icon badge + title + subtext) ---- */
.rd-rd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 44px 24px;
  border: 1px dashed var(--r-border);
  border-radius: var(--r-radius-card);
}
.rd-rd-empty-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin-bottom: 14px;
  background: var(--r-mint-surface);
  color: var(--r-mint-ink);
  font-size: 24px;
}
.rd-rd-empty-t { margin: 0; font-size: 14px; font-weight: 600; color: var(--r-ink); }
.rd-rd-empty-s {
  margin: 6px 0 0;
  max-width: 440px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--r-muted);
}
@media (prefers-reduced-motion: no-preference) {
  .rd-rd-empty-ic { animation: rdRdEmptyIn .4s var(--r-ease) both; }
}
@keyframes rdRdEmptyIn { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }

/* ---- pre-connect sell state (S1 sweep 2026-07-03) -------------------------
   Replaces the dead input+Analyze pre-connect render: three workflow steps +
   one honest connect line. Copy is feature description, not data. */
.rd-rd-sell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rd-rd-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.rd-rd-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--r-surface);
  border: 1px solid var(--r-hairline-2);
  border-radius: var(--r-radius-card);
  box-shadow: var(--r-shadow-card);
  padding: 16px;
  animation: rdRdStepIn .3s var(--r-ease) both;
}
@keyframes rdRdStepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rd-rd-step-n {
  position: absolute;
  top: 12px;
  right: 14px;
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-eyebrow);
  letter-spacing: .1em;
  color: var(--r-faint);
}
.rd-rd-step-ic {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--r-mint-surface);
  color: var(--r-mint-ink);
  font-size: 17px;
}
.rd-rd-step-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--r-ink);
}
.rd-rd-step-copy {
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--r-muted);
}
.rd-rd-connect {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--r-well);
  border: 1px dashed var(--r-border);
  border-radius: var(--r-radius-control);
  padding: 11px 14px;
}
.rd-rd-connect-ic {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--r-canvas-raised);
  color: var(--r-faint);
  font-size: 14px;
}
.rd-rd-connect-body { display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; }
.rd-rd-connect-body strong { color: var(--r-body); font-weight: 600; }
.rd-rd-connect-body span { color: var(--r-muted); }

/* ---- reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .rd-rd-tile, .rd-rd-step, .rd-rd-empty-ic, .rd-rd-pill { animation: none; }
  .rd-rd-tile:hover, .rd-rd-pill:hover, .rd-rd-pill:active, .rd-rd-pill.is-active:hover { transform: none; }
}

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 980px) {
  .rd-rd-results.is-grid { grid-template-columns: 1fr; }
  .rd-rd-steps { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .rd-rd-inputrow { flex-wrap: wrap; }
  .rd-rd-field { flex-basis: 100%; }
  .rd-rd-analyze { flex: 1 1 auto; justify-content: center; }
  .rd-rd-thumb { width: 120px; }
}
