/* ==========================================================================
   Irada Hub — HOME (home.css)
   The landing page. Builds on app.css tokens only (--panel*, --line*, --paper,
   --mut, --faint, --accent*, --danger/--warn/--info, --r*, --f-head, --ease,
   --brand-navy, --brand-grad) so dark and light both follow the theme. Brand:
   navy is a touch (the title in light mode), the gradient a thin line only.
   Every class is prefixed .home-.
   ========================================================================== */

.home {
  --home-gap: 22px;
  max-width: 1180px;
  min-width: 0;
  margin: 0 auto;
  color: var(--paper);
}
.home a { color: inherit; text-decoration: none; }
.home :focus-visible { outline: 2px solid var(--accent-fg); outline-offset: 2px; border-radius: 8px; }

/* ------------------------------------------------------------------ hero */
.home-hero {
  position: relative;
  padding: 6px 0 20px;
  margin-bottom: 18px;
}
.home-hero::after {                       /* the brand line — thin, never a fill */
  content: ''; position: absolute; left: 0; bottom: 0;
  width: min(220px, 40%); height: 2px; border-radius: 2px;
  background: var(--brand-grad); opacity: .85;
}
.home-eyebrow {
  margin: 0 0 6px; font-size: 12.5px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--faint);
}
.home-title {
  margin: 0; font-family: var(--f-head); font-weight: 800;
  font-size: clamp(24px, 3.2vw, 32px); line-height: 1.15; letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
[data-theme="light"] .home-title { color: var(--brand-navy); }
.home-lede {
  margin: 8px 0 0; max-width: 62ch; font-size: 14.5px; line-height: 1.55; color: var(--mut);
}
.home-lede b { color: var(--paper); font-weight: 650; }

.home-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.home-act {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  font: 600 13px/1.2 var(--f-head); color: var(--paper);
  background: var(--panel); border: 1px solid var(--line);
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
}
.home-act:hover { background: var(--panel2); border-color: var(--line2); transform: translateY(-1px); }
.home-act:active { transform: none; }
.home-act-ico { color: var(--accent-fg); font-size: 14px; line-height: 1; }

/* ------------------------------------------------------------------ pulse */
.home-pulse { margin-bottom: var(--home-gap); }
.home-pulse-label {
  margin: 0 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--faint);
}
.home-pulse-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.home-tile {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  padding: 14px 16px; border-radius: var(--r);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--sh-card, none);
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
a.home-tile:hover { border-color: var(--line2); background: var(--panel2); }
.home-pulse-n { font: 800 26px/1.1 var(--f-head); font-variant-numeric: tabular-nums; }
.home-pulse-l { font-size: 12.5px; color: var(--mut); }
.home-tile.tone-danger .home-pulse-n { color: var(--danger); }
.home-tile.tone-warn .home-pulse-n { color: var(--warn); }

/* ------------------------------------------------------------------ grid */
.home-grid {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--home-gap); align-items: start;
}
.home-main, .home-side { display: flex; flex-direction: column; gap: var(--home-gap); min-width: 0; }

.home-sec {
  min-width: 0; padding: 16px; border-radius: var(--r-lg);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--sh-card, none);
}
.home-sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.home-sec-head h2 { margin: 0; font: 750 15px/1.3 var(--f-head); letter-spacing: .005em; }
.home-sec-link { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--accent-fg) !important; }
.home-sec-link:hover { text-decoration: underline; }
.home-count {
  min-width: 22px; padding: 1px 7px; border-radius: 999px; text-align: center;
  font: 700 12px/18px var(--f-head); color: var(--accent-ink); background: var(--accent);
}
.home-quiet { margin: 2px 0; font-size: 13px; line-height: 1.5; color: var(--faint); }
.home-more { margin: 12px 2px 0; font-size: 12.5px; color: var(--faint); }
.home-more a { color: var(--accent-fg); font-weight: 600; }
.home-link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--accent-fg); font-weight: 600; }
.home-stale { margin: -6px 0 16px; font-size: 12.5px; color: var(--warn); }

