/* Tiny Shifts: the hand-written layer over tokens.css. Loaded by every page.
   Everything here consumes a token; nothing here names a colour, a size or a face of its own.
   The Tailwind utilities cover layout; this file covers what a utility cannot express: the
   numeral, the wordmark, the theme control, focus, scrollbars, and the few motions. */

body {
  margin: 0; min-height: 100vh;
  background: var(--ground); color: var(--body);
  font-family: var(--font); font-size: var(--t-md); line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
::selection { background: var(--accent-4); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent-7); outline-offset: 2px; border-radius: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
[x-cloak] { display: none !important; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 200; padding: 8px 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--ink); border-radius: var(--r-ctl); }
.skip-link:focus { left: 8px; }

/* Native controls take the theme. */
input[type="date"], input[type="time"], input[type="datetime-local"] { color-scheme: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ground); }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border: 2px solid var(--ground); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── The wordmark: TiNY SHIFTS. The i is the only lowercase letter, because the word means small. ── */
.ts-wordmark { font-weight: 800; letter-spacing: -.02em; line-height: 1; color: var(--accent-fill); text-decoration: none; white-space: nowrap; }
.ts-wordmark:hover { color: var(--accent-fill); }
.ts-wordmark .lowercase { text-transform: lowercase; }

/* ── The numeral: 168 filled cells, 24 by 13, at three sizes. Never a strip. ── */
.ts-numeral { display: grid; grid-template-columns: repeat(24, var(--cell)); grid-auto-rows: var(--cell); gap: var(--cell-gap); width: max-content; max-width: 100%; }
.ts-numeral i { display: block; width: var(--cell); height: var(--cell); border-radius: 0; background: var(--w-empty); }
.ts-numeral i.gap { background: transparent; }
.ts-numeral[data-size="row"] { --cell: 2px; --cell-gap: 1px; }
.ts-numeral[data-size="panel"] { --cell: var(--m); --cell-gap: 2px; }
.ts-numeral[data-size="mast"] { --cell: clamp(9px, 2.9vw, 36px); --cell-gap: clamp(2px, .55vw, 8px); }
.ts-numeral[data-fill="week"] i[data-k="sleep"] { background: var(--w-sleep); }
.ts-numeral[data-fill="week"] i[data-k="leisure"] { background: var(--w-leisure); }
.ts-numeral[data-fill="week"] i[data-k="work"] { background: var(--w-work); }
.ts-numeral[data-fill="week"] i[data-k="home"] { background: var(--w-home); }
.ts-numeral[data-fill="week"] i[data-k="other"] { background: var(--w-other); }
.ts-numeral[data-fill="accent"] i.cell { background: var(--accent-fill); }
.ts-numeral[data-fill="ink"] i.cell { background: var(--ink); }
.ts-numeral i.session { background: var(--w-session); }
.ts-numeral[data-size="panel"] i.session, .ts-numeral[data-size="mast"] i.session { box-shadow: 0 0 0 calc(var(--cell-gap) * .6) var(--ground), 0 0 0 calc(var(--cell-gap) * 1.1) var(--w-session); }
.ts-numeral[data-fill="empty"] i.cell { background: var(--w-empty); }

/* ── Ledger furniture ── */
.ts-eyebrow { font-size: var(--t-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ts-rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.ts-rule-ink { border: 0; border-top: 1.5px solid var(--ink); margin: 0; }
.ts-instr { font-size: var(--t-sm); color: var(--muted); }

/* ── The drawn mark: one hand, where there is no data. ── */
.ts-drawn { stroke-linecap: round; stroke-linejoin: round; }

/* ── Motion: state change in the app, and nothing when the reader has asked for none. ── */
.btn-press:active { transform: scale(.98); }
.transition-smooth { transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
@keyframes ts-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.animate-fade-in { animation: ts-rise 240ms var(--ease) both; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ── The theme control (components/ui.html theme_toggle) ── */
.ts-theme [aria-checked="true"] { background: var(--ink); color: var(--ground); }

/* Slide 1 headline (Limore 2026-10-06, Nicholas): "Probably not." is its own line, the rest starts on the next. */
.slide .head h2 .ln { display: block; }
