/*
 * See It Work: a player that acts each step of a farm job out on a sketch of the product's screen.
 * The pattern comes from LaborLedger's own How It Works screen (apps/web/src/screens/Journey.tsx
 * and components/JourneyScenes.tsx). Its Tailwind classes are written out here as plain CSS,
 * on the tokens in fields.css. Script: see-it-work.js.
 *
 * Served from the site root, not /assets, for the same reason as fields.css.
 */

.hw {
  --hw-ring: var(--color-cb-gray-200);
  --hw-hot: var(--color-violet-border-hover);
  --hw-ok-ground: var(--color-success-50);
  --hw-ok-ring: #abefc6;
  --hw-ok-ink: var(--color-success-700);
  --hw-ok-solid: #079455;
  --hw-warn-ground: var(--color-warning-50);
  --hw-warn-ring: #fedf89;
  --hw-warn-ink: var(--color-warning-700);
  --hw-ease: all 0.5s ease-out;
  --hw-gradient: linear-gradient(180deg, var(--color-gradient-start), var(--color-gradient-end));
}

/* ---------- Product and role pickers ---------- */

.hw-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hw-tab {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--color-cb-gray-200);
  border-radius: 999px;
  background: var(--color-ink-white);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-cb-gray-900);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.hw-tab:hover { border-color: var(--color-cb-gray-300); }
.hw-tab[aria-selected="true"] {
  border-color: var(--color-brand-200);
  background: var(--color-brand-100);
  color: var(--color-brand-700);
}

/* ---------- The player: moments on one side, the stage on the other ---------- */

.hw-player {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 24px;
  align-items: start;
}
.hw-moments { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hw-about { margin: 0; font-size: 15px; line-height: 1.55; color: var(--color-cb-gray-600); }
.hw-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.hw-moment {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  font-family: inherit;
  text-align: start;
  cursor: pointer;
  transition: background 0.15s ease;
}
.hw-moment:hover { background: var(--color-cb-gray-25); }
.hw-moment[aria-current="step"] { background: var(--color-brand-50); }
.hw-moment-head { display: flex; align-items: center; gap: 12px; }
.hw-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-cb-gray-600);
  box-shadow: inset 0 0 0 1px var(--color-cb-gray-200);
}
.hw-num-on { background: var(--hw-gradient); color: var(--color-ink-white); box-shadow: none; }
.hw-num-past { background: var(--color-ink-black); color: var(--color-ink-white); box-shadow: none; }
.hw-moment-title { flex: 1; font-size: 15px; color: var(--color-cb-gray-700); }
.hw-moment[aria-current="step"] .hw-moment-title { font-weight: 700; color: var(--color-brand-700); }
.hw-moment-text { padding-inline-start: 36px; font-size: 14px; line-height: 1.5; color: var(--color-cb-gray-600); }
.hw-folded { display: none; }
.hw-progress {
  display: block;
  height: 2px;
  margin: 4px 0 0 36px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(217, 214, 254, 0.45);
}
.hw-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--color-brand-700);
  transition: width 0.7s linear;
}

.hw-stage-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; position: sticky; top: calc(var(--hw-top, 64px) + 110px); }
.hw-stage {
  padding: clamp(16px, 2.4vw, 24px);
  border-radius: var(--radius-xl);
  background: var(--color-cb-gray-25);
  box-shadow: inset 0 0 0 1px var(--color-cb-gray-200);
}
.hw-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.hw-controls > div { display: flex; align-items: center; gap: 4px; }
.hw-ctl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--color-cb-gray-300);
  border-radius: var(--radius-md);
  background: var(--color-ink-white);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-cb-gray-700);
  cursor: pointer;
}
.hw-ctl:hover { background: var(--color-cb-gray-50); }
.hw-copied { font-size: 13px; font-weight: 700; color: var(--hw-ok-ink); }

.hw-truths {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--color-cb-gray-200);
  font-size: 13px;
  color: var(--color-cb-gray-600);
}

@media (max-width: 767px) {
  .hw-player { grid-template-columns: minmax(0, 1fr); }
  .hw-stage-col { position: static; order: -1; }
}

/* ---------- The sketch of a screen ---------- */

