/* Tools hub (tools/index.html): stage hero + instrument panel. Spec: docs/SPEC.md §5, COPY "Tools hub". */

/* ---------- Hero ---------- */
.th-hero { padding: calc(var(--header-h) + clamp(56px, 8vw, 112px)) 0 clamp(64px, 8vw, 112px); }
.th-hero-grid { display: grid; gap: 56px; align-items: end; }
@media (min-width: 1024px) { .th-hero-grid { grid-template-columns: 1.1fr .9fr; gap: 72px; } }
.th-hero .ks-display { color: var(--parchment); }
.th-lead { margin-top: 28px; max-width: 26em; }
.th-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* Ledger: the product output as the hero image */
.th-ledger { margin: 0; background: var(--stage-2); border: 1px solid var(--hair-stage); border-radius: var(--r-panel); padding: clamp(24px, 3vw, 36px); }
.th-ledger-head { display: flex; align-items: center; gap: 10px; font: 400 13px/1.4 var(--font-sans); color: var(--parchment-2); margin: 0 0 12px; }
.th-ledger-head::before { content: ''; width: 7px; height: 7px; border-radius: var(--r-pill); background: var(--kesef); flex: none; }
.th-ledger dl { margin: 0; }
.th-line { display: flex; align-items: baseline; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--hair-stage); }
.th-line dt { font: 400 15px/1.35 var(--font-sans); color: var(--parchment-2); flex: 0 1 auto; }
.th-line::after { content: ''; order: 1; flex: 1 1 24px; min-width: 16px; border-bottom: 1px dotted rgba(236, 230, 216, .22); transform: translateY(-4px); }
.th-line dd { order: 2; margin: 0; font: 400 22px/1 var(--font-sans); letter-spacing: -0.01em; color: var(--parchment); font-variant-numeric: tabular-nums; white-space: nowrap; }
.th-line--total { border-bottom: 0; padding-top: 22px; flex-wrap: wrap; }
.th-line--total dt { color: var(--parchment); }
.th-line--total dd { font: 300 clamp(40px, 4.6vw, 60px)/1 var(--font-sans); letter-spacing: -0.03em; color: var(--kesef); }
.th-ledger-note { font: 400 12.5px/1.5 var(--font-sans); color: var(--parchment-3); margin: 14px 0 0; }
@media (max-width: 520px) {
  .th-line--total { display: grid; gap: 10px; }
  .th-line--total::after { display: none; }
}

/* ---------- Instrument panel ---------- */
.th-panel { background: var(--paper); padding: 88px 0; }
@media (min-width: 1024px) { .th-panel { padding: 160px 0; } }
.th-panel-head { display: grid; gap: 20px; max-width: 760px; margin-bottom: clamp(48px, 6vw, 80px); }
.th-panel-head .ks-eyebrow { margin: 0; }

.ti-group { margin-top: clamp(40px, 5vw, 64px); }
.ti-group:first-of-type { margin-top: 0; }
.ti-group-title { display: flex; align-items: baseline; gap: 10px; font: 500 14px/1.3 var(--font-sans); letter-spacing: 0; color: var(--ink-2); margin: 0 0 14px; }
.ti-group-title span { font-weight: 400; color: var(--ink-3); }
.ti-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair-strong); }
.ti-rows li { border-bottom: 1px solid var(--hair); }
@media (min-width: 1100px) {
  .ti-group { display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 40px; margin-top: 0; }
  .ti-group-title { margin: 0; padding-top: 24px; border-top: 1px solid var(--hair-strong); align-self: start; height: 100%; }
  .ti-group + .ti-group .ti-rows, .ti-group + .ti-group .ti-group-title { border-top-color: var(--hair-strong); }
  .ti-group .ti-rows { border-top: 1px solid var(--hair-strong); }
  .ti-group:not(:last-of-type) { margin-bottom: 0; }
  .ti-group:not(:last-of-type) .ti-rows li:last-child { border-bottom: 0; }
}

.ti-row { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) 28px; align-items: center; gap: 32px; min-height: 104px; padding: 22px 20px; margin: 0 -20px; border-radius: var(--r-chip); color: var(--ink); text-decoration: none; transition: background .3s var(--ease); }
a.ti-row:hover, a.ti-row:focus-visible { background: var(--paper-2); }
.ti-name { display: grid; gap: 6px; min-width: 0; }
.ti-name strong { font: 500 18px/1.25 var(--font-sans); letter-spacing: -0.01em; color: var(--ink); }
.ti-job { font: 400 15.5px/1.45 var(--font-sans); color: var(--ink-2); }
.ti-out { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.ti-fig { display: inline-block; font: 300 clamp(56px, 5vw, 72px)/1 var(--font-display); font-variation-settings: 'opsz' 72; letter-spacing: -0.035em; color: var(--ink); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; transform-origin: 0 100%; }
/* W9 number wall: per-digit roll (js/v2/wow-tools-hub.js) and a 2deg tilt on desktop hover */
.ti-roll { display: inline-flex; white-space: pre; }
.ti-roll__d { display: inline-block; height: 1em; overflow: hidden; }
.ti-roll__s { display: block; white-space: pre; line-height: 1; }
.ti-roll__c { display: inline-block; white-space: pre; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .ti-fig { transition: transform .6s cubic-bezier(.215, .61, .355, 1); }
  a.ti-row:hover .ti-fig, a.ti-row:focus-visible .ti-fig { transform: rotate(-2deg); }
}
.ti-cap { font: 400 13px/1.45 var(--font-sans); color: var(--ink-2); }
.ti-arrow { width: 22px; height: 22px; justify-self: end; color: var(--ink-2); transition: transform .35s var(--ease), color .2s; }
a.ti-row:hover .ti-arrow, a.ti-row:focus-visible .ti-arrow { transform: translateX(5px); color: var(--ink); }
.ti-row--soon { cursor: default; }
.ti-row--soon .ti-name strong { color: var(--ink-2); }
.ti-soon { display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--hair-strong); font: 500 13px/1 var(--font-sans); color: var(--ink-2); }
.th-panel .ks-disclaimer { margin-top: 40px; }

@media (max-width: 760px) {
  .ti-row { grid-template-columns: minmax(0, 1fr) 24px; grid-template-areas: 'name arrow' 'out out'; gap: 14px 16px; padding: 22px 16px; margin: 0 -16px; min-height: 64px; }
  .ti-name { grid-area: name; }
  .ti-out { grid-area: out; }
  .ti-arrow { grid-area: arrow; align-self: start; margin-top: 2px; }
  .ti-row--soon { grid-template-areas: 'name' 'out'; grid-template-columns: 1fr; }
  .ti-fig { font-size: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .ti-row, .ti-arrow { transition: none; }
}
