/*
 * Focus overlay — the product's Brief / Thread / Draft / Original sheet,
 * plus the hero's reduction film and value ledger.
 */

/* ─────────── Focus ─────────── */
.focus {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.focus-scrim {
  position: absolute;
  inset: 0;
  background: rgba(247, 246, 243, 0.6);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  opacity: 0;
  transition: opacity 240ms var(--spring-out);
}

.focus.is-on .focus-scrim { opacity: 1; }

/* Materialises rather than fading: blur and scale move together. */
.focus-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 48px);
  border: 1px solid rgba(0, 0, 0, 0.035);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(20, 20, 30, 0.08), 0 40px 100px rgba(20, 20, 30, 0.2);
  opacity: 0;
  transform: translateY(12px) scale(0.985);
  filter: blur(5px);
  transition: opacity 260ms var(--spring-out), transform 260ms var(--spring-out), filter 260ms var(--spring-out);
}

.focus.is-on .focus-sheet { opacity: 1; transform: none; filter: blur(0); }

.fx-head { display: flex; align-items: center; gap: 13px; padding: 22px 26px 0; }

.fx-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.04);
  color: var(--muted);
  transition: background 180ms var(--spring), color 180ms var(--spring);
}

.fx-close:hover { background: rgba(0, 0, 0, 0.08); color: var(--ink); }
.fx-close svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; }

.fx-tabs {
  display: inline-flex;
  align-self: flex-start;
  gap: 2px;
  margin: 18px 26px 0;
  padding: 3px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.045);
}

.fx-tabs button {
  height: 28px;
  padding-inline: 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 13px;
  color: var(--muted);
  transition: background 200ms var(--spring), color 200ms var(--spring);
}

.fx-tabs button.on {
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.fx-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 20px 26px 6px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

.fx-lead { font-size: 16px; line-height: 1.5; color: var(--ink); }
.fx-rec { margin-top: 12px; font-size: 14px; }
.fx-rec b { color: var(--ink); font-weight: 600; }

.fx-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 20px;
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}

.fx-facts dt { color: var(--muted); }
.fx-facts dd { margin: 0; color: var(--ink); }

.fx-alts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.fx-alts button {
  border: 0;
  padding: 0;
  background: transparent;
  font-size: 13px;
  color: var(--muted);
  transition: color 180ms var(--spring);
}

.fx-alts button:hover { color: var(--ink); }

/* ── Thread ── */
.fx-thread { display: grid; gap: 2px; }

.fx-msg {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  padding: 12px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  font-size: 13.5px;
  transition: background 180ms var(--spring);
}

.fx-msg:hover { background: rgba(0, 0, 0, 0.03); }
.fx-msg time { color: var(--faint); font-variant-numeric: tabular-nums; padding-top: 1px; }
.fx-msg b { margin-right: 8px; font-weight: 600; color: var(--ink); }
.fx-subj { display: block; margin-top: 2px; color: var(--ink-2); }

.fx-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  background: #fbefe9;
  color: #b4552f;
  font-size: 11px;
}

.fx-open {
  display: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  white-space: pre-wrap;
  color: var(--ink);
}

.fx-msg.is-open .fx-open { display: block; }

/* ── Draft ── */
.fx-said { font-size: 16px; color: var(--ink); }
.fx-subject { margin-top: 10px; font-size: 13px; color: var(--muted); }
.fx-subject b { font-weight: 600; color: var(--ink); }

.fx-draft {
  margin-top: 10px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafaf8;
  white-space: pre-wrap;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
}

.fx-origin { margin-top: 10px; font-size: 12px; color: var(--muted); }
.fx-origin span { color: var(--faint); }

.fx-revise { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.fx-chip {
  height: 36px;
  padding-inline: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12.5px;
  color: var(--ink-2);
  transition: background 180ms var(--spring), transform 110ms ease-out;
}

.fx-chip:hover { background: rgba(0, 0, 0, 0.03); }
.fx-chip:active { transform: scale(0.96); }

/* ── Original ── */
.fx-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 14px;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.fx-meta dd { margin: 0; font-weight: 500; color: var(--ink); }
.fx-original { margin: 0; white-space: pre-wrap; font: inherit; color: var(--ink); }

/* ── Footer ── */
.fx-foot { display: flex; align-items: center; gap: 10px; padding: 14px 26px 22px; }

.fx-primary, .fx-secondary {
  height: 40px;
  padding-inline: 18px;
  border: 0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  transition: transform 110ms ease-out, background 180ms var(--spring);
}

.fx-primary { background: var(--ink); color: #fff; }
.fx-primary:hover { background: #1b1f28; }
.fx-secondary { background: rgba(0, 0, 0, 0.05); color: var(--ink); }
.fx-primary:active, .fx-secondary:active { transform: scale(0.97); }

/* The send button is disabled by design — the copy beside it explains why. */
.fx-primary.is-off { background: rgba(14, 16, 20, 0.4); cursor: not-allowed; }
.fx-primary.is-off:active { transform: none; }
.fx-note { font-size: 12.5px; color: var(--muted); }

body.focus-open { overflow: hidden; }

@media (max-width: 640px) {
  .focus { align-items: flex-end; padding: 0; }
  .focus-sheet { max-height: 92vh; border-radius: 22px 22px 0 0; }
  .fx-foot { flex-wrap: wrap; }
}

/* ─────────── HERO — reduction film and value ledger ─────────── */
/* The film gets its own band so the picture and the numbers explain each other:
   the mass arrives and settles behind the row, the few rise into it. */
.film-zone {
  position: relative;
  width: min(1020px, 100%);
  height: 240px;
  margin: 22px auto 0;
  transition-delay: 380ms;
}

.film {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* Fades at the edges so particles arrive out of the dark, not off a hard line. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.ledger {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.8vw, 24px);
  flex-wrap: nowrap;
  white-space: nowrap;
  width: fit-content;
  max-width: 100%;
  padding: 15px clamp(16px, 2.2vw, 26px);
  border: 1px solid var(--night-line);
  border-radius: 22px;
  background: rgba(9, 12, 19, 0.5);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 20px 60px rgba(0, 0, 0, 0.4);
}

.led { text-align: center; min-width: 88px; }

.led b {
  display: block;
  font-size: clamp(1.35rem, 2.1vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.led span {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  color: var(--on-night-3);
}

.led-mass b { color: var(--on-night-2); }
.led-out b { color: #7cadff; }

.led-arrow { display: grid; place-items: center; opacity: 0.4; }
.led-arrow svg { width: 34px; height: 12px; fill: none; stroke: #7cadff; stroke-width: 1.4; }

@media (max-width: 760px) {
  .led-arrow { display: none; }
  /* Two-by-two, full width, and a near-solid surface: small text must not sit
     on a translucent pane with the film moving behind it. */
  .ledger {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 16px 10px;
    white-space: normal;
    width: min(340px, calc(100% - 40px));
    padding: 18px 16px;
    background: rgba(9, 12, 19, 0.86);
  }
  .led { min-width: 0; }
  .led span { font-size: 0.64rem; color: var(--on-night-2); }
  .film-zone { height: 260px; }
}
