/* Astral Amino — the peptide calculator (peptide-calculator.html). Loaded after css/amino.css; its tokens only. */
.calc-page { --warn: #e2b483; --cut: polygon(0 0, calc(100% - 28px) 0, 100% 20px, 100% 100%, 0 100%); }

/* ---- the calculator: the fields, and the reading beside them ---- */
.calc { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; margin-top: clamp(28px, 3vw, 40px); padding-top: clamp(24px, 2.6vw, 32px); border-top: 1px solid var(--line); }
.calc-field + .calc-field { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.calc-field__head { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.calc-field__label { font-size: 15.5px; font-weight: 500; }
.calc-field__hint { margin-top: 2px; font-size: 13.5px; color: var(--bone-3); }
.calc-field__error { margin-top: 6px; font-size: 13px; color: var(--warn); }
.calc-input { position: relative; margin-top: 10px; }
.calc-input input { width: 100%; height: 52px; padding: 0 56px 0 16px; font: 300 20px/1 var(--font); font-feature-settings: "ss01"; font-variant-numeric: tabular-nums; letter-spacing: -.01em; color: var(--bone); background: var(--obsidian-2); border: 0; border-radius: 0; box-shadow: inset 0 0 0 1px var(--line-2); outline: none; transition: box-shadow .25s; -webkit-appearance: none; appearance: none; }
.calc-input input::placeholder { color: var(--bone-3); opacity: .6; }
.calc-input input:hover { box-shadow: inset 0 0 0 1px var(--bone-3); }
.calc-input input:focus-visible { box-shadow: inset 0 0 0 1px var(--bone); }
.calc-field.is-invalid input { box-shadow: inset 0 0 0 1px var(--warn); }
.calc-input__unit { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 13.5px; color: var(--bone-3); pointer-events: none; }
.calc-chips { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin-top: 8px; }
.calc-chip { min-height: 36px; font-size: 13.5px; font-weight: 500; color: var(--bone-2); font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px var(--line-2); transition: color .25s, box-shadow .25s; }
.calc-chip:hover { color: var(--bone); box-shadow: inset 0 0 0 1px var(--bone-3); }
.calc-chip.is-on { color: var(--bone); box-shadow: inset 0 0 0 1px var(--bone); }
.calc-chip:active { transform: scale(.97); }
.calc-unit { display: inline-flex; margin-left: auto; box-shadow: inset 0 0 0 1px var(--line-2); }
.calc-unit button { min-width: 44px; min-height: 30px; font-size: 13px; font-weight: 500; color: var(--bone-3); transition: color .25s, background-color .25s; }
.calc-unit button.is-on { color: var(--ink); background: var(--bone); }

/* the reading: the raised card with the cut corner the product page uses */
.calc-result { position: sticky; top: calc(var(--header-h) + 24px); padding: clamp(20px, 2.2vw, 28px); background: var(--obsidian-2); clip-path: var(--cut); }
.calc-result__draw { display: grid; }
.calc-result__lead { font-size: 13.5px; color: var(--bone-3); }
.calc-result__figure { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.calc-result__num { font-size: clamp(44px, 4vw, 56px); font-weight: 300; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.calc-result__unit { font-size: 16px; color: var(--bone-2); }
.calc:not(.is-ready) .calc-result__num { color: var(--bone-3); }
.calc-syringe { --calc-fill: 0; margin: 14px -4px 2px; }
.calc-syringe__art { width: 100%; height: auto; overflow: hidden; }
.calc-syringe__needle, .calc-syringe__hub, .calc-syringe__flange { fill: rgba(237, 235, 230, .42); }
.calc-syringe__barrel { fill: rgba(237, 235, 230, .03); stroke: rgba(237, 235, 230, .5); stroke-width: 2; }
.calc-syringe__fill { fill: rgba(237, 235, 230, .7); transform-box: fill-box; transform-origin: left center; transform: scaleX(var(--calc-fill)); transition: transform .4s var(--ease), fill .2s; }
.calc-syringe.is-over .calc-syringe__fill { fill: var(--warn); }
/* the translate distance is GEO.span in js/calculator.js, in the drawing's own units */
.calc-syringe__plunger { transform: translateX(calc(var(--calc-fill) * 500px)); transition: transform .4s var(--ease); }
.calc-syringe__stopper { fill: var(--bone-3); }
.calc-syringe__rod { fill: rgba(237, 235, 230, .2); }
.calc-syringe__tick { stroke: rgba(237, 235, 230, .42); stroke-width: 1.5; }
.calc-syringe__tick.is-major { stroke: rgba(237, 235, 230, .85); stroke-width: 2; }
.calc-syringe__label { font-family: var(--font); font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; fill: var(--bone-3); }
.calc-capacity { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.calc-capacity__label { font-size: 13px; color: var(--bone-3); }
.calc-capacity__options { display: inline-flex; box-shadow: inset 0 0 0 1px var(--line-2); }
.calc-capacity__options button { min-width: 60px; min-height: 32px; padding: 0 10px; font-size: 13px; font-weight: 500; color: var(--bone-3); font-variant-numeric: tabular-nums; transition: color .25s, background-color .25s; }
.calc-capacity__options button:hover { color: var(--bone); }
.calc-capacity__options button.is-on { color: var(--ink); background: var(--bone); }
.calc-result__status { min-height: 20px; margin-top: 12px; }
.calc-result__state { font-size: 13px; color: var(--bone-2); }
.calc-result__state.is-warn { color: var(--warn); }
.calc-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; border-top: 1px solid var(--line); }
.calc-facts > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.calc-facts > div:nth-child(odd) { padding-right: 14px; border-right: 1px solid var(--line); }
.calc-facts > div:nth-child(even) { padding-left: 16px; }
.calc-facts dt { font-size: 13px; color: var(--bone-3); }
.calc-facts dd { margin-top: 2px; font-size: 16px; font-variant-numeric: tabular-nums; }
.calc-result__ruo { margin-top: 12px; font-size: 12.5px; color: var(--bone-3); }

/* ---- the video, and the units primer beside it ---- */
.calc-h2 { font-size: clamp(20px, 1.7vw, 24px); font-weight: 400; line-height: 1.25; letter-spacing: -.015em; text-wrap: balance; }
.calc-learn__body { margin-top: 6px; max-width: 36em; font-size: 15px; color: var(--bone-2); line-height: 1.6; text-wrap: pretty; }
.calc-learn { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); margin-top: clamp(48px, 5vw, 72px); }
/* the poster is a background, never an image element */
.calc-video { position: relative; aspect-ratio: 4 / 3; margin-top: 16px; overflow: hidden; background: var(--obsidian-2) url("../media/calculator/reconstitution-video-poster.webp?v=7adb6328a9ba63d9") center / cover no-repeat; }
.calc-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.calc-video__play { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; background: linear-gradient(to top, rgba(14, 14, 15, .55), rgba(14, 14, 15, 0) 42%); }
.calc-video__icon { display: grid; place-items: center; width: 60px; height: 60px; color: var(--ink); background: var(--bone); clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); transition: transform .35s var(--ease); }
.calc-video__icon svg { width: 22px; height: 22px; margin-left: 3px; }
@media (hover: hover) { .calc-video__play:hover .calc-video__icon { transform: scale(1.06); } }
.calc-video__play:active .calc-video__icon { transform: scale(.96); }
.calc-video__label { position: absolute; left: 16px; bottom: 14px; font-size: 13.5px; font-weight: 500; color: var(--bone); }
.calc-video__time { position: absolute; right: 16px; bottom: 14px; font-size: 13px; color: var(--bone-2); font-variant-numeric: tabular-nums; }
.calc-video__play:focus-visible { outline: 2px solid var(--bone); outline-offset: -4px; }
.calc-scale { margin-top: 18px; border-top: 1px solid var(--line); }
.calc-scale__row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 68px; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.calc-scale__size { font-size: 13.5px; font-weight: 500; }
.calc-scale__bar { position: relative; height: 3px; background: var(--line); }
.calc-scale__mark { position: absolute; inset: 0 auto 0 0; width: calc(var(--cap) * 100%); background: var(--bone); }
.calc-scale__cap { font-size: 13px; text-align: right; color: var(--bone-3); }

/* ---- the math, the questions, the related pages: a title on the left, the matter on the right ---- */
.calc-doc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(20px, 5vw, 72px); margin-top: clamp(40px, 4.4vw, 60px); padding-top: clamp(22px, 2.4vw, 30px); border-top: 1px solid var(--line); }
.calc-formula { display: grid; border-top: 1px solid var(--line); counter-reset: step; }
.calc-formula li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 2px 8px; padding: 12px 0; border-bottom: 1px solid var(--line); counter-increment: step; }
.calc-formula li::before { content: counter(step); grid-row: span 2; font-size: 13px; color: var(--bone-3); font-variant-numeric: tabular-nums; line-height: 1.55; }
.calc-formula__eq { font-size: 16px; font-variant-numeric: tabular-nums; }
.calc-formula__note { font-size: 14px; color: var(--bone-3); }
.calc-examples { margin-top: 20px; }
.calc-faq.qa { border-top: 1px solid var(--line); }
.calc-faq summary { min-height: 52px; padding: 12px 0; font-size: 15px; }
.calc-faq details p { max-width: 40em; padding-bottom: 16px; font-size: 14.5px; }
.calc-next { border-top: 1px solid var(--line); }
.calc-next li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.calc-next__link { font-size: 15px; font-weight: 500; background: linear-gradient(var(--line-2), var(--line-2)) 0 100% / 100% 1px no-repeat; transition: background-image .2s; }
.calc-next__link:hover { background-image: linear-gradient(currentColor, currentColor); }

/* ---- the solvent, as one product row: a hairline frame on the page colour, which the vial photographs are made on ---- */
.calc-product { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: clamp(16px, 2.4vw, 32px); margin-block: clamp(48px, 5vw, 72px); padding: 10px clamp(16px, 2.4vw, 28px) 10px 10px; box-shadow: inset 0 0 0 1px var(--line-2); }
.calc-product__pic .vial { width: 64px; }
.calc-product__title { font-size: 17px; font-weight: 500; }
.calc-product__lede { margin-top: 2px; font-size: 14.5px; color: var(--bone-2); }

/* ---- phones: the reading, docked while the fields fill the screen ---- */
.calc-dock { display: none; }
.calc-dock__btn { display: flex; align-items: baseline; gap: 10px; width: 100%; min-height: 50px; padding: 13px 18px; text-align: left; color: var(--ink); background: var(--bone); clip-path: polygon(0 0, 100% 0, calc(100% - 18px) 100%, 0 100%); }
.calc-dock__lead, .calc-dock__ml { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.calc-dock__num { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.calc-dock__chev { align-self: center; width: 18px; height: 18px; margin-left: auto; margin-right: 18px; color: var(--ink-2); }
.calc-dock__btn:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }

@media (max-width: 959px) {
  .calc, .calc-learn, .calc-doc { grid-template-columns: minmax(0, 1fr); }
  .calc-result { position: static; }
  .calc-dock { position: fixed; z-index: 55; left: var(--gutter); right: var(--gutter); bottom: calc(12px + env(safe-area-inset-bottom)); display: block; visibility: hidden; opacity: 0; transform: translateY(calc(100% + 24px)); transition: transform .25s var(--ease), opacity .25s var(--ease), visibility 0s linear .25s; }
  .calc-dock.is-shown.is-ready { visibility: visible; opacity: 1; transform: none; transition: transform .25s var(--ease), opacity .25s var(--ease), visibility 0s; }
}
@media (max-width: 559px) {
  .calc-product { grid-template-columns: 52px minmax(0, 1fr); row-gap: 12px; padding-bottom: 16px; }
  .calc-product__pic { grid-row: span 2; align-self: start; }
  .calc-product__pic .vial { width: 52px; }
  .calc-product .btn { justify-self: start; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .calc-syringe__fill, .calc-syringe__plunger, .calc-dock, .calc-dock.is-shown.is-ready, .calc-video__icon { transition: none; }
}

.calc-scale__row--1 { --cap: .3; }
.calc-scale__row--2 { --cap: .5; }
.calc-scale__row--3 { --cap: 1; }