.hw-screen {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-ink-white);
  box-shadow: 0 1px 2px #1018280d, inset 0 0 0 1px var(--color-cb-gray-200);
  color: var(--color-cb-gray-700);
  font-size: 12px;
  line-height: 1.35;
}
.hw-screen-phone { width: 230px; height: 380px; margin: 0 auto; border-radius: 28px; }
.hw-screen-window { width: 100%; height: 300px; border-radius: var(--radius-xl); }
.hw-screen-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-cb-gray-200);
  background: var(--color-cb-gray-25);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-cb-gray-600);
}
.hw-screen-phone .hw-screen-bar { justify-content: center; padding: 10px 12px; }
.hw-leaf { height: 12px; width: auto; flex-shrink: 0; }
.hw-screen-body { position: relative; display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 8px; padding: 12px; }

/* Pieces the scenes are built from */
.hw-e { transition: var(--hw-ease); }
.hw-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px var(--hw-ring);
  transition: var(--hw-ease);
}
.hw-ok { background: var(--hw-ok-ground); box-shadow: inset 0 0 0 1px var(--hw-ok-ring); }
.hw-warn { background: var(--hw-warn-ground); box-shadow: inset 0 0 0 1px var(--hw-warn-ring); }
.hw-soft { background: var(--color-brand-50); box-shadow: inset 0 0 0 1px var(--hw-hot); }
.hw-hot { box-shadow: inset 0 0 0 1px var(--hw-hot); }
.hw-hot2 { box-shadow: inset 0 0 0 2px var(--hw-hot); }
.hw-box { box-shadow: inset 0 0 0 1px var(--hw-ring); border-radius: var(--radius-md); }
.hw-show { transition: var(--hw-ease); }
.hw-off { opacity: 0; transform: translateY(4px); pointer-events: none; }
.hw-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.hw-head { font-size: 12px; font-weight: 700; color: var(--color-cb-gray-900); }
.hw-small { font-size: 10px; color: var(--color-cb-gray-600); }
.hw-t11 { font-size: 11px; }
.hw-t10 { font-size: 10px; }
.hw-b { font-weight: 700; }
.hw-accent { color: var(--color-brand-700); }
.hw-auto { margin-top: auto; }
.hw-flex { display: flex; align-items: center; gap: 8px; }
.hw-col { display: flex; flex-direction: column; gap: 4px; }
.hw-between { justify-content: space-between; }
.hw-end { justify-content: flex-end; }
.hw-bar { display: block; height: 8px; border-radius: 999px; background: var(--color-cb-gray-200); transition: var(--hw-ease); }
.hw-bar-soft { background: var(--color-brand-50); }
.hw-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--color-brand-50);
  font-size: 10px;
  font-weight: 700;
  color: var(--color-brand-700);
}
.hw-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 2px;
  border-radius: 999px;
  background: var(--color-ink-white);
  box-shadow: inset 0 0 0 1px var(--hw-ring);
  font-size: 11px;
  animation: hwFadeUp 0.4s ease-out both;
}
.hw-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--color-brand-700);
  box-shadow: inset 0 0 0 1px var(--hw-hot);
  transition: var(--hw-ease);
}
.hw-btn-primary { background: var(--hw-gradient); color: var(--color-ink-white); box-shadow: none; }
.hw-btn-wide { width: 100%; padding: 6px 8px; }
.hw-btn-tap { transform: scale(0.95); }
.hw-tap {
  position: absolute;
  inset: -4px;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 2px var(--hw-hot);
  pointer-events: none;
  animation: hwPing 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.hw-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
}
.hw-badge-neutral { background: var(--color-cb-gray-50); color: var(--color-cb-gray-600); box-shadow: inset 0 0 0 1px var(--color-cb-gray-200); }
.hw-badge-success { background: var(--hw-ok-ground); color: var(--hw-ok-ink); }
.hw-badge-warning { background: var(--hw-warn-ground); color: var(--hw-warn-ink); }
.hw-badge-brand { background: var(--color-brand-50); color: var(--color-brand-700); }
.hw-badge-info { background: var(--color-sky-100); color: var(--color-sky-700); }
.hw-field { display: flex; height: 24px; align-items: center; gap: 6px; padding: 0 8px; border-radius: var(--radius-md); font-size: 11px; position: relative; box-shadow: inset 0 0 0 1px var(--hw-ring); transition: var(--hw-ease); }
.hw-field.hw-hot { box-shadow: inset 0 0 0 1px var(--hw-hot); }
.hw-daybar { position: relative; height: 28px; border-radius: var(--radius-md); background: var(--color-cb-gray-25); box-shadow: inset 0 0 0 1px var(--hw-ring); transition: var(--hw-ease); }
.hw-daybar span {
  position: absolute;
  top: 4px;
  bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  white-space: nowrap;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  transition: var(--hw-ease);
}
.hw-blk-work { background: var(--hw-hot); color: var(--color-brand-700); }
.hw-blk-other { background: var(--color-brand-50); color: var(--color-brand-700); box-shadow: inset 0 0 0 1px var(--hw-hot); }
.hw-blk-break { background: var(--hw-warn-ground); color: var(--hw-warn-ink); box-shadow: inset 0 0 0 1px var(--hw-warn-ring); }
.hw-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; color: var(--color-cb-gray-600); }
.hw-bubble { border-radius: var(--radius-xl); padding: 6px 12px; font-size: 11px; }

