/* Peptide Pocket Companion: the Peptide Table's paper, ink and rules, carried into a pocket tool. */
@font-face { font-family: 'Archivo'; src: url('../fonts/Archivo-VF.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: 'Literata'; src: url('../fonts/Literata-VF.woff2') format('woff2'); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Literata'; src: url('../fonts/Literata-Italic-VF.woff2') format('woff2'); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/JetBrainsMono-VF.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  color-scheme: light;
  --stock: #FFFFFF; --paper-2: #F6F7F8;
  --ink: #14202E; --ink-2: #3A4757; --ink-3: #56626F; --rule: #C9D1D6;
  --gA: #2F6B4A; --gB: #5E7F3A; --gC: #8A5A00; --gD: #A85A14; --gE: #9A2F2F;
  --gA-t: #2F6B4A; --gB-t: #4B6A2C; --gC-t: #75510A; --gD-t: #8C4A0E; --gE-t: #9A2F2F;
  --l-studied: #2F6B4A; --l-practitioner: #1F5F8B; --l-reported: #8C4A0E; --l-arithmetic: #3A4757;
  --font-chart: 'Archivo', system-ui, sans-serif;
  --font-body: 'Literata', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(16px, 2.4vw, 32px);
  --header-h: 52px;
  --lift: 0 8px 18px -4px rgb(20 32 46 / 0.35), 0 2px 4px rgb(20 32 46 / 0.18);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: var(--ink-3) var(--paper-2); }
body { margin: 0; background: var(--stock); color: var(--ink); font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.6; font-optical-sizing: auto; font-variant-numeric: lining-nums; caret-color: var(--ink); }
::selection { background: var(--ink); color: var(--stock); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
a:hover { text-decoration-color: currentColor; }
img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--font-chart); font-weight: 700; line-height: 1.12; letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
p { text-wrap: pretty; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a.skip { position: absolute; left: 8px; top: -60px; z-index: 90; background: var(--ink); color: var(--stock); padding: 8px 12px; font-family: var(--font-chart); }
a.skip:focus { top: 8px; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; }

/* Brand: the app icon beside the wordmark, as the site pairs its Vf mark with its name */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-chart); font-weight: 800; font-stretch: 112%; font-size: 1rem; white-space: nowrap; letter-spacing: -0.005em; }
.brand img { width: 28px; height: 28px; display: block; }
.brand small { font-weight: 500; font-stretch: 100%; color: var(--ink-3); font-size: 0.8125rem; }

