/* Free tools hub and tool pages.
   Same design system as /resources/: darker surfaces, one bordered list with
   hairline rows rather than a grid of floating cards, 48px 3D icon tiles, Sora
   for numerals, --fg-body for reading copy. Generated pages come from
   scripts/tools/build.py; this file is hand-maintained. */

:root {
  --accent: #2EC4FF; --accent-soft: rgba(46,196,255,.12);
  --bg: #08090C; --bg-2: #0C0E12;
  --surface: #111318; --surface-2: #161A20; --surface-3: #1C2128;
  --sep: rgba(255,255,255,.06); --sep-2: rgba(255,255,255,.10); --sep-3: rgba(255,255,255,.16);
  --fg: #F2F4F7; --fg-body: #C3CAD4; --fg-muted: #8B95A5; --fg-faint: #5C6675;
  --ok: #34D399; --warn: #F59E0B;
  --font: 'acumin-pro', Helvetica, 'Helvetica Neue', Arial, sans-serif;
  --num: 'Sora', 'acumin-pro', Helvetica, Arial, sans-serif;
  --r-lg: 20px; --r-md: 12px; --r-sm: 8px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--fg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }

.hero { max-width: 940px; margin: 0 auto; padding: 72px 24px 0; }
.wrap { max-width: 940px; margin: 0 auto; padding: 48px 24px 72px; }
h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -.03em; line-height: 1.05; margin-bottom: 16px; text-wrap: balance; }
h1 .dim { color: var(--fg-muted); }
.lead { font-size: 18px; color: var(--fg-body); line-height: 1.6; max-width: 600px; text-wrap: pretty; }

/* ── Buttons, matching the service-page shell ────────────── */
.btn-p, .btn-g { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 26px; border-radius: 12px; font: inherit; font-size: 15px; font-weight: 700;
  color: var(--fg); text-decoration: none; white-space: nowrap;
  transition: transform 160ms var(--ease), box-shadow 200ms var(--ease), border-color 160ms var(--ease), background-color 160ms var(--ease); }
.btn-p { border: 2px solid transparent;
  background: linear-gradient(var(--bg), var(--bg)) padding-box, linear-gradient(90deg,hsl(197 100% 59%),hsl(200 60% 85%),hsl(210 100% 63%),hsl(200 100% 63%),hsl(210 80% 75%),hsl(197 100% 59%),hsl(200 60% 85%),hsl(210 100% 63%),hsl(200 100% 63%),hsl(210 80% 75%),hsl(197 100% 59%)) border-box;
  background-size: 100%, 400% 100%; animation: btn-rainbow 6s infinite linear; }
.cta-box .btn-p { background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(90deg,hsl(197 100% 59%),hsl(200 60% 85%),hsl(210 100% 63%),hsl(200 100% 63%),hsl(210 80% 75%),hsl(197 100% 59%),hsl(200 60% 85%),hsl(210 100% 63%),hsl(200 100% 63%),hsl(210 80% 75%),hsl(197 100% 59%)) border-box;
  background-size: 100%, 400% 100%; }
.btn-p:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(46,196,255,.26); }
.btn-g { border: 1px solid var(--sep-3); background: transparent; }
.btn-g:hover { border-color: var(--fg-faint); background: rgba(255,255,255,.04); }
.btn-p:active, .btn-g:active { transform: scale(.97); }
.btn-p svg, .btn-g svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; transition: transform 200ms var(--ease); }
.btn-p:hover svg { transform: translateX(3px); }

/* ── Hub hero: centered two-tone headline over a framed stage ── */
.hero.hub { max-width: 860px; text-align: center; padding-top: 88px; }
.hero.hub h1 { font-size: clamp(40px, 6vw, 66px); font-weight: 700; letter-spacing: -.04em; line-height: 1.02; margin-bottom: 20px; }
.hero.hub .lead { margin: 0 auto 30px; color: var(--fg-muted); }
.hero-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.stage-wrap { max-width: 1120px; margin: 56px auto 0; padding: 0 24px; }
.stage { position: relative; background: var(--bg-2); border: 1px solid var(--sep); border-radius: 24px;
  padding: 32px; overflow: hidden; }