@keyframes hwPing { 75%, 100% { transform: scale(1.12); opacity: 0; } }
@keyframes hwFadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .hw-tap, .hw-pill { animation: none; }
  .hw *, .hw-e, .hw-row, .hw-show, .hw-bar { transition: none !important; }
}

/* ---------- The share card: 1200 × 630, photographed by the pre-render for link previews ---------- */

.hw-card-mode body { overflow: hidden; }
.hw-card {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2147483647;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  width: 1200px;
  height: 630px;
  padding: 56px 64px;
  box-sizing: border-box;
  background: linear-gradient(120deg, #faf8ff 0%, #f4ebff 45%, #ffffff 100%);
}
.hw-card-words { display: flex; flex-direction: column; gap: 18px; }
.hw-card-brand { display: flex; align-items: center; gap: 14px; font-size: 18px; font-weight: 700; color: var(--color-teal-soft-ink); }
.hw-card-brand img { height: 34px; width: auto; }
.hw-card-tag { font-size: 20px; font-weight: 700; color: var(--color-cb-gray-500); }
.hw-card-title { margin: 0; font-size: 54px; line-height: 1.05; }
.hw-card-summary { margin: 0; font-size: 21px; line-height: 1.45; color: var(--color-cb-gray-600); }
.hw-card-meta { font-size: 18px; font-weight: 700; color: var(--color-brand-700); }
.hw-card-stage { display: flex; align-items: center; justify-content: center; transform: scale(1.18); transform-origin: center; }
.hw-card-stage .hw-screen-window { width: 400px; }

/* ---------- The library: search, who it's for, and the tree of work areas, beside the story ---------- */

.hw-lib { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 32px; align-items: start; }
.hw-side { position: sticky; top: calc(var(--hw-top, 64px) + 16px); max-height: calc(100vh - var(--hw-top, 64px) - 32px); overflow-y: auto; padding: 2px; }
.hw-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; container-type: inline-size; }
/* The story column is narrower beside the library: stack the player by its width, not the screen's. */
@container (max-width: 760px) {
  .hw-player { grid-template-columns: minmax(0, 1fr); }
  .hw-stage-col { position: static; order: -1; }
}
.hw-browse { display: flex; flex-direction: column; gap: 14px; }

.hw-combo { position: relative; }
.hw-combo input {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--color-cb-gray-300);
  border-radius: var(--radius-lg);
  background: var(--color-ink-white);
  font-family: inherit;
  font-size: 16px;
  color: var(--color-cb-gray-900);
}
.hw-combo input:focus { outline: none; border-color: var(--color-brand-600); box-shadow: var(--shadow-cb-focus-halo); }
.hw-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(420px, calc(100vw - 32px));
  z-index: 30;
  max-height: min(440px, 60vh);
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--color-cb-gray-200);
  border-radius: var(--radius-xl);
  background: var(--color-ink-white);
  box-shadow: var(--shadow-cb-modal);
}
.hw-opt-group { padding: 10px 10px 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-teal-soft-ink); }
.hw-opt { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--radius-md); cursor: pointer; }
.hw-opt-on { background: var(--color-brand-50); }
.hw-opt-title { font-size: 15px; font-weight: 700; color: var(--color-cb-gray-900); }
.hw-opt-on .hw-opt-title, .hw-opt-now .hw-opt-title { color: var(--color-brand-700); }
.hw-opt-meta { font-size: 13px; color: var(--color-cb-gray-500); }
.hw-opt-none { padding: 12px 10px; font-size: 15px; color: var(--color-cb-gray-600); }
.hw-opt-none a { color: var(--color-brand-700); font-weight: 700; }

