/* ==========================================================================
   Solutions: solutions.html, the industry pages in solutions/ and the
   homepage's industry section. Built on the tokens and components in site.css.
   The pages are generated by solutions-src/build.py.
   ========================================================================== */

/* ---------- Industry cards (homepage and solutions overview) ---------- */
.ind-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ind-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 26px 26px 22px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--bg-elev); overflow: hidden;
  transition: border-color 0.2s, transform 0.25s var(--ease), box-shadow 0.25s;
}
.ind-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--grad); opacity: 0; transition: opacity 0.25s; }
.ind-card:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.ind-card:hover::before { opacity: 1; }
.ind-card .ind-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.ind-card .ind-icon svg { width: 20px; height: 20px; }
.ind-card h3 { font-size: 1.25rem; letter-spacing: -0.02em; }
.ind-card p { color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.ind-card ul { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ind-card li { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); padding: 3px 8px; border-radius: 6px; background: var(--bg-sunken); border: 1px solid var(--line); }
.ind-card .ind-proof { margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line-strong); font-family: var(--font-mono); font-size: 12px; line-height: 1.55; color: var(--ink-3); }
.ind-card .ind-proof b { font-weight: 500; color: var(--ink); }
.ind-card .ind-go { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--accent); }
.ind-card .ind-go svg { width: 15px; height: 15px; transition: transform 0.25s var(--ease); }
.ind-card:hover .ind-go svg { transform: translateX(3px); }
.ind-foot { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between; color: var(--ink-3); font-size: 14px; }
@media (max-width: 980px) { .ind-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .ind-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Hero demo: scenario switcher above the case tabs ---------- */
.demo-scenes { display: flex; gap: 4px; padding: 10px 12px 0; overflow-x: auto; scrollbar-width: none; }
.demo-scenes::-webkit-scrollbar { display: none; }
.demo-scene {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 500; color: var(--ink-3); white-space: nowrap; transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.demo-scene svg { width: 15px; height: 15px; }
.demo-scene:hover { color: var(--ink); }
.demo-scene.is-active { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.demo-pred .word[data-tone="good"] { background: var(--toward); -webkit-background-clip: text; background-clip: text; color: transparent; }
.demo-pred .word[data-tone="bad"] { background: var(--away); -webkit-background-clip: text; background-clip: text; color: transparent; }
.demo-pred .word[data-tone="num"] { color: var(--ink); }
.demo-pred .word small { font-size: 0.42em; font-weight: 500; letter-spacing: 0; color: var(--ink-3); margin-left: 6px; -webkit-text-fill-color: currentColor; }
.demo-cf { margin-top: 16px; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line-strong); font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.demo-cf b { font-weight: 600; color: var(--ink); }
.demo-cf[hidden] { display: none; }
.demo-foot .demo-src { color: var(--ink-3); }

/* ---------- Page furniture ---------- */
.sol-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: clamp(36px, 5vw, 56px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); overflow: hidden; }
.sol-facts > div { padding: 22px 24px; border-left: 1px solid var(--line); }
.sol-facts > div:first-child { border-left: 0; }
.sol-facts dt { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.sol-facts dd { margin-top: 8px; font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.sol-facts dd small { display: block; margin-top: 8px; font-size: 13px; font-weight: 400; letter-spacing: 0; line-height: 1.45; color: var(--ink-3); }
@media (max-width: 860px) { .sol-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sol-facts > div:nth-child(3) { border-left: 0; } .sol-facts > div:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 480px) { .sol-facts { grid-template-columns: minmax(0, 1fr); } .sol-facts > div { border-left: 0; } .sol-facts > div + div { border-top: 1px solid var(--line); } }

.sol-uses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.sol-use { padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-elev); }
.sol-use .k { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.sol-use h3 { margin: 10px 0 8px; font-size: 1.15rem; letter-spacing: -0.015em; }
.sol-use p { color: var(--ink-2); font-size: 15px; line-height: 1.55; }
@media (max-width: 980px) { .sol-uses { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .sol-uses { grid-template-columns: minmax(0, 1fr); } }

/* the worked example: a source line, then blocks of evidence */
.sol-source { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-bottom: 28px; font-size: 14px; color: var(--ink-3); }
.sol-source a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.sol-source a:hover { color: var(--ink); }
.sol-block { margin-top: clamp(40px, 6vw, 72px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.sol-block.flip > :first-child { order: 2; }
.sol-block h3 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); letter-spacing: -0.02em; line-height: 1.2; }
.sol-block .k { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.sol-block p { margin-top: 14px; color: var(--ink-2); font-size: 1.02rem; line-height: 1.6; }
.sol-block p b, .sol-block li b { color: var(--ink); font-weight: 600; }
.sol-block ul.check { margin-top: 18px; display: grid; gap: 10px; }
.sol-block .btn-link { margin-top: 18px; }
@media (max-width: 900px) { .sol-block { grid-template-columns: minmax(0, 1fr); } .sol-block.flip > :first-child { order: 0; } }

.sol-panel { border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-elev); box-shadow: var(--shadow-sm); overflow: hidden; }
.sol-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.sol-panel-head b { font-weight: 500; color: var(--ink); }
.sol-panel-body { padding: 18px; }
.sol-panel-foot { padding: 12px 18px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--ink-3); background: var(--bg-sunken); }
.sol-panel-foot code, .sol-quote code, .sol-rules code { font-size: 0.92em; }

/* horizontal bars: importance shares and PSI per input */
.bars { display: grid; gap: 9px; font-family: var(--font-mono); font-size: 12.5px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 190px) minmax(0, 1fr) 58px; gap: 12px; align-items: center; }
.bar-row > span:first-child { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row > span:last-child { text-align: right; color: var(--ink-2); }
.bar-track { position: relative; height: 10px; border-radius: 3px; background: var(--bg-sunken); }
.bar-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--toward); min-width: 2px; }
.bar-row.hot .bar-track i { background: var(--away); }
.bar-row.hot > span:first-child, .bar-row.hot > span:last-child { color: var(--ink); font-weight: 500; }
.bar-track .mark { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--line-strong); }
.bars-legend { display: flex; gap: 16px; margin-top: 12px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
@media (max-width: 520px) { .bar-row { grid-template-columns: minmax(84px, 120px) minmax(0, 1fr) 50px; gap: 8px; font-size: 11.5px; } }

/* two drift checks side by side */
.sol-drift { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sol-drift .sol-panel-head .state { padding: 2px 8px; border-radius: 6px; font-weight: 500; }
.state.stable { color: #1f9d6a; background: rgba(31, 157, 106, 0.12); }
.state.moderate { color: #c77d12; background: rgba(199, 125, 18, 0.13); }
.state.significant { color: #d6398b; background: rgba(224, 71, 154, 0.13); }
@media (max-width: 760px) { .sol-drift { grid-template-columns: minmax(0, 1fr); } }

/* what the API wrote, quoted */
.sol-rules { display: grid; gap: 10px; }
.sol-rules li { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-sunken); font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.sol-quote { margin-top: 16px; padding: 14px 16px; border-left: 2px solid transparent; border-image: linear-gradient(180deg, #3ec8ff, #6b8cff, #c86bff, #ff6bb5) 1; background: var(--bg-sunken); font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.sol-quote small { display: block; margin-top: 8px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }

/* column charts: hit rate by year, lift by decile, error by week */
/* every column keeps 17px under its bar for a label, so bars share a baseline; a bar's height is a share of the 125px above it */
.cols { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 8px; box-sizing: border-box; }
.cols .col { position: relative; flex: 1; min-width: 0; height: 100%; padding-bottom: 17px; box-sizing: border-box; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.cols .col i { display: block; width: 100%; border-radius: 3px 3px 0 0; background: var(--toward); min-height: 2px; }
.cols .col.alt i { background: var(--away); }
.cols .col.dim i { opacity: 0.38; }
.cols .col span { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); height: 12px; line-height: 12px; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.cols .col b { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; color: var(--ink-2); }
.cols-wrap { position: relative; }
.cols-line { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line-strong); }
.cols-line span { position: absolute; right: 0; top: -17px; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); background: var(--bg-elev); padding-left: 6px; }
.cols-caption { margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }

/* two models, one case */
.duo { display: grid; gap: 7px; font-family: var(--font-mono); font-size: 12px; }
.duo-row { display: grid; grid-template-columns: minmax(100px, 170px) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; }
.duo-row > span:first-child { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duo-cell { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 6px; align-items: center; }
.duo-cell .attr-track { height: 12px; }
.duo-cell .attr-bar { top: 1px; height: 10px; }
.duo-cell > span { text-align: right; color: var(--ink-2); font-size: 11.5px; }
.duo-head { color: var(--ink-3); font-size: 11.5px; padding-bottom: 4px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.duo-head b { font-weight: 500; color: var(--ink); }
.duo-row.hot > span:first-child { color: var(--ink); font-weight: 500; }
.duo-row.hot { background: var(--accent-soft); border-radius: 6px; margin-inline: -6px; padding: 3px 6px; }
@media (max-width: 520px) { .duo-row { grid-template-columns: minmax(74px, 104px) minmax(0, 1fr) minmax(0, 1fr); gap: 6px; font-size: 11px; } .duo-cell { grid-template-columns: minmax(0, 1fr) 38px; } }

/* a small table of facts: reasons, standards */
.sol-table td:first-child { min-width: 180px; }
.sol-table td small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-3); }
.sol-table .flag { color: #d6398b; font-weight: 500; }
.sol-legal { margin-top: 16px; font-size: 13px; line-height: 1.55; color: var(--ink-3); max-width: 860px; }
.sol-legal a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }

/* roles */
.sol-roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; border-top: 1px solid var(--line); }
.sol-role { padding: 32px 0 8px; }
.sol-role .num { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); margin-bottom: 16px; }
.sol-role h3 { font-size: 1.25rem; margin-bottom: 10px; }
.sol-role p { color: var(--ink-2); font-size: 15.5px; line-height: 1.6; }
@media (max-width: 860px) { .sol-roles { grid-template-columns: minmax(0, 1fr); } }

/* deployment options */
.sol-deploy { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.sol-deploy > div { padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-elev); }
.sol-deploy code { display: inline-block; margin-top: 12px; font-size: 12.5px; }
.sol-deploy h3 { font-size: 1.1rem; margin-bottom: 8px; }
.sol-deploy p { color: var(--ink-2); font-size: 15px; line-height: 1.55; }
@media (max-width: 860px) { .sol-deploy { grid-template-columns: minmax(0, 1fr); } }

/* limits: said plainly */
.sol-limits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 40px; margin-top: 8px; }
.sol-limits li { position: relative; padding-left: 22px; color: var(--ink-2); font-size: 15.5px; line-height: 1.55; }
.sol-limits li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 10px; height: 2px; border-radius: 2px; background: var(--ink-4); }
@media (max-width: 760px) { .sol-limits { grid-template-columns: minmax(0, 1fr); } }

/* coming soon: features on the roadmap, each with what works until then */
.sol-soon { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 8px; }
.sol-soon li { padding: 20px 22px; border-radius: 14px; border: 1px dashed var(--line-strong); background: var(--bg-elev); }
.sol-soon .tag { margin-bottom: 12px; }
.sol-soon b { display: block; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); margin-bottom: 4px; }
.sol-soon p { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.sol-soon + .sol-legal b { color: var(--ink-2); font-weight: 600; }
@media (max-width: 760px) { .sol-soon { grid-template-columns: minmax(0, 1fr); } }

/* overview: what each role gets, and the examples table */
.sol-matrix td:first-child b { display: block; font-weight: 600; color: var(--ink); }
.sol-matrix td a { color: var(--accent); font-weight: 500; white-space: nowrap; }
.sol-method { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; counter-reset: step; }
.sol-method li { counter-increment: step; padding-top: 18px; border-top: 1px solid var(--line-strong); color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.sol-method li::before { content: "0" counter(step); display: block; margin-bottom: 10px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.sol-method li b { display: block; margin-bottom: 6px; font-size: 1.05rem; color: var(--ink); }
@media (max-width: 860px) { .sol-method { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .sol-method { grid-template-columns: minmax(0, 1fr); } }

/* homepage: two models, one client (replaces a screenshot in the narrative) */
.figure .sol-panel { box-shadow: var(--shadow-md); }
/* homepage bento minis */
.mini-drift { margin: 24px 28px 28px; padding: 16px 18px; border-radius: 14px; background: var(--bg-sunken); border: 1px solid var(--line); }
.mini-drift .bars { font-size: 11.5px; gap: 7px; }
.mini-drift .bar-row { grid-template-columns: minmax(92px, 130px) minmax(0, 1fr) 40px; gap: 8px; }
.mini-drift .bar-track { background: var(--bg-elev); height: 8px; }
.mini-drift .cap { margin-top: 12px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; color: var(--ink-3); }
.tile-media.pad .sol-panel { box-shadow: none; }
.tile-chart { margin: 24px 28px 28px; }

/* ---------- Fit: longer input names in the explanation panel ---------- */
.demo .attr-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) 78px; }
.demo .attr-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .demo .attr-row { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 64px; }
  .demo .attr-name span { display: none; }
}

/* ---------- Fit: compact tables and minis inside homepage tiles ---------- */
.mini-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 12px; }
.mini-table th, .mini-table td { text-align: right; padding: 9px 0 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--ink-2); }
.mini-table th { font-size: 10.5px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.mini-table th:first-child, .mini-table td:first-child { text-align: left; padding-left: 0; color: var(--ink); }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-cf .row.stack { flex-direction: column; align-items: flex-start; gap: 4px; }
.mini-versions.stack { grid-template-columns: minmax(0, 1fr); }
.mini-versions.stack .v .line { font-size: 12px; }

/* ---------- Fit: tables and captions inside an example block ---------- */
.sol-reasons td:nth-child(2), .sol-reasons td:nth-child(3) { white-space: nowrap; }
.sol-reasons td small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-3); }
.sol-reasons .flag { color: #d6398b; font-weight: 500; }
.sol-block p.cols-caption, .sol-drift + .cols-caption { margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }

/* ---------- Fit: second pass ---------- */
.sol-block .sol-rules { margin-top: 18px; }
.tile .mini-versions .v .line { font-size: 11px; white-space: nowrap; }
.tile .mini-versions { margin-bottom: 12px; }
.mini-cap { margin: 0 28px 28px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; color: var(--ink-3); }

.card .mini-cap { margin: 0 28px 28px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; color: var(--ink-3); }
