/* PrintProfit design system — vanilla CSS, no build step. */
:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --border: #e4e0d8;
  --text: #1c1a17;
  --text-soft: #5c574e;
  --brand: #e8590c;       /* molten-orange, nods to a hot nozzle */
  --brand-ink: #ad3e02;
  --brand-soft: #fff1e8;
  --accent: #1f7a5a;      /* profit green */
  --accent-soft: #e7f4ee;
  --danger: #c0392b;
  --focus: #1565c0;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(28,26,23,.05), 0 6px 24px -12px rgba(28,26,23,.18);
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16140f; --surface: #211e18; --surface-2: #2b271f; --border: #39342a;
    --text: #f3efe7; --text-soft: #b3ac9c; --brand: #ff7a33; --brand-ink: #ff924f;
    --brand-soft: #2e2117; --accent: #3fc093; --accent-soft: #173028; --focus: #8ab4f8;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 30px -14px rgba(0,0,0,.6);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }
body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg);
  line-height: 1.6; font-size: 17px; -webkit-font-smoothing: antialiased;
}
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
a { color: var(--brand-ink); text-underline-offset: 2px; }
a:hover { color: var(--brand); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: .2em 0 .3em; }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin: 1.8em 0 .5em; }
p { margin: .6em 0; }
.muted { color: var(--text-soft); }
.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100; }
.skip:focus { left: 0; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.logo .dot { color: var(--brand); }
.site-header nav { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.site-header nav a { color: var(--text-soft); text-decoration: none; padding: 7px 11px; border-radius: 8px; font-size: .95rem; font-weight: 500; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.cur-select { font: inherit; font-size: .9rem; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }

/* hero */
.hero { padding: 48px 0 12px; }
.hero p.lede { font-size: 1.2rem; color: var(--text-soft); max-width: 60ch; }
.badge { display: inline-block; background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; font-size: .8rem; padding: 4px 12px; border-radius: 999px; }

/* cards grid */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin: 24px 0; }
.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.card:hover { transform: translateY(-2px); border-color: var(--brand); }
.card .cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-ink); font-weight: 700; }
.card h3 { margin: 6px 0 4px; font-size: 1.1rem; }
.card p { margin: 0; color: var(--text-soft); font-size: .95rem; }

/* calculator layout */
.calc-layout { display: grid; gap: 28px; grid-template-columns: 1fr; margin-top: 10px; }
@media (min-width: 880px) { .calc-layout { grid-template-columns: minmax(0,1.05fr) minmax(0,.95fr); align-items: start; } }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.field { margin: 0 0 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 5px; font-size: .98rem; }
.field .hint { display: block; color: var(--text-soft); font-size: .85rem; margin-top: 4px; }
.input-wrap { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); overflow: hidden; }
.input-wrap:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.input-wrap .affix { display: inline-flex; align-items: center; padding: 0 11px; background: var(--surface-2); color: var(--text-soft); font-size: .9rem; white-space: nowrap; }
.input-wrap .affix.pre { border-right: 1px solid var(--border); }
.input-wrap .affix.post { border-left: 1px solid var(--border); }
.field input[type=number], .field select { font: inherit; width: 100%; border: 0; background: transparent; color: var(--text); padding: 11px 12px; min-width: 0; }
.field input:focus, .field select:focus { outline: none; }
.field select { cursor: pointer; padding-right: 8px; }
.field.invalid .input-wrap { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .85rem; margin-top: 4px; display: none; }
.field.invalid .field-error { display: block; }

/* results */
.results { position: sticky; top: 76px; }
.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.result-list li .rlabel { color: var(--text-soft); }
.result-list li .rval { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.result-primary { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); border-radius: var(--radius-sm); padding: 16px 18px; margin-top: 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.result-primary .rlabel { font-weight: 700; }
.result-primary .rval { font-family: var(--mono); font-size: 1.8rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.result-note { font-size: .82rem; color: var(--text-soft); margin-top: 12px; }

/* prose */
.prose { max-width: 70ch; }
.prose h2 { border-top: 1px solid var(--border); padding-top: 1.2em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: .3em 0; }
details.faq { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px 16px; margin: 8px 0; background: var(--surface); }
details.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; }
details.faq[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.assump { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px 18px; font-size: .92rem; }
.assump ul { margin: .4em 0; }

/* buttons */
.btn { display: inline-block; background: var(--brand); color: #fff; font-weight: 600; padding: 11px 18px; border-radius: var(--radius-sm); text-decoration: none; border: 0; cursor: pointer; font: inherit; }
.btn:hover { background: var(--brand-ink); color: #fff; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* disclosure / footer */
.disclosure { font-size: .85rem; color: var(--text-soft); background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 16px; margin: 22px 0; }
.site-footer { border-top: 1px solid var(--border); margin-top: 56px; background: var(--surface); }
.site-footer .wrap { padding: 32px 20px; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); }
.site-footer h4 { margin: 0 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); }
.site-footer a { display: block; color: var(--text-soft); text-decoration: none; padding: 3px 0; font-size: .92rem; }
.site-footer a:hover { color: var(--brand); }
.copyright { grid-column: 1/-1; border-top: 1px solid var(--border); padding-top: 16px; color: var(--text-soft); font-size: .85rem; }
.breadcrumb { font-size: .85rem; color: var(--text-soft); margin: 18px 0 0; }
.breadcrumb a { color: var(--text-soft); }
.toc-related { display: flex; gap: 10px; flex-wrap: wrap; }
.toc-related a { font-size: .9rem; background: var(--surface-2); border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--text); }
.toc-related a:hover { border-color: var(--brand); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