.hw-filters { display: grid; grid-template-columns: 1fr; gap: 10px; }
.hw-for { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13px; font-weight: 700; color: var(--color-cb-gray-600); }
.hw-for select { min-width: 0; width: 100%; }
.hw-for select {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--color-cb-gray-300);
  border-radius: var(--radius-md);
  background: var(--color-ink-white);
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  color: var(--color-cb-gray-900);
}

.hw-tree ul { list-style: none; margin: 0; padding: 0; }
.hw-tree > ul { display: flex; flex-direction: column; gap: 2px; }
.hw-area {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  font-family: inherit;
  text-align: start;
  cursor: pointer;
}
.hw-area:hover { background: var(--color-cb-gray-50); }
.hw-caret { width: 12px; font-size: 12px; color: var(--color-cb-gray-500); }
.hw-area-name { flex: 1; font-size: 15px; font-weight: 700; color: var(--color-cb-gray-900); }
.hw-area-now .hw-area-name { color: var(--color-brand-700); }
.hw-area-count { font-size: 12px; font-weight: 700; color: var(--color-cb-gray-500); padding: 1px 8px; border-radius: 999px; background: var(--color-cb-gray-100); }
.hw-area-body { padding: 0 6px 8px 30px; }
.hw-area-blurb { margin: 0 0 8px; font-size: 13px; line-height: 1.45; color: var(--color-cb-gray-600); }
.hw-job { padding: 6px 0; border-top: 1px solid var(--color-cb-gray-100); }
.hw-job-name { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--color-teal-soft-ink); margin-bottom: 4px; }
.hw-node { display: block; padding: 5px 8px; margin-left: -8px; border-radius: 6px; font-size: 14px; line-height: 1.35; color: var(--color-cb-gray-700); text-decoration: none; }
.hw-node:hover { background: var(--color-cb-gray-50); color: var(--color-cb-gray-900); }
.hw-node[aria-current="page"] { background: var(--color-brand-50); color: var(--color-brand-700); font-weight: 700; }
.hw-soon { display: block; font-size: 13px; font-style: italic; color: var(--color-cb-gray-500); }

/* The context: where the story sits and who it serves, held at the top while it plays. */
.hw-context {
  position: sticky;
  top: var(--hw-top, 64px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 -12px;
  padding: 12px;
  border-bottom: 1px solid var(--color-cb-gray-200);
  background: color-mix(in srgb, var(--color-ink-white) 94%, transparent);
  backdrop-filter: blur(8px);
}
.hw-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; color: var(--color-cb-gray-600); }
.hw-crumbs strong { color: var(--color-cb-gray-900); }
.hw-benefits { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hw-benefits-label { font-size: 13px; font-weight: 700; color: var(--color-teal-soft-ink); margin-right: 2px; }
.hw-chip {
  padding: 3px 10px;
  border: 1px solid var(--color-cb-gray-200);
  border-radius: 999px;
  background: var(--color-ink-white);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-cb-gray-700);
  cursor: pointer;
}
.hw-chip:hover { border-color: var(--color-cb-gray-300); }
.hw-chip[aria-pressed="true"] { border-color: var(--color-brand-200); background: var(--color-brand-100); color: var(--color-brand-700); }

@media (max-width: 960px) {
  .hw-lib { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .hw-side { position: static; max-height: none; overflow: visible; }
  /* Pinned on a phone too, so it stays one short block: the path without its middle, and the
     audiences in a row that scrolls sideways. */
  .hw-crumb-job { display: none; }
  .hw-crumbs { font-size: 13px; }
  .hw-benefits { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .hw-benefits::-webkit-scrollbar { display: none; }
  .hw-chip, .hw-benefits-label { flex-shrink: 0; white-space: nowrap; }
}

/* ---------- The abstract stage, for stories drawn as shapes rather than screens ---------- */

.hw-flow { display: flex; flex-direction: column; gap: 10px; }
.hw-flow-bar { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; color: var(--color-cb-gray-600); }
.hw-card-stage .hw-flow { width: 430px; }
