/* ============================================================
   Aventurine — the layer over css/sections.css
   Load straight after css/sections.css.
   ============================================================ */

/* A price that names the model rather than a figure ("One-time purchase",
   Planner's card). It is three times as long as "Free", so it is
   sized to the card instead of the window: it stays on one line in a narrow
   card, and reaches the same 3rem as "Free" in a wide one, so the two cards'
   lists still start level. */
.price { container-type: inline-size }
.price .amount-model { font-size: clamp(2rem, 15cqi, 3rem); white-space: nowrap }

/* Step rows: a graphic beside each step's copy, alternating sides. Journal's
   are small wordless SVGs with their colours in the SVG itself; Planner's are
   drawn as the app and widen the art column (.pf-steps--app, below). */
.pf-steps { list-style: none; display: grid; gap: clamp(1.75rem,4vw,2.75rem); max-width: 960px; margin: 0 auto }
.pf-row { display: grid; grid-template-columns: clamp(140px,32vw,320px) minmax(0,1fr); gap: clamp(1.25rem,4vw,2.5rem); align-items: center }
.pf-row:nth-child(even) { grid-template-columns: minmax(0,1fr) clamp(140px,32vw,320px) }
.pf-row:nth-child(odd) .pf-art { order: -1 }
.pf-title {
  margin-bottom: .5rem;
  font-family: 'Lusitana', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.35rem,2.4vw,1.75rem);
  line-height: 1.2;
  color: var(--text);
}
.pf-copy p { color: var(--text-muted); font-size: 1rem }
.pf-art {
  display: block;
  width: 100%;
  height: auto;
}
@media (prefers-reduced-motion: no-preference) {
  .pf-flow { animation: pf-flow 1.2s linear infinite }
}
@keyframes pf-flow { to { stroke-dashoffset: -14 } }

/* ---------- Planner's build steps, drawn as the app ----------
   On aventurine-planner.html each step's graphic is the app's own modules and chart,
   floating on the page (.pf-steps--app). Each board is drawn on a 520 x 290
   grid of the app's pixels and scales as one piece: its font-size makes 1em
   16 of those pixels at any width, so every size below is the app's pixel
   value over 16, and --x / --y place a part in those pixels. Colours are
   the app's light theme (style.css there), except the surface of a part
   floating on the page: white rather than the app's cool grey, which reads
   muddy there. On the canvas (.pm-board--canvas) the parts are the app's
   dark theme (themes.css there), as they sit on its dark canvas. */
.pf-steps--app { max-width: 1120px }
.pf-steps--app .pf-title { font-size: clamp(1.6rem,2.9vw,2.15rem) }
.pf-steps--app .pf-row { grid-template-columns: minmax(0,1fr) minmax(0,1.45fr) }
.pf-steps--app .pf-row:nth-child(odd) { grid-template-columns: minmax(0,1.45fr) minmax(0,1fr) }
@media (max-width: 760px) {
  .pf-steps--app { gap: 3rem }
  .pf-steps--app .pf-row,
  .pf-steps--app .pf-row:nth-child(odd) { grid-template-columns: minmax(0,1fr) }
  .pf-steps--app .pf-row:nth-child(odd) .pf-art { order: 0 }
}

.pm-art { container-type: inline-size; max-width: 600px; margin-inline: auto }
.pm-board {
  --pm-surface: #fff;
  --pm-border: #cdd0ce;
  --pm-text: #191a19;
  --pm-text-2: #4d514f;
  --pm-text-3: #666b68;
  --pm-frost: rgba(0,0,0,.05);
  --pm-pay: #3a9163;
  --pm-deposits: #154eb2;
  --pm-spending: #b27d23;
  --pm-none: #7f8581;
  --pm-link: #7bbcf2;
  --pm-positive: #22a64a;
  /* the app's card shadow, and under it a long soft one so the parts float */
  --pm-shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.06), 0 18px 36px -18px rgba(28,26,22,.28);
  position: relative;
  aspect-ratio: 520 / 290;
  font: 500 calc(100cqi / 32.5)/1.3 'Manrope', system-ui, sans-serif;   /* 520 / 16 */
  color: var(--pm-text);
  font-variant-numeric: tabular-nums;
  user-select: none;
}
.pm-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible }

/* steps one and two: the modules on the app's canvas (canvas.css .stage)
   in its dark theme, the dotted ground framed as a panel on the face. The
   canvas is zoomed out a little, so the board shows 640 of the app's pixels
   across instead of 520: 1em is 16 of them (640 / 16), the dots are 24
   apart, and the links' viewBox is 640 x 356.9. */
.pm-board--canvas {
  --pm-surface: #191a19;
  --pm-border: #343735;
  --pm-canvas: #0c0d0d;
  --pm-text: #e5e6e5;
  --pm-text-2: #b3b7b5;
  --pm-text-3: #9ba09d;
  --pm-frost: rgba(255,255,255,.05);
  --pm-pay: #39832f;
  --pm-deposits: #5d99d5;
  --pm-spending: #d3a63e;
  /* how much of its colour a card takes, and its edge (canvas.css, dark) */
  --pm-tint: 14%;
  --pm-edge: 30%;
  font-size: calc(100cqi / 40);
  background: var(--pm-canvas) radial-gradient(circle, rgba(255,255,255,.11) .069em, transparent .1em) 0 0 / 1.5em 1.5em;
  border: 1px solid var(--pm-border);
  border-radius: .75em;
  box-shadow: 0 18px 36px -18px rgba(28,26,22,.28);
  overflow: clip;
}
/* on the canvas the cards wear the app's own shadow, nothing longer */
.pm-board--canvas .pm-node { box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.06) }

/* a module card (canvas.css .node), 220 x 140: tinted with its colour,
   with a hairline edge in the same hue */
.pm-node {
  --tile: var(--pm-none);
  position: absolute;
  left: calc(var(--x) * 1em / 16);
  top: calc(var(--y) * 1em / 16);
  width: 13.75em;
  height: 8.75em;
  display: flex;
  flex-direction: column;
  gap: .25em;
  padding: .875em 1em;
  background: color-mix(in srgb, var(--tile) var(--pm-tint), var(--pm-surface));
  border: 1px solid color-mix(in srgb, var(--tile) var(--pm-edge), var(--pm-surface));
  border-radius: 1.125em;
  box-shadow: var(--pm-shadow);
}
.pm-node[data-role="source"]  { --tile: var(--pm-pay) }
.pm-node[data-role="account"] { --tile: var(--pm-deposits) }
.pm-node[data-role="expense"] { --tile: var(--pm-spending) }
/* picked up and on its way down: tilted, on the app's dragging shadow */
.pm-node.is-dragging {
  z-index: 1;
  transform: rotate(-3deg);
  box-shadow: 0 4px 14px rgba(0,0,0,.22), 0 28px 48px -20px rgba(28,26,22,.35);
}
/* a large, faint copy of the module's icon, cut off by the card's corner;
   a layer of its own, as the ports sit outside the card's edge */
.pm-wm {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  color: var(--tile);
}
.pm-wm svg {
  position: absolute;
  right: -1.375em;
  bottom: -1.875em;
  width: 8em;
  height: 8em;
  fill: currentColor;
  opacity: .13;
}
/* the category: the module's icon and its kind, in its colour. Its own
   font-size makes its em 12 of the app's pixels. */
.pm-cat {
  position: relative;
  display: flex;
  align-items: center;
  gap: .5833em;
  font-size: .75em;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--tile);
}
.pm-cat svg { flex: none; width: 1.25em; height: 1.25em; fill: currentColor }
.pm-titles { position: relative; display: flex; flex-direction: column; min-width: 0; margin-top: .375em }
.pm-name,
.pm-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.pm-name { font-size: 1.125em; font-weight: 600; letter-spacing: -.02em; line-height: 1.15 }
.pm-meta { font-size: .6875em; font-weight: 600; letter-spacing: .04em; color: var(--pm-text-3) }
.pm-figure { position: relative; display: flex; align-items: baseline; gap: .375em; margin-top: auto }
.pm-value { font-size: 1.25em; font-weight: 600; letter-spacing: -.02em; line-height: 1 }
.pm-unit,
.pm-delta { font-size: .6875em; font-weight: 600; color: var(--pm-text-3) }
.pm-delta { margin-left: auto; font-weight: 700; color: var(--pm-positive) }
/* an account's bar: what was saved, then what it earned. Income and
   spending have none. */