/* Type roles */
.display { font-weight: 800; font-stretch: 108%; font-size: clamp(2.4rem, 7vw, 4.5rem); line-height: 0.98; letter-spacing: -0.03em; }
.headline { font-size: 1.625rem; font-weight: 700; }
.lede { font-family: var(--font-body); font-size: 1.1875rem; line-height: 1.55; max-width: 62ch; color: var(--ink-2); }
.label { font-family: var(--font-chart); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.ui { font-family: var(--font-chart); font-size: 0.875rem; font-weight: 500; line-height: 1.4; }
.meta { font-family: var(--font-chart); font-size: 0.8125rem; color: var(--ink-2); line-height: 1.4; }

/* Buttons: ink outline, inverting on hover. The one solid ink button is the screen's single commit action. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--ink); background: var(--stock); color: var(--ink); font-family: var(--font-chart); font-weight: 600; font-size: 0.9375rem; text-decoration: none; cursor: pointer; transition: background 160ms var(--ease-out), color 160ms var(--ease-out); }
.btn:hover { background: var(--ink); color: var(--stock); }
.btn[disabled], .btn[aria-disabled='true'] { border-color: var(--rule); color: var(--ink-3); background: var(--stock); cursor: not-allowed; }
.btn-ink { background: var(--ink); color: var(--stock); }
.btn-ink:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-sm { min-height: 36px; padding: 5px 12px; font-size: 0.8125rem; }
.btn-block { width: 100%; }
.link { font-family: var(--font-chart); font-weight: 700; font-size: 0.9375rem; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; color: var(--ink); }
.link-quiet { font-weight: 500; color: var(--ink-2); }

/* Fields: the calculator's boxed input with a paper-2 unit cell */
.field { display: grid; gap: 6px; }
.field > span:first-child { font-family: var(--font-chart); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.box { display: flex; align-items: stretch; border: 1px solid var(--ink-2); background: var(--stock); min-height: 46px; }
.box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.box input, .box select { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 12px; font-family: var(--font-mono); font-size: 1.125rem; outline: none; }
.box select { font-family: var(--font-chart); font-size: 1rem; }
.box input + select { flex: none; border-left: 1px solid var(--rule); background: var(--paper-2); padding: 0 10px; font-family: var(--font-chart); font-size: 0.9375rem; }
.box em { font-style: normal; display: grid; place-items: center; padding: 0 12px; background: var(--paper-2); border-left: 1px solid var(--rule); font-family: var(--font-chart); font-size: 0.875rem; color: var(--ink-2); }
.hint { font-family: var(--font-chart); font-size: 0.8125rem; color: var(--ink-2); line-height: 1.45; }
.warn { font-family: var(--font-chart); font-size: 0.875rem; font-weight: 600; color: var(--gE); line-height: 1.45; }

/* Chips: grade letter blocks and dose-label outlines (solid, solid, dashed, dotted) */
.gchip { display: inline-grid; place-items: center; width: 1.45em; height: 1.45em; color: #fff; font-family: var(--font-chart); font-weight: 800; font-size: 0.8125rem; background: var(--k); }
.lchip { display: inline-block; padding: 1px 7px; border: 1px solid currentColor; font-family: var(--font-chart); font-size: 0.75rem; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.lc-studied { color: var(--l-studied); }
.lc-practitioner { color: var(--l-practitioner); }
.lc-reported { color: var(--l-reported); border-style: dashed; }
.lc-arithmetic { color: var(--l-arithmetic); border-style: dotted; }
.stamp { display: inline-flex; align-items: center; gap: 6px; padding: 1px 7px; border: 1px solid var(--rule); font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-2); }
.stamp::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }

/* Tiles: 13% tint at rest, the grade letter always shown */
.g-A { --k: var(--gA); --kt: var(--gA-t); } .g-B { --k: var(--gB); --kt: var(--gB-t); } .g-C { --k: var(--gC); --kt: var(--gC-t); }
.g-D { --k: var(--gD); --kt: var(--gD-t); } .g-E { --k: var(--gE); --kt: var(--gE-t); }
.tile { position: relative; flex: none; width: 56px; aspect-ratio: 1; background: color-mix(in srgb, var(--k) 13%, #fff); border: 1px solid color-mix(in srgb, var(--k) 42%, #fff); color: var(--ink); font-family: var(--font-chart); container-type: inline-size; }
.tile b { position: absolute; left: 7cqi; top: 5cqi; font-size: 20cqi; font-weight: 800; font-stretch: 118%; color: var(--kt); line-height: 1; }
.tile i { position: absolute; inset: 0; display: grid; place-items: center; padding-top: 10cqi; font-style: normal; font-weight: 800; font-stretch: 125%; font-size: 36cqi; letter-spacing: -0.02em; color: var(--k); }
.tile.solid { background: var(--k); border-color: var(--k); }
.tile.solid b, .tile.solid i { color: #fff; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; } }

/* Neutral tiles inside the companion: ink on paper, the symbol only */
.tile.n { --k: #14202E; --kt: #14202E; background: var(--paper-2); border-color: var(--rule); }
.tile.n i { padding-top: 0; color: var(--ink); }
.mg-code { --k: #14202E; --kt: #3A4757; }
/* Tiles are sized boxes wherever they land, including inside inline wrappers (travel packing list). */
.tile { display: inline-block; vertical-align: middle; }
