/* WHealth — two channels, one timeline.
   No webfonts by design: every face here ships with iOS, so nothing is
   fetched from a third party and the app works with the server unreachable. */

:root {
  --ink:        #0F1319;
  --panel:      #171D25;
  --panel-hi:   #1E2630;
  --line:       #232B36;
  --text:       #E6E9ED;
  --muted:      #8A94A2;
  --faint:      #5C6673;

  --health:     #F2795D;
  --health-dim: #6B392E;
  --wealth:     #7FA8F2;
  --wealth-dim: #2F4670;
  --alert:      #FFC24B;

  --display: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --body:    system-ui, -apple-system, "SF Pro Text", sans-serif;
  --mono:    ui-monospace, SFMono-Regular, Menlo, monospace;

  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { padding-bottom: var(--safe-bottom); }

/* ---------------------------------------------------------------- gate --- */

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 24px;
}
.gate-inner { max-width: 30ch; }
.gate-title {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.gate-copy { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0 0 12px; }
.gate-copy strong { color: var(--text); font-weight: 600; }
.gate-note {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0;
}

/* ---------------------------------------------------------------- head --- */

.head {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: calc(var(--safe-top) + 14px) 18px 0;
  background: linear-gradient(var(--ink) 78%, transparent);
  backdrop-filter: blur(12px);
}

.head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.wordmark {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--health);
}
.wordmark-split { color: var(--wealth); }

.bell {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px 6px 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .18s, border-color .18s;
}
.bell-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--faint);
  transition: background .18s, box-shadow .18s;
}
.bell.is-on { color: var(--text); border-color: var(--wealth-dim); }
.bell.is-on .bell-dot {
  background: var(--wealth);
  box-shadow: 0 0 0 3px rgba(127,168,242,.16);
}

/* ------------------------------------------------------- signature strip --- */
/* Two channels sharing one 24-hour axis: body pushes up, money pushes down.
   The shape of the day is readable before a single word is. */

.trace { margin: 18px 0 4px; }

.trace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.trace-label,
.tally {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.trace-counts { display: flex; gap: 12px; }
.tally b { font-weight: 600; }
.tally-health b { color: var(--health); }
.tally-wealth b { color: var(--wealth); }

.trace-plot {
  position: relative;
  height: 46px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
}
.trace-axis {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--line);
}
.trace-now {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(transparent, var(--faint), transparent);
}

.tick {
  position: absolute;
  width: 2px;
  border-radius: 1px;
  transform: translateX(-1px);
}
.tick-health { bottom: 50%; background: var(--health); }
.tick-wealth { top: 50%; background: var(--wealth); }
.tick-alert  { background: var(--alert); width: 3px; }

.trace-hours {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--faint);
  letter-spacing: 0.06em;
}

/* ------------------------------------------------------------- filters --- */

.filters {
  display: flex;
  gap: 6px;
  padding: 14px 0 12px;
}
.filter {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  color: var(--muted);
  font-family: var(--body);
  font-size: 13px;
  cursor: pointer;
  transition: background .16s, color .16s, border-color .16s;
}
.filter.is-active {
  background: var(--panel-hi);
  border-color: var(--panel-hi);
  color: var(--text);
}

/* ---------------------------------------------------------------- feed --- */

.feed {
  position: relative;
  padding: 4px 18px 40px;
}

/* the trace continues down the page as a physical line */
.spine {
  position: absolute;
  left: 25px;
  top: 0;
  bottom: 40px;
  width: 1px;
  background: linear-gradient(var(--line) 70%, transparent);
}

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

.entry {
  position: relative;
  padding: 0 0 20px 26px;
}

.entry-node {
  position: absolute;
  left: 0;
  top: 6px;
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
}
.entry-node::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 3.5px var(--ink);
}
.entry-health .entry-node::before { background: var(--health); }
.entry-wealth .entry-node::before { background: var(--wealth); }
.entry-alert  .entry-node::before {
  background: var(--alert);
  box-shadow: 0 0 0 3.5px var(--ink), 0 0 10px rgba(255,194,75,.5);
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.entry-time,
.entry-chan {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.entry-time { color: var(--faint); }
.entry-health .entry-chan { color: var(--health); }
.entry-wealth .entry-chan { color: var(--wealth); }

.entry-title {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin: 0;
}
.entry-body {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 4px 0 0;
}

.entry-more {
  margin-top: 8px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.entry-more:hover { color: var(--muted); }

/* Full text lives here — this is the thing Pushover's 1024 cap made impossible */
.entry-detail {
  margin: 10px 0 0;
  padding: 12px 14px;
  background: var(--panel);
  border-left: 2px solid var(--line);
  border-radius: 0 6px 6px 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.day-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 16px -26px;
  padding-left: 26px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.day-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* --------------------------------------------------------------- empty --- */

.empty { padding: 48px 8px; max-width: 34ch; }
.empty-title {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 8px;
}
.empty-copy { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0; }
.empty-copy code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--wealth);
}

/* --------------------------------------------------------------- toast --- */

.toast {
  position: fixed;
  left: 18px; right: 18px;
  bottom: calc(var(--safe-bottom) + 18px);
  padding: 12px 16px;
  background: var(--panel-hi);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
  animation: rise .22s ease-out;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------ a11y ------- */

:focus-visible {
  outline: 2px solid var(--wealth);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}


/* ---------- structured brief cards ---------- */

.entry-lead {
  margin: 0.35rem 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  opacity: 0.95;
}

.entry-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border-left: 2px solid rgba(255, 255, 255, 0.2);
}

.metric-good { border-left-color: #3fb950; }
.metric-warn { border-left-color: #d29922; }
.metric-bad  { border-left-color: #f85149; }

.metric-label {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}

.metric-value {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
}

.metric-delta {
  font-size: 0.7rem;
  opacity: 0.65;
}

.entry-section { margin-bottom: 0.7rem; }

.section-title {
  margin: 0 0 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: 0.55;
}

.section-bullets {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.section-bullets li { margin-bottom: 0.2rem; }

.entry-action {
  margin: 0.6rem 0 0;
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  background: rgba(88, 166, 255, 0.1);
  border-left: 2px solid #58a6ff;
  font-size: 0.9rem;
  line-height: 1.45;
}
