/*
 * Hero: headline and the live command-screen simulation (js/console.js drives it).
 * Proportions follow docs/design/Main.dc.html: dock rail, brief + KPIs + loop + feed, Needs-you aside.
 */

.hero {
  padding: clamp(48px, 8vw, 104px) 0 0;
}

.hero-copy {
  margin-bottom: clamp(40px, 6vw, 72px);
}

.hero-copy h1 {
  font-size: clamp(46px, 6.6vw, 94px);
  line-height: 1;
}

.hero-copy .lede {
  margin-top: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* ---------- Console frame ---------- */

.console {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--elev-console);
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
}

.console-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-3);
}

.console-org {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.org-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 12px;
}

.console-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent);
  animation: pulse 2s ease-out infinite;
}

.live-dot.is-paused {
  background: var(--warn);
  animation: none;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent);
  }
  70% {
    box-shadow: 0 0 0 8px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.console-clock {
  margin-left: auto;
  color: var(--faint);
  font-size: 13px;
}

.console-body {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 320px;
  min-height: 640px;
}

/* ---------- Dock ---------- */

.console-dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 0;
  border-right: 1px solid var(--line);
  background: var(--dock);
}

.dock-tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 14%, var(--card));
  color: var(--c);
}

.dock-tile.is-active {
  background: var(--c);
  color: var(--on-ink);
}

.dock-tile svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The Command tile carries the brand mark (the same mark as the logo), drawn filled. */
.dock-tile .brand-glyph {
  width: 24px;
  height: 24px;
}

.dock-tile.has-badge::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warn);
  border: 2px solid var(--dock);
}

/* ---------- Main column ---------- */

.console-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 26px 28px 22px;
  min-width: 0;
}

.brief-date {
  margin: 0;
  color: var(--faint);
  font-size: 13px;
}

.brief-greeting {
  margin: 2px 0 6px;
  font-size: 32px;
  line-height: 1.1;
}

.brief-text {
  margin: 0;
  max-width: 60ch;
  color: var(--quiet);
  font-size: 15px;
}

.brief-text strong {
  color: var(--ink);
  font-weight: 600;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.kpi-label {
  color: var(--faint);
  font-size: 12.5px;
}

.kpi-value {
  font-size: 25px;
  font-weight: 500;
  line-height: 1.2;
}

.kpi-note {
  color: var(--faint);
  font-size: 12px;
}

.kpi-note.is-up {
  color: var(--accent);
}

.loop {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.loop-tile {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--c);
  min-width: 0;
}

.loop-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loop-state {
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.loop-state::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.loop-state.is-ok {
  color: var(--accent);
}

.loop-state.is-warn {
  color: var(--warn);
}

.loop-state.is-watch {
  color: var(--muted);
}

.loop-state.is-paused {
  color: var(--warn);
}

.loop-count {
  color: var(--faint);
  font-size: 12px;
}

.loop-count::after {
  content: ' actions';
  font-family: var(--font-sans);
  letter-spacing: 0;
}

/* ---------- Feed ---------- */

.feed {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 14px 16px 6px;
  min-height: 220px;
}

.feed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.feed-head h3 {
  font-size: 14px;
}

.feed-hint {
  color: var(--faintest);
  font-size: 12px;
}

.paused-note {
  margin: 4px 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--warn-strong);
  font-size: 12.5px;
}

.feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feed-item {
  display: grid;
  grid-template-columns: 44px 92px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
}

.feed-item:first-child {
  border-top: 0;
}

.feed-item time {
  color: var(--faintest);
  font-size: 12px;
}

.feed-panel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--c);
}

.feed-panel::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--c);
}

.feed-text {
  color: var(--ink);
  font-size: 13.5px;
}

.feed-item.is-new {
  animation: feed-in 0.6s ease-out;
}

@keyframes feed-in {
  from {
    opacity: 0;
    background: var(--success-bg);
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    background: transparent;
    transform: none;
  }
}

/* ---------- Prompt bar ---------- */

.prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 16px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
  font-size: 14.5px;
}

.prompt-icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.prompt-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prompt-caret {
  width: 1.5px;
  height: 18px;
  margin-left: -8px;
  background: var(--ink);
  animation: caret 1s steps(1) infinite;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

/* ---------- Needs-you aside ---------- */

.console-side {
  border-left: 1px solid var(--line);
  background: var(--paper-3);
  padding: 26px 20px;
}

.side-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.side-head h3 {
  font-size: 15px;
}

.side-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--warn);
  color: #fff;
  font-size: 12px;
}

.side-count.is-zero {
  background: var(--accent);
}

.approvals {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.approval {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn-bar);
  border-radius: 12px;
  padding: 14px 14px 12px;
}

.approval-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 6px;
  color: var(--faint);
  font-size: 12px;
}

.approval-meta .conf {
  margin-left: auto;
  font-size: 11.5px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--c);
  flex: none;
}

.approval h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.approval-why {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.approval-actions {
  display: flex;
  gap: 8px;
}

.approval.is-done {
  border-left-color: var(--success-line);
}

.approval-done {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--success-bg);
  color: var(--accent-strong);
}

.approval-done.is-declined {
  background: var(--paper);
  color: var(--quiet);
}

.side-empty {
  margin: 14px 0 0;
  padding: 14px;
  border: 1px dashed var(--line-hover);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
}

.console-caption {
  margin: 14px 0 0;
  color: var(--faint);
  font-size: 14px;
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .console-body {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .console-side {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .approvals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .loop {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .console {
    border-radius: 16px;
  }

  .console-body {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .console-dock {
    flex-direction: row;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }

  .dock-tile {
    flex: none;
    width: 34px;
    height: 34px;
  }

  .console-bar {
    gap: 12px;
    padding: 0 14px;
  }

  .console-status span[data-agent-state] {
    white-space: nowrap;
  }

  .console-org span:last-child {
    display: none;
  }

  .console-main {
    padding: 20px 16px;
  }

  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi:last-child {
    display: none;
  }

  .kpi-value {
    font-size: 21px;
  }

  .loop {
    display: none;
  }

  .feed-item {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .feed-panel {
    grid-column: 2;
  }

  .feed-text {
    grid-column: 2;
  }

  .feed-item time {
    grid-row: 1 / span 2;
  }

  .approvals {
    display: flex;
  }

  .console-side {
    padding: 20px 16px;
  }
}