/* ------------------------------------------------------------------ needs */
.home-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.home-card {
  --tone: var(--info);
  position: relative; min-width: 0; border-radius: var(--r);
  background: var(--panel2); border: 1px solid var(--line);
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.home-card::before {                      /* a quiet tone rail */
  content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--tone); opacity: .9;
}
.home-card.tone-danger { --tone: var(--danger); }
.home-card.tone-warn   { --tone: var(--warn); }
.home-card.tone-info   { --tone: var(--accent-line); }
.home-card.tone-calm   { --tone: var(--line2); }
.home-card:hover { border-color: var(--line2); background: var(--panel3); }
.home-card-link {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: start; gap: 12px;
  padding: 12px 12px 12px 16px; border-radius: inherit;
}
.home-card-ico, .home-card-av {
  width: 30px; height: 30px; display: grid; place-items: center; flex: none;
}
.home-card-ico {
  border-radius: 9px; font: 700 14px/1 var(--f-head);
  color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent);
}
.home-card-av .avatar { width: 30px; height: 30px; font-size: 11px; }
.home-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.home-card-title {
  font-weight: 650; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.home-card-sub {
  font-size: 13px; line-height: 1.45; color: var(--mut); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.home-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 2px; }
.home-tag {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; line-height: 18px;
  color: var(--tone, var(--mut)); background: color-mix(in srgb, var(--tone, var(--mut)) 13%, transparent);
}
.home-tag.tone-danger { --tone: var(--danger); }
.home-tag.tone-warn   { --tone: var(--warn); }
.home-tag.tone-info   { --tone: var(--accent-fg); }
.home-when { font-size: 12px; color: var(--faint); }
.home-card-go { align-self: center; color: var(--faint); font-size: 18px; line-height: 1; transition: transform .15s var(--ease); }
.home-card:hover .home-card-go { transform: translateX(2px); color: var(--paper); }

.home-rsvp { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px 58px; }
.home-rsvp-btn {
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
  font: 600 12.5px/1.2 var(--f-head); color: var(--paper);
  background: transparent; border: 1px solid var(--line2);
}
.home-rsvp-btn:hover { background: var(--panel); border-color: var(--accent-line); }
.home-rsvp-btn[data-home-rsvp="going"] { border-color: var(--accent-line); color: var(--accent-fg); }
.home-rsvp-btn:disabled { opacity: .55; cursor: default; }

/* ------------------------------------------------------------------ empty */
.home-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 26px 12px 22px; }
.home-empty-ico {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%;
  font: 800 20px/1 var(--f-head); color: var(--accent-fg);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}
.home-empty-title { margin: 12px 0 4px; font: 750 16px/1.3 var(--f-head); }
.home-empty-sub { margin: 0; max-width: 40ch; font-size: 13px; line-height: 1.5; color: var(--mut); }
.home-empty--error { margin-top: 40px; }
.home-empty--error .home-empty-ico { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); box-shadow: none; }
.home-empty--error .btn { margin-top: 14px; }

