/* ── Enough: the hook, the plan and the revenue graphs on the homepage ──
   ?still and reduced motion show the end state straight away.
   ------------------------------------------------------------------ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hero { padding-top: 4px; }
/* nothing in the plan or the graphs can widen the page */
.layout > .main { min-width: 0; }

.kicker {
  margin-bottom: 18px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--text);
}

/* the hook */
.n-hook {
  font-size: clamp(28px, 3.3vw, 36px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.035em;
  color: var(--text);
}
.n-hook del {
  position: relative;
  white-space: nowrap;
  text-decoration: none;
  animation: n-dim 0.3s ease 1.55s forwards;
}
.n-hook del::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  top: 55%;
  height: 2.5px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  animation: n-strike 0.45s cubic-bezier(0.55, 0, 0.35, 1) 1.3s forwards;
}
.n-hook ins {
  display: inline-block;
  text-decoration: none;
  opacity: 0;
  transform: translateY(0.15em);
  animation: n-in 0.4s ease 1.85s forwards;
}
@keyframes n-strike { to { transform: scaleX(1); } }
@keyframes n-dim { to { color: var(--text-muted); } }
@keyframes n-in { to { opacity: 1; transform: none; } }


.n-plan { margin-top: 40px; }
.n-plan .section-label { margin-bottom: 14px; }   /* straight onto the card, no line under it */
.plan {
  list-style: none;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
}
.plan-step { padding: 16px 20px; }
.plan-step + .plan-step { border-top: 1px solid var(--card-border); }
/* number, name and status on one line, what it covers and the amount under it */
.plan-head { display: flex; align-items: center; gap: 10px; }
.plan-head .plan-price { margin-left: auto; font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.plan-head .plan-price + .project-card-badge { margin-left: 0; }
.plan-sub { margin: 4px 0 0 30px; font-family: var(--mono); font-size: 13px; color: var(--text-secondary); }
.plan-no { width: 20px; font-family: var(--mono); font-size: 12px; color: var(--text-muted); }
.plan-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.plan-items { margin: 10px 0 0 30px; list-style: none; }
.plan-items li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-secondary);
}
.plan-items li + li { border-top: 1px dashed var(--border); }
.plan-check {
  position: relative;
  flex: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--text-muted);
  border-radius: 3px;
}
.plan-price { margin-left: auto; color: var(--text); }
.plan-price small { font-size: 12px; color: var(--text-muted); }
/* the sum of it all: what "enough" means, and how close the last 30 days came */
.plan-sum {
  padding: 12px 20px;
  background: var(--surface);
  border-top: 1px solid var(--card-border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-family: var(--mono);
  font-size: 13px;
}
.plan-now { display: flex; align-items: center; gap: 16px; font-weight: 500; color: var(--text-secondary); }
.plan-bar { flex: 1; height: 6px; overflow: hidden; border-radius: 3px; background: var(--border); }
.plan-bar-fill { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--green); transition: width 0.8s ease; }
.plan-now-value { white-space: nowrap; color: var(--text); }
/* this month's revenue in the app cards: daily revenue as a line, one green series per card */
.rev { --line: #16a34a; font-family: var(--mono); }
.rev-head { font-size: 12px; color: var(--text-muted); }
.rev-head b { font-weight: 600; color: var(--text); }
.rev-plot { position: relative; height: 56px; margin-top: 18px; color: var(--line); }
/* the top of the scale: a dashed line with its value just above it */
.rev-grid {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: flex-end;     /* zero height, so the label sits just above the line */
  justify-content: flex-end;
  height: 0;
  border-top: 1px dashed var(--border);
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-muted);
}
.rev-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rev-base { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.rev-line {
  fill: none;
  stroke: var(--line);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
/* today: a dot on the end of the line, ringed in the card colour */
.rev-end, .rev-hit > i {
  position: absolute;
  width: 8px;
  height: 8px;
  margin: 0 0 -4px -4px;
  border-radius: 50%;
  background: var(--line);
  box-shadow: 0 0 0 2px var(--card-bg);
}
/* hover: a crosshair, a dot on the line and the numbers above it */
.rev-hit { position: absolute; top: 0; bottom: 0; transform: translateX(-50%); }
.rev-hit > i { display: none; left: 50%; bottom: var(--y); }
.rev-hit:hover > i { display: block; z-index: 2; }
.rev-hit:hover::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  border-left: 1px dashed var(--text-muted);
}
.rev-hit:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--text);
  color: var(--bg);
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}
.rev-hit.is-left:hover::after { left: 0; transform: none; }
.rev-hit.is-right:hover::after { left: auto; right: 0; transform: none; }
.rev-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 10px; color: var(--text-muted); }

/* two cards side by side, every month on the left, the fund on the right */
.plan-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.plan-cards > .plan { display: flex; flex-direction: column; }
.plan-cards .plan-now { margin-top: auto; flex-wrap: wrap; justify-content: space-between; row-gap: 8px; }   /* at the bottom of its card */
.plan-cards .plan-now .plan-bar { order: 3; flex: 1 1 100%; }   /* the bar gets a line of its own in the narrow card */

/* the cool stuff fund: what's saved, a bar towards the total, the four things, where the money comes from */
.fund-total { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 0 30px; }
.fund-total b { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.fund-total span { font-family: var(--mono); font-size: 13px; color: var(--text-muted); }
.fund-bar { display: block; height: 6px; margin: 8px 0 0 30px; overflow: hidden; border-radius: 3px; background: var(--border); }
.fund-bar-fill { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--green); transition: width 0.8s ease; }
.fund .plan-items { margin-top: 12px; }

/* hover (or tab to) a thing in the fund: a small card with a photo of it */
.plan-items li { position: relative; }
.plan-items li[tabindex]:focus-visible { outline: 2px solid var(--text-muted); outline-offset: 2px; border-radius: 4px; }
.plan-tip {
  position: absolute;
  left: 22px;
  bottom: calc(100% + 4px);
  z-index: 10;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(20, 30, 50, 0.16);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}
.plan-tip img { display: block; width: 240px; height: 160px; object-fit: contain; border-radius: 4px; }
.plan-items li:hover .plan-tip,
.plan-items li:focus-visible .plan-tip { opacity: 1; transform: none; }

/* live bits stay out of sight until /api/revenue has answered */
[hidden] { display: none !important; }
/* ticked off: add class="done" to the item */
.plan-items li.done .plan-check { background: var(--text); border-color: var(--text); }
.plan-items li.done .plan-check::after {
  content: "";
  position: absolute;
  left: 3.5px;
  top: 0.5px;
  width: 4px;
  height: 8px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.plan-items li.done .plan-item { text-decoration: line-through; color: var(--text-muted); }

@media (max-width: 540px) {
  .plan-cards { grid-template-columns: 1fr; }
}

/* ── end state straight away ── */
.still .n-hook del, .still .n-hook del::after, .still .n-hook ins { animation: none; }
.still .n-hook del { color: var(--text-muted); }
.still .n-hook del::after { transform: none; }
.still .n-hook ins { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .n-hook del, .n-hook del::after, .n-hook ins { animation: none; }
  .n-hook del { color: var(--text-muted); }
  .n-hook del::after { transform: none; }
  .n-hook ins { opacity: 1; transform: none; }
}

/* ── the pull-out trading cards are hidden on this page for now; the markup and scripts stay ── */
.project-slot .pull:not(.pull--photos) { display: none; }
.project-slot:not(.project-slot--photos) > .project-card { padding-bottom: 20px; }   /* no room needed for the sleeve */