.stage::before { content: ""; position: absolute; inset: 0; pointer-events: none; filter: blur(34px); background:
  radial-gradient(38% 46% at 20% 80%, rgba(46,196,255,.30), transparent 68%),
  radial-gradient(34% 42% at 54% 94%, rgba(74,142,255,.24), transparent 70%),
  radial-gradient(34% 44% at 84% 76%, rgba(128,96,255,.22), transparent 70%); }
.shelves { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.shelf { display: flex; flex-direction: column; min-width: 0; padding: 22px 20px 20px; text-decoration: none; color: inherit;
  background: linear-gradient(165deg, rgba(14,18,26,.82), rgba(14,18,26,.68));
  border: 1px solid rgba(255,255,255,.14); border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 24px 48px -22px rgba(0,0,0,.8);
  transition: transform 240ms var(--ease), border-color 200ms var(--ease); }
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .shelf { background: linear-gradient(165deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
    -webkit-backdrop-filter: blur(24px) saturate(175%); backdrop-filter: blur(24px) saturate(175%); }
}
.shelf:hover { transform: translateY(-4px); border-color: rgba(46,196,255,.45); }
.icos { display: flex; height: 76px; align-items: center; margin-bottom: 18px; }
.ico { width: 68px; height: 68px; border-radius: 18px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--surface-3); border: 1px solid rgba(255,255,255,.10); box-shadow: 0 10px 24px -10px rgba(0,0,0,.7);
  transition: transform 240ms var(--ease); }
.ico + .ico { margin-left: -18px; }
.ico:nth-child(2) { transform: translateY(-6px) rotate(4deg); }
.ico:nth-child(3) { transform: rotate(-3deg); }
.ico img { width: 48px; height: 48px; object-fit: contain; }
.shelf:hover .ico:nth-child(1) { transform: translateY(-3px) rotate(-4deg); }
.shelf:hover .ico:nth-child(2) { transform: translateY(-9px) rotate(6deg); }
.shelf:hover .ico:nth-child(3) { transform: translateY(-3px) rotate(-6deg); }
.shelf-name { font-size: 17px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 4px; }
.shelf-n { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; color: var(--fg-muted);
  transition: color 160ms var(--ease); }
.shelf-n svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round;
  stroke-linejoin: round; transition: transform 200ms var(--ease); }
