:root {
  --c-green:  #7aa05a;
  --c-amber:  #c98a3d;
  --c-brown:  #8a5a33;
  --c-dark:   #4a3222;
  --c-red:    #e75b55;
  --c-blue:   #2f96cc;
  --c-yellow: #2563eb; /* legacy variable name — hirschmann.io interactive accent (blue) */
  --c-ink:    #2f2a26;
  --c-paper:  #fdfcfa;
  --c-grid:   #e3ded8;
}

* { box-sizing: border-box; }

html, body { overflow-x: hidden; }

body {
  margin: 0;
  background: var(--c-paper);
  color: var(--c-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.65;
}

/* site header — quiet chrome, same column as the article */
.site-header {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.1em 20px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9em;
  border-bottom: 1px solid var(--c-grid);
}
.site-header .site-name {
  color: var(--c-ink);
  font-weight: 500;
  text-decoration: none;
}
.site-header nav a {
  color: #6b645d;
  text-decoration: none;
  margin-left: 1.2em;
}
.site-header nav a:hover { color: #2563eb; }
.site-header nav a[aria-current="page"] { color: #2563eb; }

/* °C/°F segmented control - interactive accent like the sliders/buttons,
   softly rounded corners (author round 11) */
.unit-toggle {
  display: inline-flex;
  border: 1px solid #2563eb;
  border-radius: 10px;
  overflow: hidden;
  vertical-align: baseline;
}
.unit-toggle button {
  appearance: none;
  border: none;
  background: var(--c-paper);
  font: inherit;
  font-size: 0.85em;
  line-height: 1;
  padding: 0.3em 0.65em;
  color: #6b645d;
  cursor: pointer;
}
.unit-toggle button:hover { color: #2563eb; }
.unit-toggle button.is-active,
.unit-toggle button[aria-pressed="true"] {
  color: #fff;
  background: #2563eb;
}

/* variant: toggle placed inline in the article body - sits centered on its
   own line below the roast-time slider, above the charge paragraph */
.unit-toggle--inline {
  display: flex;
  width: max-content;
  margin: 1.1em auto 1.2em;
}

article {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 120px;
}

h1 { font-size: 2.4em; line-height: 1.15; margin: 0.4em 0; }
h2 { font-size: 1.6em; margin-top: 2em; }

/* colored bold terms — prose color must match render color (spec §2 rule 6) */
.c-green  { color: var(--c-green);  font-weight: 600; }
.c-amber  { color: var(--c-amber);  font-weight: 600; }
.c-brown  { color: var(--c-brown);  font-weight: 600; }
.c-red    { color: var(--c-red);    font-weight: 600; }
.c-blue   { color: var(--c-blue);   font-weight: 600; }
.c-yellow { color: var(--c-yellow); font-weight: 600; }

.demo {
  margin: 2em 0;
  max-width: 100%;
  user-select: none;
  -webkit-user-select: none;
}

.demo canvas { display: block; width: 100%; border-radius: 6px; }
.demo-3d canvas { touch-action: pan-y; cursor: grab; } /* pan-y: vertical swipes scroll the page on touch; demos claim horizontal drags only */
.demo-3d canvas:active { cursor: grabbing; }

/* roast row: curve chart and 3D bean side by side at all widths */
.demo-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 2em 0;
}
.demo-row .demo { margin: 0; min-width: 0; }
.demo-row [data-demo="roast-curve"] { flex: 63 1 0px; }
.demo-row [data-demo="morphing-bean"] { flex: 37 1 0px; }

article a {
  color: #2563eb;
  text-decoration-color: rgba(37, 99, 235, 0.4);
}
article a:hover { color: #1d4ed8; }

/* stag icon linked together with the "Hirsch Roast" wording; inline-block is
   atomic, so the link underline stays on the text and never crosses the icon */
.credits-logo-inline {
  display: inline-block;
  vertical-align: -7px;
  height: 28px;
  width: auto;
  text-decoration: none;
}

.site-footer {
  margin: 4em auto 5em;
  padding: 0 20px;
  text-align: center;
  font-size: 0.8em;
  color: #6b645d;
}
.site-footer p { margin: 0.4em 0; }
.site-footer a { color: #6b645d; }
.site-footer a:hover { color: #2563eb; }

.demo-readout {
  font-variant-numeric: tabular-nums;
  font-size: 0.85em;
  color: #6b645d;
  text-align: center;
  margin-top: 6px;
  min-height: 2.9em; /* reserves two lines — no vertical jump when text wraps */
  line-height: 1.45;
  max-width: 100%;
  overflow-wrap: break-word;
  padding: 0 4px;
  box-sizing: border-box;
}

.demo-fallback {
  padding: 2em;
  text-align: center;
  background: #f1ede8;
  border-radius: 6px;
  color: #6b645d;
}

/* slider widget */
.cw-slider {
  padding: 14px 0;
  /* inset from the column edges so the handle never sits against the screen
     edge on phones — comfortable thumb reach at both extremes */
  margin: 0 12px;
  cursor: pointer;
  touch-action: none;
  outline-offset: 4px;
}
@media (max-width: 600px) {
  .cw-slider { margin: 0 22px; }
}
.cw-slider-track {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--c-grid);
}
.cw-slider-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
  background: var(--c-yellow);
}
.cw-slider-handle {
  position: absolute;
  top: 50%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-yellow);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  transform: translate(-50%, -50%);
}

/* pending demos — visible placeholders while Phase 3 builds them */
.demo-pending {
  border: 2px dashed var(--c-grid);
  border-radius: 6px;
  padding: 2.2em 1.5em;
  text-align: center;
}
.demo-pending .demo-caption {
  margin: 0;
  font-size: 0.85em;
  color: #8a827a;
  font-style: italic;
}