.pm-bar { position: relative; display: flex; gap: .125em; height: .375em; border-radius: .1875em; background: var(--pm-frost); overflow: hidden }
.pm-bar > span { border-radius: .125em; background: var(--seg) }
.pm-bar > [data-role="account"] { --seg: var(--pm-deposits) }
.pm-bar > [data-role="growth"]  { --seg: var(--pm-positive) }

/* ports: money in on the left edge's middle, out on the right's, both in
   the module's colour: an outline until a link is attached, then filled */
.pm-port {
  position: absolute;
  top: 50%;
  width: .875em;
  height: .875em;
  margin-top: -.4375em;
  border: .125em solid var(--tile);
  border-radius: 50%;
  background: var(--pm-surface);
}
.pm-port--in { left: -.5em }
.pm-port--out { right: -.5em }
.pm-port.is-linked { background: var(--tile) }

/* links: all one light blue, with the money running along them as dots */
.pm-link { fill: none; stroke: var(--pm-link); stroke-width: 3; stroke-linecap: round; stroke-opacity: .75 }
.pm-flow { fill: none; stroke: var(--pm-surface); stroke-opacity: .85; stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: .5 14 }
@media (prefers-reduced-motion: no-preference) {
  .pm-flow { animation: pm-flow 1.4s linear infinite }
}
@keyframes pm-flow { to { stroke-dashoffset: -14.5 } }
/* a link's rule, a pill on the curve's midpoint. Its own font-size makes
   its em 11 of the app's pixels, so it places itself in those. */
.pm-label {
  position: absolute;
  left: calc(var(--x) * 1em / 11);
  top: calc(var(--y) * 1em / 11);
  display: inline-flex;
  align-items: center;
  gap: .3636em;
  height: 2em;
  padding: 0 .7273em;
  transform: translate(-50%, -50%);
  font-size: .6875em;
  font-weight: 700;
  color: var(--pm-text-2);
  white-space: nowrap;
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.pm-label::before { content: ''; width: .5455em; height: .5455em; border-radius: 50%; background: var(--pm-link) }

/* the hand carrying the module in step one */
.pm-cursor {
  position: absolute;
  z-index: 2;
  left: calc(var(--x) * 1em / 16);
  top: calc(var(--y) * 1em / 16);
  width: 1.75em;
  height: 1.75em;
  fill: #191a19;
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff) drop-shadow(0 2px 3px rgba(0,0,0,.25));
}

/* step three: the net worth chart (outlook.css .chart-*) on a floating panel,
   with the horizon chips floating over its corner */
.pm-panel {
  position: absolute;
  inset: 1.125em 0 0;
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-radius: .75em;
  box-shadow: var(--pm-shadow);
}
.pm-grid { stroke: rgba(0,0,0,.2); stroke-dasharray: 3 4 }
.pm-zero { stroke: rgba(0,0,0,.25) }
.pm-tick { fill: var(--pm-text-3); font-size: 11px; font-weight: 500 }
.pm-band { stroke: var(--pm-surface); stroke-width: 1; stroke-linejoin: round }
.pm-line { fill: none; stroke: #497e74; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round }
.pm-legend {
  position: absolute;
  left: calc(var(--x) * 1em / 16);
  top: calc(var(--y) * 1em / 16);
  width: 30.5em;
  display: flex;
  flex-wrap: wrap;
  gap: .25em 1em;
}
.pm-legend span { display: inline-flex; align-items: center; gap: .5455em; font-size: .6875em; font-weight: 600; color: var(--pm-text-2); white-space: nowrap }
.pm-legend i { width: .9091em; height: .9091em; border-radius: .2727em }
.pm-legend i.is-line { height: .2727em; background: #497e74 }
.pm-chips {
  position: absolute;
  top: 0;
  right: 1em;
  display: flex;
  align-items: center;
  gap: .125em;
  padding: .1875em;
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-radius: .625em;
  box-shadow: var(--pm-shadow);
}
.pm-chips b,
.pm-chips span {
  display: inline-flex;
  align-items: center;
  height: 2.3636em;
  padding: 0 .7273em;
  border-radius: .6364em;
  font-size: .6875em;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--pm-text-2);
}
.pm-chips b { font-weight: 600; letter-spacing: .04em; color: var(--pm-text-3) }
.pm-chips .is-on { background: #343735; color: #fff }

