/* Free tools: the hub, each tool's page, and the animated demos. Sits on site.css's tokens. */

/* ---------- page furniture ---------- */
.t-hero { padding-block: 40px 26px; }
.t-hero h1 { font-weight: 800; font-size: clamp(40px, 6.4vw, 84px); line-height: .94; letter-spacing: -.05em; margin-top: 14px; }
.t-hero h1 em { font-style: normal; color: var(--accent); }
.t-hero p.lede { margin-top: 18px; font-size: 18.5px; color: var(--muted); max-width: 38em; }
.t-crumb { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--faint); text-decoration: none; }
.t-crumb:hover { color: var(--fg); }
.t-sec { padding-block: 34px; }
.t-sec h2 { font-weight: 800; font-size: clamp(26px, 3.4vw, 40px); letter-spacing: -.04em; line-height: 1; }
.t-sec .sub { margin-top: 10px; color: var(--muted); max-width: 44em; }
.t-prose { display: grid; gap: 14px; max-width: 46em; margin-top: 18px; color: var(--muted); }
.t-prose b { color: var(--fg); }
.t-list { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; max-width: 46em; }
.t-list li { position: relative; padding-left: 26px; color: var(--muted); }
.t-list li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.t-list b { color: var(--fg); }
.t-table { width: 100%; max-width: 46em; border-collapse: collapse; margin-top: 18px; font-size: 15px; }
.t-table th, .t-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t-table th { color: var(--faint); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.t-table td:first-child { font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }

/* ---------- the tool itself: inputs on the left, the answer on the right ---------- */
.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tool > .panel { padding: 22px; }
@media (max-width: 860px) { .tool { grid-template-columns: minmax(0, 1fr); } }
.tool .stack { display: grid; gap: 16px; }
.fld { display: grid; gap: 7px; min-width: 0; }
.fld > label, .fld > .lbl, .lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.inp, .sel, textarea.inp {
  width: 100%; min-width: 0; font: inherit; font-size: 15.5px; color: var(--fg); background: var(--field);
  border: 0; border-radius: 14px; padding: 0 14px; height: 46px;
  box-shadow: inset 0 1px 2px rgba(40,32,20,.08), 0 0 0 1px var(--line); outline: none;
  transition: box-shadow .2s var(--ease);
}
textarea.inp { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.inp:focus, .sel:focus { box-shadow: inset 0 1px 2px rgba(40,32,20,.08), 0 0 0 2px var(--sel); }
.inp::placeholder { color: var(--faint); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .row2 { grid-template-columns: 1fr; } }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { height: 36px; padding: 0 14px; border-radius: 999px; font-weight: 650; font-size: 14px; background: var(--field); box-shadow: var(--bevel), 0 0 0 1px var(--line); transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease); }
.opt:hover { transform: translateY(-1px); }
.opt[aria-pressed="true"], .opt.on { background: var(--fg); color: var(--surface); box-shadow: var(--btn-bevel); }
.hint { font-size: 13.5px; color: var(--faint); }
.hint.err { color: var(--accent); }
.tbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; font-weight: 650; font-size: 15px; background: var(--fg); color: var(--surface); box-shadow: var(--btn-bevel); transition: transform .2s var(--ease), opacity .2s; text-decoration: none; }
.tbtn:hover { transform: translateY(-1px); }
.tbtn.accent { background: var(--accent); color: var(--accent-ink); }
.tbtn.ghost { background: var(--field); color: var(--fg); box-shadow: var(--bevel), 0 0 0 1px var(--line); }
.tbtn[disabled] { opacity: .45; pointer-events: none; }
.tbtn.is-done { background: var(--ok); color: #fff; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* The answer: one big card, then smaller facts under it. */
.answer { border-radius: 22px; padding: 18px 20px; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); box-shadow: var(--bevel), 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.answer .lbl { color: color-mix(in srgb, var(--accent) 60%, var(--fg)); }
.answer .big { font-size: clamp(34px, 5vw, 52px); font-weight: 800; letter-spacing: -.04em; line-height: 1.02; font-variant-numeric: tabular-nums; margin-top: 4px; }
.answer .small { margin-top: 6px; color: var(--muted); font-size: 14.5px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fact { border-radius: 18px; padding: 12px 14px; background: var(--field); box-shadow: var(--bevel), 0 0 0 1px var(--line); min-width: 0; }
.fact .v { font-size: 22px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fact .n { font-size: 13px; color: var(--muted); margin-top: 2px; }
.chk { display: grid; gap: 8px; }
.chk > div { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.chk .d { flex: none; width: 18px; height: 18px; border-radius: 50%; margin-top: 2px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; }
.chk .ok .d { background: var(--ok); } .chk .warn .d { background: #D9A128; } .chk .bad .d { background: var(--accent); }
.mono { font-family: var(--mono); font-size: 13.5px; }
.out { font-family: var(--mono); font-size: 13.5px; background: var(--field); border-radius: 14px; padding: 12px 14px; box-shadow: inset 0 1px 2px rgba(40,32,20,.08), 0 0 0 1px var(--line); overflow-wrap: anywhere; word-break: break-all; }
.drop { border-radius: 22px; padding: 34px 20px; text-align: center; color: var(--muted); background: var(--field); box-shadow: inset 0 0 0 2px var(--line); transition: box-shadow .2s var(--ease), background .2s; cursor: pointer; }
.drop.over { box-shadow: inset 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--field)); }
.drop b { display: block; color: var(--fg); font-size: 17px; margin-bottom: 4px; }

/* ---------- the hub ---------- */
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 16px; }
.t-card { display: grid; grid-template-rows: auto 1fr; border-radius: 28px; padding: 14px; text-decoration: none; overflow: hidden; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.t-card:hover { transform: translateY(-3px); }
.t-card .demo { border-radius: 20px; overflow: hidden; background: var(--bg); background-image: radial-gradient(var(--dot) 1px, transparent 1.2px); background-size: 22px 22px; box-shadow: 0 0 0 1px var(--line); }
.t-card .txt { padding: 18px 8px 8px; display: grid; gap: 8px; align-content: start; }
.t-card h3 { font-weight: 800; font-size: 24px; letter-spacing: -.035em; line-height: 1.05; }
.t-card p { color: var(--muted); font-size: 15.5px; }
.t-card .go { font-weight: 700; font-size: 14.5px; color: var(--accent); display: inline-flex; gap: 6px; align-items: center; margin-top: 4px; }
.t-card .go::after { content: "→"; transition: transform .3s var(--spring); }
.t-card:hover .go::after { transform: translateX(4px); }
.t-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; margin-top: 22px; }
.t-more .t-card { grid-template-rows: auto; }

.cta-band { border-radius: 32px; padding: clamp(28px, 5vw, 56px); background: var(--accent); color: var(--accent-ink); display: grid; gap: 12px; justify-items: start; }
.cta-band h2 { font-weight: 800; font-size: clamp(30px, 4.6vw, 56px); letter-spacing: -.045em; line-height: .98; }
.cta-band p { max-width: 36em; opacity: .9; }
.cta-band .btn { background: var(--surface); color: var(--fg); margin-top: 6px; }

/* ---------- animated demos: a 420 x 315 board, scaled to fit ---------- */
.dd { position: relative; width: 100%; }
.dd-viewport { position: relative; width: 100%; aspect-ratio: 420 / 315; overflow: hidden; }
.dd-board { position: absolute; left: 0; top: 0; width: 420px; height: 315px; transform-origin: 0 0; font-size: 13px; line-height: 1.35; color: var(--fg); }
.dd-scene { position: absolute; inset: 0; transition: opacity .4s ease; }
.dd-scene.is-out { opacity: 0; }
.dd[data-paused="true"] .rise, .dd[data-paused="true"] .grow-x { animation-play-state: paused; }
.dd-cursor { position: absolute; left: -7px; top: -7px; z-index: 90; pointer-events: none; opacity: 0; transition: transform .7s cubic-bezier(.45, 0, .25, 1), opacity .3s; filter: drop-shadow(0 3px 5px rgba(0,0,0,.28)); }
.dd-cursor.is-on { opacity: 1; }
.dd-cursor.is-down svg { transform: scale(.86); }
.dd-cursor svg { display: block; transition: transform .12s; }
.dd-ripple { position: absolute; z-index: 89; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 30%, transparent); box-shadow: 0 0 0 1.5px var(--accent); animation: ddRipple .65s ease-out both; pointer-events: none; }
@keyframes ddRipple { from { transform: scale(.4); opacity: 1; } to { transform: scale(3.2); opacity: 0; } }
.rise { animation: ddRise .5s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes ddRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ddGrowX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ddToast { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes ddCaret { 50% { opacity: 0; } }
.is-typing::after { content: ""; display: inline-block; width: 1.5px; height: 1em; margin-left: 1px; vertical-align: -2px; background: var(--fg); animation: ddCaret 1s steps(1) infinite; }

/* what a demo draws with, as the tool itself draws it, a size smaller */
.d-pad { position: absolute; inset: 0; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.d-lbl { font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); margin-bottom: 5px; }
.d-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.d-pill { height: 28px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--field); box-shadow: var(--bevel), 0 0 0 1px var(--line); transition: background .25s, color .25s; }
.d-pill.on { background: var(--fg); color: var(--surface); box-shadow: none; }
.d-box { height: 38px; border-radius: 11px; background: var(--field); display: flex; align-items: center; gap: 6px; padding: 0 12px; font-size: 13px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: inset 0 1px 2px rgba(40,32,20,.08), 0 0 0 1px var(--line); transition: box-shadow .25s; }
.d-box.on { box-shadow: inset 0 1px 2px rgba(40,32,20,.08), 0 0 0 1.5px var(--fg); }
.d-box .ph { color: var(--faint); }
.d-btn { height: 36px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 12.5px; font-weight: 700; white-space: nowrap; flex-shrink: 0; background: var(--fg); color: var(--surface); box-shadow: var(--btn-bevel); }
.d-btn.accent { background: var(--accent); color: #fff; }
.d-btn.ghost { background: var(--field); color: var(--fg); box-shadow: var(--bevel), 0 0 0 1px var(--line); }
.d-card { background: var(--surface); border-radius: 14px; padding: 10px 12px; min-width: 0; box-shadow: var(--bevel), 0 0 0 1px var(--line); }
.d-hero { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border-radius: 16px; padding: 11px 14px; min-width: 0; box-shadow: var(--bevel), 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.d-hero .big { font-size: 32px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.d-hero .sub { font-size: 11.5px; line-height: 1.35; margin-top: 5px; color: var(--muted); }
.d-num { font-size: 19px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.d-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.d-grow { flex: 1; min-width: 0; }
.d-meter { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.d-meter i { display: block; height: 100%; border-radius: 999px; background: var(--fg); transform-origin: 0 50%; animation: ddGrowX .9s var(--ease) both; animation-delay: var(--d, 0ms); }
.d-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 9px; font-weight: 800; color: #fff; background: var(--ok); }
.d-dot.warn { background: #D9A128; } .d-dot.bad { background: var(--accent); }
.d-done { position: absolute; left: 50%; bottom: 14px; z-index: 50; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; background: var(--fg); color: var(--surface); font-size: 12px; font-weight: 700; white-space: nowrap; box-shadow: 0 16px 34px -12px rgba(16,16,15,.5); animation: ddToast .5s var(--ease) both; transform: translateX(-50%); }
.d-done i { width: 17px; height: 17px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-style: normal; font-size: 10px; }
@media (prefers-reduced-motion: reduce) { .rise, .d-meter i, .d-done { animation: none; } }

/* Shared small fixes */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 480px) { .t-table td:first-child { white-space: normal; } }
