/* ─── /networth ─── */
.nw-page {
  --nw-up: var(--positive);
  --nw-down: var(--accent2);
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 7rem 1.5rem 5rem;
  text-align: center;
}

.nw-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
}

.nw-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  letter-spacing: 0.04em;
  line-height: 1;
  margin: 0.6rem 0 0;
}

.nw-title .accent-z {
  color: var(--accent);
}

/* Fixed height, so the count-up can't move anything below it. */
.nw-value {
  font-family: var(--font-display);
  font-size: clamp(3rem, 12vw, 7rem);
  line-height: 1.1;
  height: 1.1em;
  margin: 1.2rem 0 2rem;
  color: var(--accent);
  white-space: nowrap;
}

.nw-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.nw-stat {
  padding: 1.2rem 0.75rem;
  border-right: 1px solid var(--border);
}

.nw-stat:last-child {
  border-right: none;
}

.nw-stat-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.nw-stat-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.1;
}

.nw-stat-num span {
  font-size: 0.75em;
  opacity: 0.8;
}

.nw-stat-num.is-up {
  color: var(--nw-up);
}

.nw-stat-num.is-down {
  color: var(--nw-down);
}

.nw-chart-box {
  border: 1px solid var(--border);
  background: var(--bg2);
  padding: 1rem;
}

.nw-ranges {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.nw-ranges button {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.5rem 0.8rem;
  min-height: 44px;
  cursor: pointer;
}

.nw-ranges button[aria-pressed="true"] {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.nw-ranges button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Reserved height: the SVG is drawn by JS and must not shift the page. */
.nw-chart {
  position: relative;
  height: 300px;
  color: var(--accent);
  touch-action: pan-y;
}

.nw-chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.nw-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.nw-cross {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  vector-effect: non-scaling-stroke;
  visibility: hidden;
}

.nw-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  visibility: hidden;
}

.nw-tip {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  padding: 0.4rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  /* pre, not nowrap: networth.js separates date and amount with two spaces. */
  white-space: pre;
  pointer-events: none;
  visibility: hidden;
}

.nw-chart.is-hovering .nw-cross,
.nw-chart.is-hovering .nw-dot,
.nw-chart.is-hovering .nw-tip {
  visibility: visible;
}

.nw-reset {
  margin-top: 2.5rem;
}

.nw-reset-btn {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent2);
  background: transparent;
  border: 1px solid var(--accent2);
  padding: 0.7rem 1.2rem;
  min-height: 44px;
  cursor: pointer;
}

@media (max-width: 600px) {
  .nw-page {
    padding: 6rem 1rem 4rem;
  }

  .nw-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .nw-stat {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .nw-stat:last-child {
    border-bottom: none;
  }

  .nw-chart {
    height: 220px;
  }

  .nw-ranges {
    justify-content: center;
  }
}

/* ─── PHONES: 12PX TEXT FLOOR ───
   This page's text under 0.75rem, lifted to it on phones - see the block of
   the same name at the end of base/shared.css. */
@media (max-width: 600px) {
  .nw-label,
  .nw-stat-label,
  .nw-ranges button,
  .nw-tip,
  .nw-reset-btn {
    font-size: 0.75rem;
  }
}
