/* /stats/ — «Vasya's days» (UX run-02). A v2 page on the css/toys.css tokens (DESIGN.md
   § 10): putty surface, ink, one cobalt accent (the «Today so far» slab and the note ramp),
   physical depth, light and dark, Geist + Geist Mono (--t-display swapped, like /versions/).
   The shared header floats fixed over the page; the body clears its height. */
body.days {
  --t-display: "Geist", ui-sans-serif, system-ui, sans-serif;
  --d-gutter: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
  --d-gap: 5px;
  /* The note ramp: none, one, two, three, four or more. Text on each step reaches 4.5:1. */
  --l0: var(--t-surface-2); --l0-ink: var(--t-ink);
  --l1: #c9d3ff; --l1-ink: #141414;
  --l2: #2f55ff; --l2-ink: #fff;
  --l3: #1a33b8; --l3-ink: #fff;
  --l4: #0e1d6e; --l4-ink: #fff;
  --d-mem: var(--t-mint-deep);
  padding-top: var(--header-h);
  font-family: var(--t-display);
  font-variation-settings: normal;
}
@media (prefers-color-scheme: dark) {
  body.days {
    --l1: #263266; --l1-ink: #f2f0ea;
    --l2: #1a33b8; --l2-ink: #fff;
    --l3: #2f55ff; --l3-ink: #fff;
    --l4: #8da2ff; --l4-ink: #141414;
    --d-mem: var(--t-mint);
  }
}
html:has(body.days) { scroll-padding-top: calc(var(--header-h) + 18px); }
body.days .t-wrap,
body.days .container-wide { width: min(100% - 2 * var(--d-gutter), 1240px); }
.d-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- masthead ---------- */
.d-main { padding-bottom: 40px; }
.d-mast { padding: 36px 0 24px; }
.d-kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--t-ink-2); font-variant-numeric: tabular-nums; }
.d-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--t-mint); animation: t-ping 1.5s var(--t-out) 3; }
.d-mast h1 {
  margin: 0; max-width: 14ch;
  font-size: 2.5rem; line-height: .92; font-weight: 800; letter-spacing: -.02em; text-wrap: balance;
  animation: d-rise .7s var(--t-spring) both;
}
.d-lede { margin: 20px 0 0; max-width: 46ch; font-size: 1.125rem; line-height: 1.4; color: var(--t-ink-2); text-wrap: pretty; }
.d-lede strong { color: var(--t-ink); font-weight: 600; }
@keyframes d-rise { from { transform: translateY(28px) scale(.97); } }
@media (min-width: 380px) { .d-mast h1 { font-size: 2.75rem; } }
@media (min-width: 600px) { .d-mast h1 { font-size: 4.5rem; } .d-lede { font-size: 1.3125rem; } }
@media (min-width: 1100px) { .d-mast { padding-top: 56px; } .d-mast h1 { font-size: 5.75rem; } }