/* ------------------------------------------------------------------ agenda */
.home-agenda, .home-day-items { list-style: none; margin: 0; padding: 0; }
.home-agenda { display: flex; flex-direction: column; gap: 12px; }
.home-day-label {
  margin: 0 0 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--faint);
}
.home-day-label.is-today { color: var(--accent-fg); }
.home-ag {
  --k: var(--accent-fg);
  display: grid; grid-template-columns: 50px 8px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 7px 8px; margin: 0 -8px; border-radius: 10px;
  transition: background .15s var(--ease);
}
.home-ag:hover { background: var(--panel2); }
.home-ag.evk-task { --k: var(--faint); }
.home-ag-time { font-size: 12.5px; font-weight: 650; color: var(--mut); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-ag-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--k); }
.home-ag.is-task .home-ag-dot { background: transparent; box-shadow: inset 0 0 0 2px var(--k); }
.home-ag-main { display: flex; flex-direction: column; min-width: 0; }
.home-ag-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-ag-sub { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-ag-sub:empty { display: none; }
.home-ag-rsvp { font-size: 11px; font-weight: 650; padding: 1px 7px; border-radius: 999px; color: var(--mut); background: var(--panel3); white-space: nowrap; }
.home-ag-rsvp.r-going { color: var(--accent-fg); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.home-ag-rsvp.r-invited { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }

/* ------------------------------------------------------------------ chips */
.home-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.home-chips li { min-width: 0; max-width: 100%; }
.home-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 6px 10px 6px 11px; border-radius: 999px;
  font-size: 13px; color: var(--mut) !important;
  background: var(--panel2); border: 1px solid var(--line);
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.home-chip:hover { border-color: var(--accent-line); color: var(--paper) !important; }
.home-chip.is-unread { color: var(--paper) !important; font-weight: 650; }
.home-chip.is-muted { opacity: .7; }
.home-chip-hash { color: var(--faint); font-weight: 700; }
.home-chip-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.home-chip-badge {
  min-width: 18px; padding: 0 6px; border-radius: 999px; text-align: center;
  font: 700 11px/18px var(--f-head); color: var(--paper); background: var(--panel3);
}
.home-chip-badge.is-mention { color: var(--danger-on, #fff); background: var(--danger); }

/* ------------------------------------------------------------------ decisions */
.home-decs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.home-dec {
  display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 8px; margin: 0 -8px; border-radius: 10px; transition: background .15s var(--ease);
}
.home-dec:hover { background: var(--panel2); }
.home-dec-mark {
  margin-top: 2px; font-size: 11px; line-height: 16px;
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.home-dec-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.home-dec-title { font-size: 13.5px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.home-dec-meta { font-size: 12px; color: var(--faint); }

/* ------------------------------------------------------------------ skeleton */
.home-sk {
  display: block; height: 12px; margin: 0 0 10px; border-radius: 6px;
  background: linear-gradient(90deg, var(--panel2) 0%, var(--panel3) 50%, var(--panel2) 100%);
  background-size: 200% 100%; animation: home-sk 1.4s ease-in-out infinite;
}
.home-sk.tall { height: 28px; }
.home-sk.card { height: 58px; border-radius: var(--r); }
.home-sk.w30 { width: 30%; } .home-sk.w40 { width: 40%; } .home-sk.w55 { width: 55%; } .home-sk.w70 { width: 70%; }
.home-hero--ghost::after { opacity: .3; }
@keyframes home-sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ------------------------------------------------------------------ nav row */
/* Home and Dashboard are the two top-level rows: they sit together, no gap. */
.nav-module[data-mod="home"] { margin-bottom: 0; }

/* ------------------------------------------------------------------ responsive */
/* Two columns need room: below ~1000 px (the rail takes 212) the agenda
   column would be too narrow to read, so stack. */
@media (max-width: 1000px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .home { --home-gap: 16px; }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .home-hero { padding-top: 0; margin-bottom: 14px; }
  .home-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .home-act { justify-content: center; padding: 10px 12px; }
  .home-pulse-row { grid-template-columns: 1fr 1fr; }
  .home-sec { padding: 14px 12px; border-radius: var(--r); }
  .home-card-link { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; padding: 11px 10px 11px 14px; }
  .home-card-ico, .home-card-av, .home-card-av .avatar { width: 28px; height: 28px; }
  .home-rsvp { padding-left: 52px; }
  .home-ag { grid-template-columns: 50px 8px minmax(0, 1fr) auto; gap: 8px; }
  /* the rail is a bottom bar here: the row joins it like any other item */
  .nav-module[data-mod="home"] { display: contents; }
}
@media (max-width: 380px) {
  .home-rsvp { padding-left: 14px; }
  .home-ag-rsvp { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .home-sk { animation: none; }
  .home-act, .home-card-go { transition: none; }
}
