/* Hallmark · route: custom (bespoke) on the locked landing-v5 system · page: activity /{username}/activity
 * idea: "the value chart is a sheet behind range dividers; below it, each day is its own sheet under a divider tab,
 *        a ledger of what moved and what came in"
 * Base, bar, empty and footer copied from sets-v1/css/sets.css; chart from card-v1/css/card.css.
 * Hallmark · pre-emit critique: P5 H4 E4 S5 R5 V4
 */
:root { --text-who: clamp(4.2rem, 1.6rem + 11vw, 11rem); --radius-card: 4.762% / 3.409%; }
/* ---------- base (same as the other pages) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; background-color: var(--color-paper); }
body {
  margin: 0; background-color: var(--color-paper);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .32  0 0 0 0 .28  0 0 0 0 .2  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    radial-gradient(120% 1400px at 20% 0%, var(--color-stock), transparent 60%);
  background-repeat: repeat, no-repeat;
  color: var(--color-ink); font: 400 var(--text-md)/1.55 var(--font-body); -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; }
img { display: block; }
h1, h2, p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: var(--space-md); top: -100px; z-index: 50; background: var(--color-ink); color: var(--color-stock); padding: var(--space-xs) var(--space-md); border-radius: var(--radius-pill); text-decoration: none; }
.skip:focus-visible { top: var(--space-sm); }
.mono { font-family: var(--font-mono); font-variation-settings: "wdth" 87.5; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 30; min-height: var(--bar-h); display: flex; align-items: center; gap: var(--space-xl); padding: 0 var(--gutter); background: var(--color-paper); border-bottom: 1px solid var(--color-rule); }
.mark { font: 800 1.3rem/1 var(--font-display); font-variation-settings: "wdth" 70; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.bar-nav { display: flex; gap: var(--space-lg); margin-right: auto; }
.bar-nav a, .bar-link { font-weight: 600; font-size: var(--text-sm); text-decoration: none; white-space: nowrap; padding: 17px 2px 15px; border-bottom: 2px solid transparent; transition: border-color var(--dur-base) var(--ease-out); }
.bar-nav a { color: var(--color-muted); }
.bar-nav a:hover, .bar-link:hover { border-bottom-color: var(--color-rule-2); color: var(--color-ink); }
.bar-nav a[aria-current="page"] { color: var(--color-ink); border-bottom-color: var(--color-accent); }
.bar-end { display: flex; align-items: center; gap: var(--space-sm); }
.theme-toggle { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--color-rule-2); border-radius: var(--radius-pill); background: transparent; color: var(--color-ink); cursor: pointer; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme='light']) .theme-toggle .i-moon { display: none; }
}
:root[data-theme='dark'] .theme-toggle .i-sun { display: block; }
:root[data-theme='dark'] .theme-toggle .i-moon { display: none; }

/* ---------- head ---------- */
.head { padding: clamp(28px, 6vw, 72px) var(--gutter) clamp(28px, 4vw, 52px); }
.who { font: 820 var(--text-who)/.8 var(--font-display); font-variation-settings: "wdth" 62; letter-spacing: -.02em; }
.js:not(.still) .who { animation: lift-in 700ms var(--ease-settle) both; }
@keyframes lift-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.summary { margin-top: var(--space-md); font-size: var(--text-lg); color: var(--color-ink-2); }
.summary .mono { font-size: .86em; font-weight: 600; color: var(--color-ink); }
.summary .sep { color: var(--color-muted); margin: 0 .35em; }

.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px var(--space-md); padding-bottom: 10px; border-bottom: 2px solid var(--color-ink); }
.sec-t { font: 760 clamp(1.3rem, 1rem + 1vw, 1.75rem)/1.05 var(--font-display); font-variation-settings: "wdth" 72; letter-spacing: -.005em; min-width: 0; }
.sec-t .v { font: 600 var(--text-sm)/1 var(--font-body); color: var(--color-muted); letter-spacing: 0; }
.sec-r { font-size: var(--text-sm); color: var(--color-muted); }
.sec-r .mono { font-size: .9em; color: var(--color-ink-2); }
/* ---------- price history: a sheet behind range dividers ---------- */
.history { margin-top: clamp(36px, 4vw, 56px); }
.tabs { display: flex; align-items: flex-end; padding: 0 2px; }
.tab {
  position: relative; flex: none; margin-right: -6px; padding: 9px 18px 9px 16px; border: 0; cursor: pointer;
  background: var(--color-paper-2); color: var(--color-ink-2); border-radius: var(--radius-tab);
  box-shadow: inset 0 1px 0 var(--color-highlight), 0 0 0 1px var(--color-rule);
  font: 600 var(--text-xs)/1.2 var(--font-mono); font-variation-settings: "wdth" 87.5; transform: translateY(4px);
  transition: transform var(--dur-base) var(--ease-out);
}
.tab:hover { transform: translateY(1px); }
.tab[aria-selected="true"] { z-index: 4; background: var(--color-stock); color: var(--color-ink); transform: translateY(1px);
  box-shadow: inset 0 1px 0 var(--color-highlight), 0 -1px 0 var(--color-rule), -1px 0 0 var(--color-rule), 1px 0 0 var(--color-rule); }
