/* IC Home — launcher that precedes the IC Request chat.
   Two paths: start a new update, or check on one already in flight.
   Layered on top of bsp-tokens.css; shares the chat's visual vocabulary.
   ============================================================ */

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bsp-navy);
  font-family: var(--bsp-font-body);
  color: var(--bsp-fg);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Signature film grain */
body::before {
  content: ""; position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.045;
  pointer-events: none;
  mix-blend-mode: overlay;
  z-index: 200;
}

.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; justify-content: center; align-items: stretch;
  background:
    radial-gradient(ellipse 70% 60% at 50% -8%, rgba(255,210,0,0.06), transparent 60%),
    var(--bsp-navy);
}

/* ---------- App frame ---------- */
.home {
  width: 100%;
  max-width: var(--app-max);
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  display: flex; flex-direction: column;
}

/* ---------- Top chrome (matches chat) ---------- */
.home-head {
  position: sticky; top: 0; z-index: 30;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) clamp(20px, 5vw, 40px) 16px;
  background: linear-gradient(to bottom, rgba(var(--bsp-navy-rgb),0.96) 0%, rgba(var(--bsp-navy-rgb),0.86) 70%, transparent 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.home-mark { display: flex; align-items: center; gap: 0; }
.home-mark .word {
  font-family: var(--bsp-font-display);
  color: var(--bsp-yellow);
  font-size: 24px;
  letter-spacing: 0.04em;
  line-height: 1;
}
.home-mark .mark-logo { display: block; height: 28px; width: auto; }
.home-mark .role {
  font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--bsp-fg-dim);
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--bsp-border);
}
.home-user { display: flex; align-items: center; gap: 9px; }
.home-user .avatar {
  width: 30px; height: 30px;
  border: 1px solid var(--bsp-border-hi);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--bsp-font-display);
  font-size: 12px;
  color: var(--bsp-yellow);
}
.home-user .name { font-size: 11px; color: var(--bsp-fg); line-height: 1.25; }
.home-user .name strong { font-weight: 500; }
.home-user .name span { display: block; color: var(--bsp-fg-dim); font-size: 10px; }

/* ---------- Scroll body ---------- */
.home-scroll {
  flex: 1;
  overflow-y: auto;
  padding: clamp(24px, 5vw, 44px) clamp(20px, 5vw, 40px) 56px;
  display: flex; flex-direction: column;
  gap: clamp(28px, 4vw, 40px);
  scrollbar-width: thin;
  scrollbar-color: var(--bsp-border-hi) transparent;
}
.home-scroll::-webkit-scrollbar { width: 6px; }
.home-scroll::-webkit-scrollbar-thumb { background: var(--bsp-border-hi); }

/* ---------- Hero ---------- */
.home-hero { display: flex; flex-direction: column; gap: 14px; }
.hero-eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--bsp-fg-dim);
}
.hero-eyebrow .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--bsp-yellow);
}
.hero-eyebrow .sep { color: var(--bsp-border-hi); }
.hero-title {
  font-family: var(--bsp-font-display);
  font-size: clamp(40px, 8vw, 68px);
  line-height: 0.94;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--bsp-fg);
  margin: 0;
  text-wrap: balance;
}
.hero-title em {
  font-style: normal;
  color: var(--bsp-yellow);
}
.hero-sub {
  font-size: 15px; font-weight: 300;
  line-height: 1.55;
  color: var(--bsp-fg-dim);
  letter-spacing: 0.005em;
  max-width: 46ch;
  text-wrap: pretty;
}

@keyframes homePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- Full-width "Start an update" banner ---------- */
.banner {
  position: relative;
  display: flex; align-items: center; gap: clamp(20px, 4vw, 36px);
  padding: clamp(24px, 4vw, 34px) clamp(22px, 4vw, 36px);
  background: var(--bsp-bg-card);
  border: 1px solid var(--bsp-border-gold);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: background var(--bsp-dur-base) var(--bsp-ease-out),
              border-color var(--bsp-dur-base) var(--bsp-ease-out),
              transform var(--bsp-dur-base) var(--bsp-ease-out);
}
/* spotlight halo — "look here" */
.banner::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 140% at 88% 50%, rgba(255,210,0,0.14) 0%, rgba(255,210,0,0.04) 30%, transparent 60%);
  pointer-events: none;
}
/* gold top-bar that scales in from the left — the brand press-card signal */
.banner::after {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--bsp-yellow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--bsp-dur-base) var(--bsp-ease-out);
}
.banner:hover {
  background: var(--bsp-bg-card-hi);
  transform: translateY(-3px);
}
.banner:hover::after { transform: scaleX(1); }

