/*
 * Home hub — the landing (views.md). A greeting, a column of section
 * cards (the first is the goal selector), and the agent card docked at the
 * bottom: sticky, always in reach while the rest scrolls.
 */

/* Greeting — the page heading (there is no top app bar on Home), with the
   settings entry point docked top-right. */
.greet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--space-2) var(--space-1) var(--space-5);
}

.greet__title {
  font-size: var(--text-display);
  font-weight: var(--weight-heading-strong);
  letter-spacing: var(--tracking-heading);
}

.hub {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Cards — a surface with an icon tile, a title/subtitle body, a chevron. */
.hub-card {
  display: block;
  padding: var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-raised);
  color: inherit;
  text-decoration: none;
}

a.hub-card:hover {
  text-decoration: none;
}

a.hub-card:hover .hub-card__chev {
  color: var(--color-ink);
}

.hub-card__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.hub-tile {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-control);
  background: var(--color-accent-tint);
  color: var(--color-accent-strong);
}

.hub-tile svg {
  width: 24px;
  height: 24px;
}

.hub-card__body {
  flex: 1;
  min-width: 0;
}

.hub-card__title {
  font-size: var(--text-title);
  font-weight: var(--weight-heading);
  letter-spacing: -0.01em;
}

.hub-card__sub {
  margin-top: 2px;
  font-size: var(--text-small);
  color: var(--color-muted);
}

.hub-card__chev {
  display: grid;
  place-items: center;
  flex: none;
  color: var(--color-muted);
}

.hub-card__chev svg {
  width: 20px;
  height: 20px;
}

/* Goal card — a native <details> disclosure: the summary is the card row, the
   options reveal below. No JS; the chevron rotates on open. */
.hub-card--goal > summary {
  list-style: none;
  cursor: pointer;
}

.hub-card--goal > summary::-webkit-details-marker {
  display: none;
}

.hub-card__chev--toggle svg {
  transition: transform var(--motion-base) var(--ease-out);
}

.hub-card--goal[open] .hub-card__chev--toggle svg {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .hub-card__chev--toggle svg {
    transition: none;
  }
}

/* Goal selector — one button_to per approach (no JS); the active one is tinted
   and shows a check. */
.goal-opts {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: var(--space-4);
  padding-top: var(--space-1);
  border-top: 1px solid var(--color-line);
}

.goal-opts form {
  margin: 0;
}

.goal-opt {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3);
  border: none;
  border-radius: var(--radius-control);
  background: none;
  color: var(--color-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.goal-opt:hover {
  background: var(--color-bg);
}

.goal-opt svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--color-muted);
}

.goal-opt__label {
  flex: 1;
  font-weight: var(--weight-label);
}

.goal-opt__check {
  display: none;
  place-items: center;
  color: var(--color-accent);
}

.goal-opt--active,
.goal-opt--active:hover {
  background: var(--color-accent-tint);
  color: var(--color-accent-strong);
}

.goal-opt--active svg {
  color: var(--color-accent-strong);
}

.goal-opt--active .goal-opt__label {
  font-weight: var(--weight-label-strong);
}

.goal-opt--active .goal-opt__check {
  display: grid;
}

/* Docked agent card — sticks to the bottom of the viewport while the hub scrolls
   above it. Its bg matches the page so scrolling cards vanish cleanly under it. */
.home-dock {
  position: sticky;
  bottom: 0;
  padding-top: var(--space-3);
  padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
  background: var(--color-bg);
}

.hub-card--agent {
  background: var(--color-agent-surface);
  box-shadow: var(--shadow-floating);
}

.hub-card--agent .hub-card__title {
  color: var(--color-surface);
}

.hub-card--agent .hub-card__sub {
  color: var(--color-agent-muted);
}

.hub-card--agent .hub-tile {
  background: var(--gradient-agent);
  color: var(--color-surface);
  box-shadow: var(--shadow-agent);
}

.hub-card--agent .hub-card__chev,
a.hub-card--agent:hover .hub-card__chev {
  color: var(--color-agent-accent);
}

/* Desktop: the hub is a focused, narrower centered menu — not full-width cards.
   Mobile is untouched. */
@media (min-width: 900px) {
  .home {
    max-width: 600px;
    margin-inline: auto;
    width: 100%;
  }
}