.tab:focus-visible { outline-offset: -3px; }
.sheet { position: relative; z-index: 1; background: var(--color-stock); border-radius: 0 3px 3px 3px; box-shadow: var(--shadow-sheet); }
.chart-sheet { padding: var(--space-lg) clamp(16px, 2vw, 28px) var(--space-md); }
.ch-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-md); }
.ch-head .k { font-size: var(--text-sm); font-weight: 600; color: var(--color-muted); }
.ch-head .v { margin-top: 4px; font: 600 1.35rem/1.2 var(--font-mono); font-variation-settings: "wdth" 87.5; letter-spacing: -.04em; }
.ch-head .v small { display: inline-block; margin-left: 8px; font-size: var(--text-2xs); font-weight: 400; letter-spacing: -.02em; color: var(--color-flat); }
.ch-head .v small.up { color: var(--color-accent-deep); font-weight: 600; }
.ch-read { font-size: var(--text-xs); color: var(--color-ink-2); text-align: right; min-height: 1.4em; padding-top: 4px; white-space: nowrap; }
.chart { position: relative; margin-top: var(--space-sm); height: 210px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart:focus-visible { outline-offset: 6px; }
.chart .line { fill: none; stroke: var(--color-ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart .area { fill: var(--color-ink); opacity: .05; }
.chart .gap { stroke: var(--color-muted); stroke-width: 1.5; stroke-dasharray: 2 5; stroke-linecap: round; fill: none; vector-effect: non-scaling-stroke; }
.chart .grid { stroke: var(--color-rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .ylab, .chart .xlab { font: 400 10px/1 var(--font-mono); font-variation-settings: "wdth" 87.5; fill: var(--color-muted); }
.chart .end { fill: var(--color-ink); }
.chart .end.up { fill: var(--color-accent); }
.chart .cross { stroke: var(--color-ink); stroke-width: 1; opacity: .5; vector-effect: non-scaling-stroke; }
.chart .dot { fill: var(--color-stock); stroke: var(--color-ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .hover { opacity: 0; transition: opacity var(--dur-fast) linear; }
.chart.reading .hover { opacity: 1; }
/* the draw-in: a stock-coloured cover slides off to the right (transform only) */
.chart .cover { fill: var(--color-stock); transform-box: fill-box; transform-origin: 100% 50%; }
.js:not(.still) .chart .cover { animation: uncover 1100ms var(--ease-settle) both; animation-delay: 650ms; }
@keyframes uncover { to { transform: scaleX(0); } }
.still .chart .cover, .chart.redraw .cover { display: none; }
.since { margin-top: var(--space-xs); font-size: var(--text-xs); color: var(--color-muted); }
.no-hist { display: grid; place-items: center; height: 100%; color: var(--color-muted); font-size: var(--text-sm); }

/* ---------- empty ---------- */
.empty { text-align: center; padding: clamp(24px, 5vw, 56px) var(--space-md) clamp(32px, 6vw, 72px); }
.empty p { margin: var(--space-xs) auto 0; max-width: 38ch; color: var(--color-ink-2); }
.empty-t { font: 760 var(--text-h2)/1 var(--font-display); font-variation-settings: "wdth" 70; letter-spacing: -.01em; }
.pockets { display: flex; justify-content: center; gap: clamp(8px, 1.6vw, 18px); margin: 0 auto clamp(24px, 4vw, 40px); }
.pockets i { width: clamp(64px, 9vw, 112px); aspect-ratio: 245 / 342; border-radius: var(--radius-card); box-shadow: inset 0 0 0 1px var(--color-rule-2), inset 0 2px 0 var(--color-highlight-hi);
  background: linear-gradient(115deg, transparent 40%, var(--color-glint-hi) 50%, transparent 60%), var(--color-paper-2); }
.pockets i:nth-child(2) { transform: translateY(-6px); }
.empty--page { margin: 0 var(--gutter) var(--space-2xl); background: var(--color-binder-page); border-radius: 3px; box-shadow: var(--shadow-sheet); }

/* ---------- footer ---------- */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-lg); border-top: 1px solid var(--color-rule); padding: var(--space-xl) var(--gutter) 96px; font-size: var(--text-sm); color: var(--color-muted); }
.foot > div { max-width: 52ch; }
.foot-r { text-align: right; max-width: 40ch !important; }
.fbrand { display: block; font: 800 var(--text-md)/1.2 var(--font-display); font-variation-settings: "wdth" 70; color: var(--color-ink); margin-bottom: 4px; }
.legal { margin-top: var(--space-xs); }
.foot a { color: var(--color-ink-2); }


/* ---------- chart sits wide ---------- */
.history { margin: 0 var(--gutter); }
.chart { height: clamp(200px, 22vw, 300px); }
.ch-head .k2 { margin-top: 4px; font-size: var(--text-2xs); color: var(--color-muted); }
.no-hist { padding: 0 8px; }

/* ---------- the feed: one sheet per day under a divider tab ---------- */
.feed { padding: clamp(48px, 6vw, 88px) var(--gutter) clamp(64px, 8vw, 120px); }
.sec-r { font-size: var(--text-xs); }
.day { margin-top: clamp(28px, 3.4vw, 44px); }
.js:not(.still) .day { animation: lift-in 560ms var(--ease-settle) both; animation-delay: calc(var(--i, 0) * 80ms + 200ms); }
.dtab { position: relative; z-index: 2; display: inline-flex; align-items: baseline; gap: 10px; margin-bottom: -1px; padding: 9px 18px 8px 16px; border-radius: var(--radius-tab); background: var(--color-stock);
  box-shadow: inset 0 1px 0 var(--color-highlight), 0 -1px 0 var(--color-rule), -1px 0 0 var(--color-rule), 1px 0 0 var(--color-rule); }
.dtab b { font: 760 1.15rem/1 var(--font-display); font-variation-settings: "wdth" 72; }
.dtab span { font-size: var(--text-xs); color: var(--color-muted); }
.dsheet { list-style: none; margin: 0; padding: 6px clamp(14px, 2vw, 28px); background: var(--color-stock); border-radius: 0 3px 3px 3px; box-shadow: var(--shadow-sheet); }
.row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--color-rule); }
.row:last-child { border-bottom: 0; }
.thumb { position: relative; width: 46px; aspect-ratio: 245 / 342; border-radius: 3px; overflow: hidden; background: var(--color-paper-3); box-shadow: var(--shadow-rest); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .plus { position: absolute; right: -1px; bottom: -1px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 3px 0 3px 0; background: var(--color-ink); color: var(--color-stock); font: 600 13px/1 var(--font-mono); }
.rt { font-weight: 600; font-size: var(--text-md); line-height: 1.3; min-width: 0; }
.rt a { text-decoration: none; }
.rt a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.rt .mono { font-size: .82em; }
.rt .verb { font-weight: 400; color: var(--color-ink-2); }
.rs { margin-top: 2px; font-size: var(--text-sm); color: var(--color-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amt { text-align: right; font: 600 var(--text-md)/1.2 var(--font-mono); font-variation-settings: "wdth" 87.5; letter-spacing: -.03em; white-space: nowrap; }
.amt.up { color: var(--color-accent-deep); }
.amt.up::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--color-accent); vertical-align: 2px; }
.amt small { display: block; margin-top: 3px; font-size: var(--text-2xs); font-weight: 400; color: var(--color-muted); letter-spacing: -.02em; }
@keyframes lift-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

@media (max-width: 679px) {
  .bar { flex-wrap: wrap; gap: 0 var(--space-md); padding-top: 6px; }
  .mark { margin-right: auto; }
  .bar-nav { order: 3; flex-basis: 100%; margin: 0; }
  .bar-nav a { padding: 8px 2px 10px; }
  .bar-link { padding: 10px 2px; }
  .summary { font-size: var(--text-md); }
  .history { margin: 0; }
  .tabs { padding-left: var(--gutter); }
  .chart-sheet { border-radius: 0; }
  .chart { height: 190px; }
  .feed { padding-left: 0; padding-right: 0; }
  .sec-head { margin: 0 var(--gutter); }
  .dtab { margin-left: var(--gutter); }
  .dsheet { border-radius: 0; }
  .row { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 2px 12px; }
  .thumb { width: 40px; }
  .rt { font-size: var(--text-sm); }
  .rs { font-size: var(--text-xs); }
  .amt { font-size: var(--text-sm); }
  .foot-r { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation: none !important; }
  .chart .cover { display: none; }
}
.still .day, .still .who { animation: none; }