.shelf:hover .shelf-n { color: var(--accent); }
.shelf:hover .shelf-n svg { transform: translateX(3px); }
@media (prefers-reduced-motion: no-preference) {
  .hero.hub > * { animation: rise 640ms var(--ease) both; }
  .hero.hub > :nth-child(2) { animation-delay: 60ms; }
  .hero.hub > :nth-child(3) { animation-delay: 120ms; }
  .shelf { animation: rise 720ms var(--ease) both; }
  .shelf:nth-child(2) { animation-delay: 60ms; }
  .shelf:nth-child(3) { animation-delay: 120ms; }
  .shelf:nth-child(4) { animation-delay: 180ms; }
  .stage { animation: rise 720ms var(--ease) 200ms both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.crumb { font-size: 13.5px; color: var(--fg-faint); margin-bottom: 18px; }
.crumb a { color: var(--fg-muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.crumb .sep { padding: 0 7px; opacity: .5; }

/* ── Hub list, one bordered container with hairline rows ─── */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
#all-tools, .cat-block { scroll-margin-top: 80px; }
.chip { font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--fg-muted);
  background: var(--surface); border: 1px solid var(--sep-2); border-radius: 999px;
  min-height: 44px; padding: 0 16px; cursor: pointer;
  transition: color 160ms var(--ease), border-color 160ms var(--ease), background-color 160ms var(--ease); }
.chip:hover { color: var(--fg); border-color: var(--sep-3); }
.chip.is-on { color: var(--fg); padding: 0 15px; border: 2px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(90deg,hsl(197 100% 59%),hsl(200 60% 85%),hsl(210 100% 63%),hsl(200 100% 63%),hsl(210 80% 75%),hsl(197 100% 59%),hsl(200 60% 85%),hsl(210 100% 63%),hsl(200 100% 63%),hsl(210 80% 75%),hsl(197 100% 59%)) border-box;
  background-size: 100%, 400% 100%; animation: btn-rainbow 6s infinite linear; }
.chip.is-on .chip-n { opacity: .6; }
@keyframes btn-rainbow { to { background-position: 400% 0, 400% 0; } }
@media (prefers-reduced-motion: reduce) { .btn-p, .chip.is-on { animation: none; } }
.chip-n { opacity: .55; margin-left: 4px; }
.filter-empty { color: var(--fg-muted); font-size: 15px; }

.cat-block + .cat-block { margin-top: 64px; }
.cat-head { margin-bottom: 20px; }
.cat-head h2 { font-size: 24px; letter-spacing: -.02em; }
.cat-head p { font-size: 15.5px; color: var(--fg-muted); line-height: 1.6; max-width: 620px; margin-top: 8px; }
.tool-list { border: 1px solid var(--sep-2); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.tool-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; column-gap: 20px;
  padding: 20px 24px; text-decoration: none; color: inherit; border-top: 1px solid var(--sep);
  transition: background-color 160ms var(--ease); }
.tool-row:first-child { border-top: 0; }
.tool-row:hover { background: var(--surface-2); }
.row-tile { width: 56px; height: 56px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--sep);
  display: grid; place-items: center; flex-shrink: 0; }
.row-tile img { width: 40px; height: 40px; object-fit: contain; transition: transform 200ms var(--ease); }
.tool-row:hover .row-tile img { transform: scale(1.06); }
.row-body { min-width: 0; }
.row-body h3 { font-size: 17px; letter-spacing: -.01em; margin-bottom: 5px; }
.row-body p { font-size: 14.5px; color: var(--fg-muted); line-height: 1.55; }
.fmt { font-size: 13px; color: var(--fg-faint); white-space: nowrap; }
.row-arr { width: 18px; height: 18px; color: var(--fg-faint); flex-shrink: 0;
  transition: color 160ms var(--ease), transform 200ms var(--ease); }
.tool-row:hover .row-arr { color: var(--accent); transform: translateX(3px); }
.cat-block[hidden], .tool-row[hidden] { display: none; }

/* ── Tool page: the instrument ───────────────────────────── */
.tool-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.tool-head h1 { margin: 0; }
.head-tile { width: 64px; height: 64px; border-radius: 16px; background: var(--surface-3); border: 1px solid var(--sep);
  display: grid; place-items: center; flex-shrink: 0; }
.head-tile img { width: 44px; height: 44px; object-fit: contain; }
.tool { background: var(--surface); border: 1px solid var(--sep-2); border-radius: var(--r-lg);
  padding: clamp(22px, 3vw, 32px); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(195px, 1fr)); gap: 18px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.field .in { position: relative; display: flex; align-items: center; }
.field .affix { position: absolute; font-size: 14px; color: var(--fg-faint); pointer-events: none; }
.field .affix.pre { left: 14px; }
.field .affix.suf { right: 14px; }
.field input { width: 100%; min-height: 46px; padding: 0 16px; font: inherit; font-size: 15px; color: var(--fg);
  background: var(--bg-2); border: 1px solid var(--sep-2); border-radius: var(--r-md); outline: none;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease); }
.field .has-pre input { padding-left: 28px; }
.field .has-suf input { padding-right: 34px; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .help { font-size: 11.5px; color: var(--fg-faint); line-height: 1.5; margin-top: 6px; }

.results { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--sep-2);
  display: flex; align-items: flex-start; gap: clamp(20px, 3vw, 40px); flex-wrap: wrap; }
.result-main { min-width: 190px; }
.rlabel { font-size: 12px; font-weight: 700; color: var(--fg-muted); margin-bottom: 4px; }
.result-main .rvalue { font-family: var(--num); font-size: clamp(42px, 5.2vw, 64px); font-weight: 700;
  letter-spacing: -.04em; line-height: 1; color: var(--accent); }
.result-rest { flex: 1; min-width: 210px; display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 16px 22px; }
.result-rest .rvalue { font-family: var(--num); font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.tool-note { font-size: 11.5px; color: var(--fg-faint); margin-top: 20px; }
.tool-note a { color: var(--accent); text-decoration: none; }

/* ── Chart ───────────────────────────────────────────────── */
.chart { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--sep-2); }
.chart h3 { font-size: 14px; margin-bottom: 4px; }
.chart .chart-note { font-size: 12.5px; color: var(--fg-muted); line-height: 1.55; max-width: 620px; margin-bottom: 16px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { stroke: var(--sep-2); stroke-width: 1; }
.chart .grid-line { stroke: var(--sep); stroke-width: 1; }
.chart .tick { fill: var(--fg-faint); font-size: 10px; font-family: var(--font); }
.chart .bar { fill: var(--accent); opacity: .45; }
.chart .bar-neg { fill: var(--warn); opacity: .45; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line-2 { fill: none; stroke: var(--fg); stroke-width: 1.5; stroke-dasharray: 3 3; opacity: .6; }
.chart .zero { stroke: var(--sep-3); stroke-width: 1; }
.chart .marker { stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart .marker-2 { stroke: var(--ok); stroke-width: 1.5; }
.chart .marker-label { font-size: 10px; font-weight: 700; font-family: var(--font); }
.split { display: flex; height: 40px; border-radius: var(--r-sm); overflow: hidden; background: var(--bg-2); }
.split span { display: block; height: 100%; }
.split-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.split-legend div { font-size: 12.5px; color: var(--fg-muted); display: flex; align-items: center; gap: 7px; }
.split-legend i { width: 9px; height: 9px; border-radius: 2px; display: block; }
.split-legend b { font-family: var(--num); color: var(--fg); font-weight: 700; }

/* ── UTM builder ─────────────────────────────────────────── */
.utm-out { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--sep-2); }
.utm-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.75;
  color: var(--fg); background: var(--bg-2); border: 1px solid var(--sep-2); border-radius: var(--r-md);
  padding: 16px; word-break: break-all; }
.utm-url .k { color: var(--accent); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.btn-s { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--sep-2); background: var(--surface-2); color: var(--fg); font: inherit; font-size: 13px;
  font-weight: 700; cursor: pointer; transition: border-color 160ms var(--ease), color 160ms var(--ease); }
.btn-s:hover { border-color: var(--accent); color: var(--accent); }
.btn-s[disabled] { opacity: .45; cursor: default; }
.copied { font-size: 12.5px; color: var(--ok); }
.checks { margin-top: 18px; display: flex; flex-direction: column; gap: 9px; }
.checks div { font-size: 13px; line-height: 1.55; color: var(--fg-muted); padding-left: 24px; position: relative; }
.checks div::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.checks .ok::before { content: '✓'; color: var(--ok); }
.checks .warn::before { content: '!'; color: var(--warn); }
.checks b { color: var(--fg); font-weight: 700; }

/* ── Tap tempo ───────────────────────────────────────────── */
.tap { text-align: center; }
.tap-bpm { font-family: var(--num); font-size: clamp(64px, 11vw, 124px); font-weight: 700;
  letter-spacing: -.05em; line-height: 1; color: var(--accent); }
.tap-unit { font-size: 12px; font-weight: 700; color: var(--fg-muted); letter-spacing: .06em; margin-top: 4px; }
.tap-meta { font-size: 12.5px; color: var(--fg-faint); margin-top: 12px; min-height: 18px; }
.tap-pad { margin-top: 22px; width: 100%; padding: 32px 20px; border-radius: var(--r-lg);
  border: 1px solid var(--sep-2); background: var(--bg-2); color: var(--fg); font: inherit; font-size: 16px;
  font-weight: 800; letter-spacing: -.01em; cursor: pointer;
  transition: transform 90ms var(--ease), border-color 160ms var(--ease), background-color 160ms var(--ease); }
.tap-pad:hover { border-color: var(--accent); }
.tap-pad.hit { transform: scale(.985); border-color: var(--accent); background: var(--accent-soft); }
@media (prefers-reduced-motion: reduce) { .tap-pad { transition: none; } .tap-pad.hit { transform: none; } }
.ruler { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--sep-2); text-align: left; }
.ruler h3 { font-size: 14px; margin-bottom: 14px; }

/* ── Prose, FAQ, related, CTA ────────────────────────────── */
.sec { margin-top: 80px; }
.sec > h2 { font-size: 26px; margin-bottom: 20px; }
.prose p { font-size: 16.5px; color: var(--fg-body); line-height: 1.75; max-width: 680px; margin-bottom: 16px; text-wrap: pretty; }
.prose p:last-child { margin-bottom: 0; }
.example { margin-top: 24px; background: var(--surface); border: 1px solid var(--sep-2);
  border-radius: var(--r-md); padding: 22px 24px; }
.example h3 { font-size: 14px; margin-bottom: 8px; }
.example p { font-size: 15px; color: var(--fg-body); line-height: 1.7; }
.faq-item { border-top: 1px solid var(--sep); padding: 20px 0; }
.faq-item:last-child { border-bottom: 1px solid var(--sep); }
.faq-item h3 { font-size: 16px; margin-bottom: 7px; }
.faq-item p { font-size: 15px; color: var(--fg-body); line-height: 1.7; max-width: 680px; }
.rel-list { border: 1px solid var(--sep-2); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.cta-box { position: relative; overflow: hidden; margin-top: 80px; background: var(--surface); border: 1px solid var(--sep-2);
  border-radius: 24px; padding: 56px 32px; text-align: center; }
.cta-box::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(50% 60% at 50% 115%, rgba(46,196,255,.22), transparent 70%); filter: blur(30px); }
.cta-box > * { position: relative; }
.cta-box h2 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1;
  max-width: 600px; margin: 0 auto 12px; text-wrap: balance; }