.banner-text { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.banner-eyebrow {
  display: flex; align-items: center; gap: 8px;
  font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--bsp-yellow);
}
.banner-eyebrow .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--bsp-yellow);
}
.banner-title {
  font-family: var(--bsp-font-display);
  font-size: clamp(34px, 6vw, 48px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--bsp-fg);
  margin: 0;
}
.banner-body {
  font-size: 14px; font-weight: 300;
  line-height: 1.5;
  color: var(--bsp-fg-dim);
  letter-spacing: 0.005em;
  max-width: 52ch;
  text-wrap: pretty;
}
.banner-arrow {
  position: relative;
  flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bsp-yellow);
  border: 1px solid var(--bsp-yellow);
  color: var(--bsp-navy);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 28px -8px rgba(255,210,0,0.45);
  transition: background var(--bsp-dur-base) var(--bsp-ease-out),
              transform var(--bsp-dur-base) var(--bsp-ease-out);
}
.banner:hover .banner-arrow {
  background: var(--bsp-yellow-hi);
  transform: scale(1.06) rotate(0deg);
}
@media (max-width: 540px) {
  .banner { flex-direction: column; align-items: flex-start; gap: 18px; }
  .banner-arrow { align-self: flex-end; }
}

/* ---------- In-flight list (always visible) ---------- */
.flight {
  display: flex; flex-direction: column;
  gap: 0;
}
.flight-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 16px;
}
.flight-eb {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--bsp-fg-dim);
  white-space: nowrap;
}
.flight-rule { flex: 1; height: 1px; background: var(--bsp-border); }
.flight-count {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--bsp-fg-dim);
  white-space: nowrap;
}
.flight-count .needs { color: var(--bsp-yellow); }

.flight-list {
  display: flex; flex-direction: column;
  border: 1px solid var(--bsp-border);
}

/* ---------- Update row ---------- */
.row { border-bottom: 1px solid var(--bsp-border); }
.row:last-child { border-bottom: none; }
.row-main {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--bsp-font-body);
  color: inherit;
  appearance: none; -webkit-appearance: none;
  transition: background var(--bsp-dur-fast) var(--bsp-ease-out);
}
.row-main:hover { background: var(--bsp-bg-card); }
.row.feedback .row-main { background: rgba(255,210,0,0.04); }
.row.feedback .row-main:hover { background: rgba(255,210,0,0.07); }
.row.feedback { border-left: 2px solid var(--bsp-yellow); }

.row-thumb {
  width: 46px; height: 46px;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bsp-navy-light) 0%, var(--bsp-navy) 100%);
  border: 1px solid var(--bsp-border);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-thumb .mono {
  font-family: var(--bsp-font-display);
  font-size: 13px; letter-spacing: 0.02em;
  color: rgba(255,210,0,0.7);
  text-align: center; line-height: 1;
}
.row-thumb .play {
  position: absolute;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(var(--bsp-navy-rgb),0.7);
  border: 1px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--bsp-fg);
}

.row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.row-name {
  font-size: 14px; font-weight: 500;
  color: var(--bsp-fg);
  letter-spacing: -0.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-phase {
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--bsp-fg-dim);
  padding: 2px 7px;
  border: 1px solid var(--bsp-border-gold);
  color: var(--bsp-yellow);
  white-space: nowrap;
}
.row-when { font-size: 11px; color: var(--bsp-fg-dim); }

.row-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

/* status badge */
.status {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  white-space: nowrap;
  color: var(--bsp-fg-dim);
}
.status .sdot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--bsp-fg-dim);
}
.status.feedback { color: var(--bsp-yellow); }
.status.feedback .sdot { background: var(--bsp-yellow); box-shadow: 0 0 8px rgba(255,210,0,0.7); }
.status.reviewing { color: var(--bsp-fg); }
.status.reviewing .sdot { background: var(--bsp-yellow); animation: homePulse 1.2s ease-in-out infinite; }
.status.queue .sdot { background: var(--bsp-fg-muted); }
.status.draft { color: var(--bsp-fg-dim); }
.status.draft .sdot { background: transparent; border: 1px solid var(--bsp-fg-dim); }
.status.closed { color: var(--bsp-fg-dim); opacity: 0.7; }
.status.closed .sdot { background: var(--bsp-border-hi); }

