/* Clearport Medical — segment pages (Oncology · Home IV antibiotics · Nutrition and other infusions)
   Loaded after site.css and motion.css. Pairs with assets/js/segments.js. */

/* ---------- chart colour tokens, per scene ---------- */
.scene.light { --c1:#1E9A82; --c2:#A87A1E; --cm:#C9D3CE; --grid:#E4EAE7; --tip-bg:#1F2A26; --tip-fg:#fff; --ink1:var(--ink); --ink2:var(--grey); }
.scene.dark  { --c1:#219D85; --c2:#B38A2C; --cm:rgba(255,255,255,.22); --grid:rgba(255,255,255,.10); --tip-bg:#F2F6F4; --tip-fg:#1F2A26; --ink1:#F2F6F4; --ink2:rgba(242,246,244,.68); }

/* ---------- stat tiles ---------- */
.seg-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; margin-top:34px; }
.seg-stat { padding:26px 26px 22px; border-radius:16px; border:1px solid var(--grid); background:rgba(255,255,255,.035); position:relative; overflow:hidden; }
.scene.light .seg-stat { background:#fff; }
.seg-stat::before { content:""; position:absolute; left:0; top:0; height:3px; width:100%; background:linear-gradient(90deg,var(--c1),transparent 70%); opacity:.9; }
.seg-stat .k { margin:0 0 12px; }
.seg-stat .big { font-size:clamp(34px,4.2vw,50px); line-height:1; letter-spacing:-.01em; color:var(--ink1); font-weight:500; }
.seg-stat .big small { font-size:.5em; font-weight:400; color:var(--ink2); margin-left:.1em; }
.seg-stat p { margin:12px 0 0; color:var(--ink2); font-size:15.5px; line-height:1.55; }
.seg-stat p b { color:var(--ink1); font-weight:500; }
@media (max-width:860px){ .seg-stats { grid-template-columns:1fr; } }

/* ---------- chart panel ---------- */
.seg-panel { margin-top:34px; border-radius:18px; border:1px solid var(--grid); padding:26px 28px 22px; background:rgba(255,255,255,.03); }
.scene.light .seg-panel { background:#fff; box-shadow:0 10px 40px rgba(14,74,51,.06); }
.seg-panel-head { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; margin-bottom:18px; }
.seg-panel-head h3 { margin:0 0 4px; font-size:19px; font-weight:500; color:var(--ink1); }
.seg-panel-head p { margin:0; color:var(--ink2); font-size:14.5px; line-height:1.5; max-width:60ch; }
.seg-panel .tview { flex:none; }
.seg-tview { flex:none; appearance:none; background:none; border:1px solid var(--grid); color:var(--ink2); border-radius:999px; padding:7px 14px; font:inherit; font-size:13px; cursor:pointer; transition:border-color .3s var(--ease), color .3s var(--ease); }
.seg-tview:hover, .seg-tview:focus-visible { border-color:var(--c1); color:var(--ink1); outline:none; }

.seg-legend { display:flex; flex-wrap:wrap; gap:8px 20px; margin:0 0 12px; font-size:13.5px; color:var(--ink2); }
.seg-legend span { display:inline-flex; align-items:center; gap:8px; }
.seg-legend i { width:12px; height:12px; border-radius:3px; background:var(--c1); display:inline-block; }
.seg-legend i.s2 { background:var(--c2); }
.seg-legend i.sm { background:var(--cm); }
.seg-legend i.hatch { background:repeating-linear-gradient(135deg,var(--c2) 0 2px,transparent 2px 5px); }

.seg-chart { position:relative; }
.seg-chart svg { display:block; width:100%; height:auto; overflow:visible; font-family:var(--font); }
.seg-chart .grid line { stroke:var(--grid); stroke-width:1; }
.seg-chart .axis text, .seg-chart .lbl, .seg-chart .val { fill:var(--ink2); font-size:12.5px; }
.seg-chart .lbl.main { fill:var(--ink1); font-size:14.5px; }
.seg-chart .val { fill:var(--ink1); font-size:13px; font-weight:500; }
.seg-chart .val.in-fill { fill:#fff; }
.seg-chart .bar { fill:var(--c1); }
.seg-chart .bar.s2 { fill:var(--c2); }
.seg-chart .bar.muted { fill:var(--cm); }
.seg-chart .whisk { stroke:var(--ink2); stroke-width:1.5; stroke-linecap:round; opacity:.7; }
.seg-chart .hit { fill:transparent; cursor:default; }
.seg-chart .bar, .seg-chart .whisk, .seg-chart .val, .seg-chart .seg-mark { transition:opacity .9s var(--out), transform 1.1s var(--out); }
/* grow-in: bars are drawn at full size and scaled from their anchor until the panel reveals */
.seg-chart:not(.in) .bar.h { transform:scaleX(0); }
.seg-chart:not(.in) .bar.v { transform:scaleY(0); }
.seg-chart:not(.in) .val, .seg-chart:not(.in) .whisk { opacity:0; }
.seg-chart .bar.h { transform-origin:left center; transform-box:fill-box; }
.seg-chart .bar.v { transform-origin:center bottom; transform-box:fill-box; }
.seg-chart .bar.h.rtl { transform-origin:right center; }

.seg-tip { position:absolute; pointer-events:none; z-index:5; background:var(--tip-bg); color:var(--tip-fg); border-radius:10px; padding:8px 12px; font-size:13px; line-height:1.4; max-width:260px; box-shadow:0 8px 28px rgba(0,0,0,.18); opacity:0; transform:translate(-50%,-8px); transition:opacity .18s ease; white-space:normal; }
.seg-tip.on { opacity:1; }
.seg-tip b { display:block; font-weight:500; }

.seg-table { display:none; width:100%; border-collapse:collapse; font-size:14px; color:var(--ink1); margin-top:4px; }
.seg-table th, .seg-table td { text-align:left; padding:9px 10px; border-bottom:1px solid var(--grid); vertical-align:top; }
.seg-table th { color:var(--ink2); font-weight:500; font-size:12.5px; letter-spacing:.06em; text-transform:uppercase; }
.seg-table td.n { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.seg-panel.table-on .seg-chart, .seg-panel.table-on .seg-legend { display:none; }
.seg-panel.table-on .seg-table { display:table; }
.seg-note { margin:14px 0 0; font-size:13px; color:var(--ink2); line-height:1.5; }
.seg-note a { color:inherit; }

/* ---------- "where the CP-100 fits" mapping ---------- */
.seg-fit { display:grid; grid-template-columns:1fr; gap:14px; margin-top:34px; }
.seg-fit-row { display:grid; grid-template-columns:minmax(0,1fr) 56px minmax(0,1fr); align-items:center; gap:10px; padding:22px 24px; border-radius:16px; border:1px solid var(--grid); background:rgba(255,255,255,.035); }
.scene.light .seg-fit-row { background:#fff; }
.seg-fit-row .k { margin:0 0 8px; }
.seg-fit-row h4 { margin:0 0 6px; font-size:18px; font-weight:500; color:var(--ink1); line-height:1.3; }
.seg-fit-row p { margin:0; color:var(--ink2); font-size:15px; line-height:1.55; }
.seg-fit-row .arrow { display:flex; align-items:center; justify-content:center; color:var(--c1); }
.seg-fit-row .arrow svg { width:30px; height:30px; }
.seg-fit-row .arrow svg path { stroke:currentColor; stroke-width:1.6; fill:none; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:60; stroke-dashoffset:60; transition:stroke-dashoffset 1.2s var(--out) .25s; }
.seg-fit-row.in .arrow svg path, .in .seg-fit-row .arrow svg path { stroke-dashoffset:0; }
@media (max-width:760px){ .seg-fit-row { grid-template-columns:1fr; } .seg-fit-row .arrow { transform:rotate(90deg); justify-content:flex-start; margin-left:4px; } }

.seg-scope { margin-top:28px; padding:18px 22px; border-radius:14px; border:1px dashed var(--grid); color:var(--ink2); font-size:14.5px; line-height:1.55; }
.seg-scope b { color:var(--ink1); font-weight:500; }

/* ---------- sources ---------- */
.seg-sources { margin:30px 0 0; padding:0; list-style:none; counter-reset:src; columns:2; column-gap:40px; }
.seg-sources li { counter-increment:src; break-inside:avoid; margin:0 0 14px; padding-left:34px; position:relative; font-size:14px; line-height:1.55; color:var(--ink2); }
.seg-sources li::before { content:counter(src); position:absolute; left:0; top:1px; width:24px; height:24px; border-radius:50%; border:1px solid var(--grid); color:var(--ink1); font-size:12px; display:flex; align-items:center; justify-content:center; }
.seg-sources li b { color:var(--ink1); font-weight:500; }
.seg-sources a { color:var(--teal-ink); text-decoration:none; border-bottom:1px solid rgba(23,128,107,.35); }
.scene.dark .seg-sources a { color:var(--mint); border-bottom-color:rgba(124,196,180,.4); }
@media (max-width:860px){ .seg-sources { columns:1; } }

/* ---------- segment cards on Home / Who it's for become links ---------- */
a.card { text-decoration:none; color:inherit; display:block; }
a.card .more { display:inline-flex; align-items:center; gap:8px; margin-top:14px; font-size:14px; color:var(--mint); letter-spacing:.02em; }
.scene.light a.card .more { color:var(--teal-ink); }
a.card .more svg { width:16px; height:16px; transition:transform .5s var(--out); }
a.card:hover .more svg, a.card:focus-visible .more svg { transform:translateX(5px); }

/* ---------- hero sub-crumb ---------- */
.crumbs a { color:inherit; }

@media (prefers-reduced-motion: reduce) {
  .seg-chart .bar, .seg-chart .whisk, .seg-chart .val, .seg-fit-row .arrow svg path { transition:none; }
  .seg-chart:not(.in) .bar.h, .seg-chart:not(.in) .bar.v { transform:none; }
  .seg-chart:not(.in) .val, .seg-chart:not(.in) .whisk { opacity:1; }
  .seg-fit-row .arrow svg path { stroke-dashoffset:0; }
}