.cta-box p { color: var(--fg-muted); font-size: 16px; line-height: 1.6; max-width: 540px; margin: 0 auto 28px; text-wrap: pretty; }
.updated { font-size: 12.5px; color: var(--fg-faint); margin-top: 30px; }

@media (max-width: 900px) {
  .stage { padding: 16px; border-radius: 18px; }
  .shelves { grid-template-columns: 1fr 1fr; gap: 12px; }
}
@media (max-width: 720px) {
  .hero { padding: 48px 20px 0; }
  .hero.hub { padding-top: 56px; }
  .hero-btns .btn-p, .hero-btns .btn-g { flex: 1 1 100%; }
  .stage-wrap { margin-top: 40px; padding: 0 16px; }
  .shelf { padding: 16px 14px; }
  .icos { height: 56px; margin-bottom: 12px; }
  .ico { width: 48px; height: 48px; border-radius: 13px; }
  .ico + .ico { margin-left: -14px; }
  .ico img { width: 34px; height: 34px; }
  .shelf-name { font-size: 15px; }
  .wrap { padding: 40px 20px 80px; }
  .cat-block + .cat-block { margin-top: 48px; }
  .tool-row { grid-template-columns: auto 1fr auto; column-gap: 14px; padding: 16px; }
  .fmt { display: none; }
  .row-tile { width: 48px; height: 48px; border-radius: 12px; }
  .row-tile img { width: 34px; height: 34px; }
  .tool-head { gap: 14px; }
  .head-tile { width: 52px; height: 52px; border-radius: 14px; }
  .head-tile img { width: 36px; height: 36px; }
  .sec { margin-top: 64px; }
  .cta-box { margin-top: 64px; padding: 40px 22px; }
  .result-rest { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
}

/* Tempo scale under the tap pad */
.tempo-scale { position: relative; height: 54px; border-radius: var(--r-sm); background: var(--bg-2);
  border: 1px solid var(--sep-2); }
.tempo-band { position: absolute; top: 0; bottom: 22px; background: var(--accent-soft);
  border-left: 1px solid var(--sep-2); border-right: 1px solid var(--sep-2); }
.tempo-band i { position: absolute; left: 6px; bottom: 5px; font-style: normal; font-size: 10.5px;
  font-weight: 700; color: var(--fg-muted); white-space: nowrap; }
.tempo-now { position: absolute; top: -6px; bottom: 0; width: 2px; background: var(--accent); }
.tempo-now b { position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-family: var(--num); font-size: 12px; color: var(--accent); }
.tempo-ends { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--fg-faint); margin-top: 6px; }