.row-chev {
  color: var(--bsp-fg-dim);
  display: flex;
  transition: transform var(--bsp-dur-fast) var(--bsp-ease-out);
}
.row.open .row-chev { transform: rotate(180deg); }
@media (max-width: 540px) {
  .status { font-size: 0; gap: 0; }
  .status .sdot { width: 9px; height: 9px; }
  .row-phase { display: none; }
}

/* ---------- Row detail (expanded) ---------- */
.row-detail {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--bsp-dur-base) var(--bsp-ease-out);
}
.row.open .row-detail { max-height: 640px; }
.detail-inner {
  padding: 4px 16px 18px 76px;
  display: flex; flex-direction: column;
  gap: 14px;
}
@media (max-width: 540px) {
  .detail-inner { padding-left: 16px; }
}

/* feedback payload */
.fb-headline {
  font-size: 14.5px; font-weight: 500;
  line-height: 1.4;
  color: var(--bsp-fg);
  letter-spacing: -0.005em;
}
.fb-actions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.fb-action {
  display: flex; gap: 11px; align-items: baseline;
  font-size: 13px; font-weight: 300;
  line-height: 1.5;
  color: var(--bsp-fg-muted);
  letter-spacing: 0.005em;
  text-wrap: pretty;
}
.fb-action .num {
  font-family: var(--bsp-font-display);
  font-size: 12px;
  color: var(--bsp-yellow);
  flex-shrink: 0;
  letter-spacing: 0.04em;
  min-width: 16px;
}

/* routing timeline */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-step {
  display: flex; gap: 12px; align-items: flex-start;
  position: relative;
  padding-bottom: 14px;
}
.tl-step:last-child { padding-bottom: 0; }
.tl-rail {
  position: relative; flex-shrink: 0;
  width: 9px; display: flex; flex-direction: column; align-items: center;
}
.tl-node {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bsp-fg-dim);
  margin-top: 4px;
  z-index: 1;
}
.tl-step.done .tl-node { background: var(--bsp-fg-muted); }
.tl-step.active .tl-node { background: var(--bsp-yellow); box-shadow: 0 0 8px rgba(255,210,0,0.7); }
.tl-step.pending .tl-node { background: transparent; border: 1px solid var(--bsp-border-hi); }
.tl-line {
  position: absolute; top: 13px; bottom: -4px; left: 4px;
  width: 1px; background: var(--bsp-border);
}
.tl-step:last-child .tl-line { display: none; }
.tl-text { display: flex; flex-direction: column; gap: 2px; padding-top: 1px; }
.tl-label {
  font-size: 12.5px; font-weight: 400;
  color: var(--bsp-fg);
  letter-spacing: 0.005em;
}
.tl-step.pending .tl-label { color: var(--bsp-fg-dim); }
.tl-meta { font-size: 11px; color: var(--bsp-fg-dim); letter-spacing: 0.005em; }

/* sent snapshot (note that went up) */
.snap {
  font-size: 12.5px; font-weight: 300;
  line-height: 1.55;
  color: var(--bsp-fg-muted);
  letter-spacing: 0.005em;
  padding: 10px 12px;
  background: var(--bsp-bg-card);
  border-left: 2px solid var(--bsp-border-hi);
  text-wrap: pretty;
}
.snap .snap-eb {
  display: block;
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--bsp-fg-dim);
  margin-bottom: 5px;
}

/* detail actions */
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.daction {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  font-family: var(--bsp-font-body);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  appearance: none; -webkit-appearance: none;
  transition: background var(--bsp-dur-fast) var(--bsp-ease-out),
              border-color var(--bsp-dur-fast) var(--bsp-ease-out),
              color var(--bsp-dur-fast) var(--bsp-ease-out);
}
.daction.primary {
  background: var(--bsp-yellow);
  border: 1px solid var(--bsp-yellow);
  color: var(--bsp-navy);
}
.daction.primary:hover { background: var(--bsp-yellow-hi); border-color: var(--bsp-yellow-hi); }
.daction.ghost {
  background: transparent;
  border: 1px solid var(--bsp-border-hi);
  color: var(--bsp-fg-muted);
}
.daction.ghost:hover { border-color: var(--bsp-yellow); color: var(--bsp-yellow); }

/* ---------- Footer rule ---------- */
.home-foot {
  display: flex; align-items: center; gap: 14px;
  padding-top: 4px;
}
.home-foot .rule { flex: 1; height: 1px; background: var(--bsp-border); }
.home-foot .lbl {
  font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--bsp-fg-dim);
}