/* ---------- today so far: the cobalt slab ---------- */
.d-today {
  margin: 8px 0 40px; padding: 22px 22px 20px; border-radius: var(--t-r-l);
  background: var(--t-cobalt); color: #fff;
  box-shadow: inset 0 -8px 0 rgba(0,0,0,.18), 0 20px 40px -24px rgba(0,0,0,.45);
}
.d-today-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.d-today-title, .d-today-date { margin: 0; font: 500 .75rem/1.4 var(--t-mono); letter-spacing: .08em; text-transform: uppercase; }
.d-today-title { display: inline-flex; align-items: center; gap: 9px; }
.d-today-title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--t-mint); box-shadow: 0 0 0 2px #fff; animation: t-ping 1.5s var(--t-out) 3; }
.d-today-date { font-variant-numeric: tabular-nums; }
.d-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; margin: 18px 0 0; }
.d-fig { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; min-width: 0; }
.d-fig dt { font-size: .9375rem; line-height: 1.3; }
.d-fig dd {
  margin: 0; min-height: 1em; font: 600 2.5rem/1 var(--t-mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.d-fig dd:empty::before { content: ""; display: block; width: 3.5ch; height: .8em; border-radius: 8px; background: rgba(255,255,255,.22); }
.d-fig dd.is-new { animation: d-tick .6s var(--t-out); }
@keyframes d-tick { from { transform: translateY(-.25em); } }
.d-today .d-asof { margin: 18px 0 0; font-size: .875rem; color: #fff; }
@media (min-width: 760px) {
  .d-today { padding: 26px 28px 24px; }
  .d-figs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .d-fig dd { font-size: 3.25rem; }
}

/* ---------- the calendar ---------- */
.d-days-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.d-days-head h2 { margin: 0; font-size: 2rem; line-height: 1; font-weight: 800; letter-spacing: -.02em; }
.d-you { margin: 0; max-width: 52ch; color: var(--t-ink-2); line-height: 1.4; }
.d-status { margin: 8px 0 0; min-height: 0; color: var(--t-ink-2); }
.d-status:empty { display: none; }
.d-layout { display: grid; grid-template-areas: "cal" "day" "legend"; gap: 24px; margin-top: 20px; align-items: start; }
.d-cal-box { grid-area: cal; min-width: 0; max-width: 460px; }
.d-day { grid-area: day; }
.d-legend-box { grid-area: legend; min-width: 0; max-width: 460px; }
.d-cal { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: var(--d-gap); margin: calc(-1 * var(--d-gap)); }
.d-cal[data-loading] { min-height: 420px; }
.d-cal thead th { padding: 0 0 4px; font: 500 .6875rem/1.2 var(--t-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--t-ink-2); text-align: center; }
.d-cal td { padding: 0; height: 1px; }
.d-blank { position: relative; }
.d-tomorrow { display: block; aspect-ratio: 1; border-radius: 10px; outline: 2px dashed var(--t-ink-2); outline-offset: -3px; opacity: .7; }
.d-sq {
  position: relative; display: block; width: 100%; aspect-ratio: 1; min-height: 38px; padding: 0; margin: 0;
  border: 0; border-radius: 10px; cursor: pointer;
  background: var(--l0); color: var(--l0-ink);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.12);
  font: 600 .8125rem/1 var(--t-mono); font-variant-numeric: tabular-nums;
  transition: transform var(--t-slow) var(--t-spring), box-shadow var(--t-base) var(--t-out);
  -webkit-tap-highlight-color: transparent;
}
.d-sq.l1 { background: var(--l1); color: var(--l1-ink); }
.d-sq.l2 { background: var(--l2); color: var(--l2-ink); }
.d-sq.l3 { background: var(--l3); color: var(--l3-ink); }
.d-sq.l4 { background: var(--l4); color: var(--l4-ink); }
/* The numeral sits a little above the middle; every mark keeps off its line (the review measured
   the old top-corner marks touching it below 430 px): the ship diamond sits on the memory bar's
   line at the foot, today's dot hangs off the top-right corner, a visit outlines the square. */
.d-num { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); line-height: 1; white-space: nowrap; }
/* The designed numeral face: `body.v2 button { font: inherit }` in toys.css outranked .d-sq and
   set the numbers in 17 px Geist, which is what ran into the marks on phones. */
body.days button.d-sq { font: 600 .8125rem/1 var(--t-mono); font-variant-numeric: tabular-nums; }
@media (min-width: 430px) { body.days button.d-sq { font-size: .9375rem; } }
@media (hover: hover) { .d-sq:hover { transform: translateY(-3px); } }
.d-sq:active { transform: translateY(2px) scale(.96); box-shadow: inset 0 -1px 0 rgba(0,0,0,.12); transition-duration: var(--t-fast); }
body.v2 .d-sq:focus-visible { outline: 3px solid var(--t-ink); outline-offset: 2px; }
.d-sq[aria-pressed="true"] { transform: translateY(-3px); box-shadow: 0 0 0 3px var(--t-surface), 0 0 0 6px var(--t-ink), 0 12px 20px -12px rgba(0,0,0,.5); z-index: 1; }
/* Marks: memory bar at the foot with the lemon diamond at its right end for something shipped,
   a mint dot on the top-right corner for today, an inner outline for a day the visitor looked in.
   All decorative: the square's name says it all. */
.d-mem { position: absolute; left: 6px; bottom: 6px; width: calc((100% - 12px) * var(--m, .1)); height: 3px; border-radius: 2px; background: var(--d-mem); }
.d-sq.has-ship .d-mem { width: calc((100% - 26px) * var(--m, .1)); }
.d-sq.l2 .d-mem, .d-sq.l3 .d-mem { background: var(--t-mint); }
@media (prefers-color-scheme: light) { .d-sq.l4 .d-mem { background: var(--t-mint); } }
.d-ship { position: absolute; right: 6px; bottom: 5px; width: 7px; height: 7px; transform: rotate(45deg); border-radius: 1px; background: var(--t-lemon); box-shadow: 0 0 0 1.5px #141414; }
.d-now { position: absolute; right: -2px; top: -2px; z-index: 2; width: 9px; height: 9px; border-radius: 50%; background: var(--t-mint); box-shadow: 0 0 0 1.5px #141414; animation: t-ping 1.5s var(--t-out) 3; }
.d-you-mark { position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px currentColor; pointer-events: none; }

.d-help { margin: 0; font-size: .875rem; line-height: 1.4; color: var(--t-ink-2); }
.d-legend { list-style: none; display: grid; gap: 8px; margin: 14px 0 0; padding: 0; font-size: .875rem; line-height: 1.3; color: var(--t-ink-2); }
.d-legend li { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 10px; }
.d-legend li > span:first-child { justify-self: center; }
.d-ramp { display: inline-flex; gap: 3px; }
.d-ramp i { width: 12px; height: 12px; border-radius: 3px; }
.d-ramp .l0 { background: var(--l0); box-shadow: inset 0 0 0 1px var(--t-line); }
.d-ramp .l1 { background: var(--l1); } .d-ramp .l2 { background: var(--l2); } .d-ramp .l3 { background: var(--l3); } .d-ramp .l4 { background: var(--l4); }
.d-key-mem, .d-key-ship, .d-key-you, .d-key-next { flex: none; display: inline-block; }
.d-key-mem { width: 24px; height: 3px; border-radius: 2px; background: var(--d-mem); }
.d-key-ship { width: 8px; height: 8px; transform: rotate(45deg); border-radius: 1px; background: var(--t-lemon); box-shadow: 0 0 0 1.5px #141414; }
.d-key-you { width: 14px; height: 14px; border-radius: 4px; background: var(--l0); box-shadow: inset 0 0 0 2px var(--t-ink); }
.d-key-next { width: 14px; height: 14px; border-radius: 4px; outline: 2px dashed var(--t-ink-2); outline-offset: -2px; }

/* ---------- the day card ---------- */
.d-day {
  min-width: 0; padding: 22px; border-radius: var(--t-r-l);
  background: var(--t-card); color: var(--t-ink); box-shadow: inset 0 0 0 2px var(--t-line);
}
.d-day-kicker { margin: 0 0 10px; color: var(--t-ink-2); font-variant-numeric: tabular-nums; }
.d-day-title { margin: 0; font-size: 2rem; line-height: 1; font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
.d-day-sum { margin: 12px 0 0; font-size: 1.0625rem; line-height: 1.45; color: var(--t-ink-2); text-wrap: pretty; }
.d-items { list-style: none; display: grid; gap: 10px; margin: 18px 0 0; padding: 0; }
.d-items[hidden] { display: none; }
.d-item-link {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px 12px 8px 8px; border-radius: var(--t-r-m);
  background: var(--t-surface); text-decoration: none; color: var(--t-ink);
  box-shadow: inset 0 0 0 1.5px var(--t-line), inset 0 -3px 0 rgba(0,0,0,.06);
  transition: transform var(--t-slow) var(--t-spring);
}
body.v2 a.d-item-link { color: var(--t-ink); text-decoration: none; }
@media (hover: hover) { .d-item-link:hover { transform: translateY(-2px); } .d-item-link:hover .d-item-title { text-decoration: underline; text-decoration-thickness: 1.5px; } }
.d-thumb { flex: none; display: block; width: 52px; height: 52px; border-radius: 12px; overflow: hidden; background: var(--t-surface-2); position: relative; }
.d-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.d-thumb-note:empty { background: var(--l2); }
.d-thumb-note:empty::after { content: ""; position: absolute; left: 13px; right: 13px; top: 16px; height: 3px; border-radius: 2px; background: #fff; box-shadow: 0 8px 0 #fff, 0 16px 0 rgba(255,255,255,.6); }
.d-thumb-toy { background: var(--t-mint); }
.d-thumb-toy::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: #141414; box-shadow: inset 0 -4px 0 rgba(255,255,255,.25); }
.d-thumb-version { background: var(--t-lemon); }
.d-thumb-version::after { content: ""; position: absolute; left: 14px; top: 14px; width: 24px; height: 24px; transform: rotate(45deg); border-radius: 3px; background: #141414; }
.d-item-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.d-item-kind { font: 500 .6875rem/1.2 var(--t-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--t-ink-2); }
.d-item-title { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.d-day-you { margin: 14px 0 0; display: flex; align-items: center; gap: 10px; color: var(--t-ink-2); }
.d-day-you::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 2px var(--t-ink); }
.d-day-you[hidden] { display: none; }
.d-keys { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.d-key {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px 3px; border: 0;
  border-radius: var(--t-r-btn); background: var(--t-surface); color: var(--t-ink); cursor: pointer;
  box-shadow: inset 0 0 0 1.5px var(--t-line), inset 0 -4px 0 rgba(0,0,0,.08);
  transition: transform var(--t-slow) var(--t-spring);
  -webkit-tap-highlight-color: transparent;
}
body.days button.d-key { font: 700 .9375rem/1.1 var(--t-display); }
body.days button.d-key-primary { background: var(--t-ink); color: var(--t-surface); box-shadow: inset 0 -4px 0 rgba(127,127,127,.35); }
.d-key:disabled { cursor: default; opacity: .55; }
@media (hover: hover) { .d-key:not(:disabled):hover { transform: translateY(-3px); } }
.d-key:not(:disabled):active { transform: translateY(2px) scale(.97); transition-duration: var(--t-fast); }
.d-share-status { margin: 10px 0 0; min-height: 1.4em; font-size: .9375rem; color: var(--t-ink-2); overflow-wrap: anywhere; }

@media (min-width: 900px) {
  body.days { --d-gap: 7px; }
  .d-layout { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); grid-template-areas: "cal day" "legend day"; gap: 24px 40px; }
  .d-legend-box { align-self: start; }
  .d-day { position: sticky; top: calc(var(--header-h) + 16px); padding: 28px; }
  .d-day-title { font-size: 2.75rem; }
}

/* ---------- memory ---------- */
.d-memory { margin-top: 56px; padding-top: 28px; border-top: 2px solid var(--t-line); }
.d-mem-title { margin: 0; font-size: 1.5rem; line-height: 1.1; font-weight: 800; letter-spacing: -.015em; }
.d-mem-lede { margin: 8px 0 0; color: var(--t-ink-2); }
.d-mem-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin: 20px 0 0; }
.d-mem-fig { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; padding: 16px; border-radius: var(--t-r-m); background: var(--t-card); box-shadow: inset 0 0 0 1.5px var(--t-line); }
.d-mem-fig dt { font-size: .9375rem; color: var(--t-ink-2); }
.d-mem-fig dd { margin: 0; font: 600 2rem/1 var(--t-mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.d-memory .d-asof { margin: 14px 0 0; font-size: .875rem; color: var(--t-ink-2); }
.d-privacy { margin: 40px 0 0; max-width: 70ch; font-size: .875rem; line-height: 1.45; color: var(--t-ink-2); }
.d-privacy code { font: 500 .8125rem var(--t-mono); }

@media (prefers-reduced-motion: reduce) {
  .d-mast h1, .d-dot, .d-now, .d-today-title::before, .d-fig dd.is-new { animation: none !important; }
  .d-sq, .d-sq:hover, .d-sq:active, .d-sq[aria-pressed="true"], .d-key, .d-key:hover, .d-key:active, .d-item-link, .d-item-link:hover { transform: none !important; transition: none !important; }
}
/* The narrowest phones: tighter spacing keeps each square near 38 px. */
@media (max-width: 359px) { body.days { --d-gap: 3px; } }
