/* zen.mzarras.com — sibling of mzarras.com.
   Paper, serif body, mono micro-labels, deep green accent, clay data dots. */

:root {
  --paper:      #e9edee;
  --ink:        #14242c;
  --ink-2:      #4a5a61;
  --muted:      #5b6c72;
  --rule:       #cbd4d6;
  --band:       #d9e2e0;
  --line:       #3c4e56;  /* BG trace */
  --green:      #2a7048;  /* accent: numerals, links, active nav (5.1:1) */
  --green-mark: #2f8a57;  /* accent as a chart mark (3.6:1, CVD-separated) */
  --clay:       #b5701a;  /* extremes, oref key, stale warning */

  --serif: "Iowan Old Style", Charter, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --col: 820px;
  --gap: 44px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 19px/1.62 var(--serif);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--col);
  margin: 0 auto;
  padding: 40px 26px 0;
}

a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible,
[tabindex]:focus-visible,
button:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 26px; top: 10px; background: var(--paper); padding: 6px 10px; z-index: 5; }

/* ---------- mono micro-label ---------- */
.mono, .micro, .seg, .backlink, .foot a, .unit, .key, th, .meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.micro, .meta { color: var(--muted); }

/* ---------- header ---------- */
.head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.brand { margin: 0; display: flex; align-items: baseline; }
.wordmark {
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark .sub { color: var(--green); }
.wordmark .tld { color: #8b9ba1; }
.backlink { color: var(--green); text-decoration: none; padding-bottom: 3px; border-bottom: 1px solid var(--green); }
.backlink:hover { color: var(--ink); border-color: var(--ink); }

.pill {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--clay); border: 1px solid currentColor; border-radius: 2px;
  padding: 2px 6px; margin-left: 10px; white-space: nowrap;
}

/* ---------- hero ---------- */
.hero { display: flex; align-items: center; gap: 26px; margin: 30px 0 0; }
.hero-figure { flex: 1 1 auto; min-width: 0; margin: 0; }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-wrap:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }

.hero-now { flex: 0 0 auto; text-align: right; }
.bg-value {
  font-family: var(--mono);
  font-size: 46px; line-height: 1; font-weight: 500;
  color: var(--green);
}
.hero-now .unit { display: block; margin-top: 6px; color: var(--muted); }
.hero-now .trend { color: var(--ink-2); letter-spacing: 0; }
.hero-now .freshness { margin: 8px 0 0; }
.stale .bg-value { color: var(--ink-2); }
.stale .freshness { color: var(--clay); }

.legend {
  display: flex; flex-wrap: wrap; gap: 6px 22px;
  margin: 12px 0 0; padding: 0;
}
.key { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
.key i { display: inline-block; width: 16px; height: 8px; flex: none; }
.key .k-bg { border-top: 2px solid var(--line); height: 2px; }
.key .k-zen { border-top: 2px dashed var(--green-mark); height: 2px; }
.key .k-band { background: var(--band); height: 10px; }
.key .k-ext { width: 8px; height: 8px; border-radius: 50%; background: var(--clay); }

/* ---------- chart internals ---------- */
.c-band { fill: var(--band); }
.c-line { fill: none; stroke: var(--line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-proj { fill: none; stroke: var(--green-mark); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 3 4; }
.c-now { stroke: var(--rule); stroke-width: 1; }
.c-dot { stroke: var(--paper); stroke-width: 2; }
.c-dot-green { fill: var(--green-mark); }
.c-dot-clay { fill: var(--clay); }
.c-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  fill: var(--muted);
}
.c-label-green { fill: var(--green); }
.c-cursor { stroke: var(--ink-2); stroke-width: 1; }

.tip {
  position: absolute; top: 0; left: 0; pointer-events: none; z-index: 2;
  transform: translate(-50%, -120%);
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 5px 9px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--ink); white-space: nowrap;
  opacity: 0; transition: opacity 120ms linear;
}
.tip.on { opacity: 1; }
.tip b { color: var(--green); font-weight: 500; }

/* ---------- section rules ---------- */
section { margin-top: var(--gap); }
.rule-head { display: flex; align-items: center; gap: 16px; margin: 0 0 18px; }
.rule-head h2 { margin: 0; font: inherit; font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.rule-head .rule { flex: 1 1 auto; height: 1px; background: var(--rule); }
hr.hair { border: 0; border-top: 1px solid var(--rule); margin: 26px 0 0; }

/* ---------- tables ---------- */
.tbl-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 14px; letter-spacing: 0.02em; }
th, td { text-align: right; padding: 9px 0; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-weight: 400; font-size: 11px; padding-bottom: 7px; }
th:first-child, td:first-child { text-align: left; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
td { color: var(--ink-2); }
td.zen { color: var(--green); }
td.head-cell, th[scope="row"] { color: var(--muted); font-weight: 400; font-size: 11px;
  letter-spacing: 0.13em; text-transform: uppercase; }
.dotkey { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.dotkey.zen { background: var(--green-mark); }
.dotkey.oref { background: var(--clay); }

.note { margin: 14px 0 0; font-style: italic; color: var(--ink-2); font-size: 17px; line-height: 1.55; }
.meta { margin: 14px 0 0; font-size: 11px; }

.seg-row { display: flex; gap: 18px; align-items: center; margin: 0 0 16px; }
.seg {
  background: none; border: 0; padding: 2px 0 4px; cursor: pointer;
  color: var(--muted); border-bottom: 1px solid transparent;
}
.seg[aria-pressed="true"] { color: var(--green); border-bottom-color: var(--green); }
.seg:hover { color: var(--ink); }

details.data { margin-top: 16px; }
details.data summary { font-family: var(--mono); font-size: 11px; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--muted); cursor: pointer; }
details.data summary:hover { color: var(--ink); }
details.data .tbl-scroll { max-height: 320px; overflow-y: auto; margin-top: 12px; }

/* ---------- prose ---------- */
.prose p { margin: 0 0 1.05em; }
.prose p:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */
footer { margin: var(--gap) 0 0; padding: 22px 0 46px; border-top: 1px solid var(--rule); }
.foot-links { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 0 0 14px; padding: 0; list-style: none; }
.foot a { color: var(--green); text-decoration: none; }
.foot a:hover { color: var(--ink); }
.disclaimer { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin: 0; line-height: 1.8; }

.error { color: var(--clay); font-style: italic; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  :root { --col: 100%; --gap: 34px; }
  body { font-size: 17.5px; }
  .wrap { padding: 26px 18px 0; }
  .hero { flex-direction: column-reverse; align-items: stretch; gap: 16px; }
  .hero-now { text-align: left; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
  .hero-now .unit { margin-top: 0; }
  .hero-now .freshness { flex-basis: 100%; margin-top: 2px; }
  .bg-value { font-size: 40px; }
  table { font-size: 13px; }
  .note { font-size: 16px; }
}

@media (max-width: 400px) {
  .wrap { padding: 22px 14px 0; }
  .wordmark { font-size: 15px; }
  .bg-value { font-size: 36px; }
  table { font-size: 12px; }
  th { font-size: 10px; letter-spacing: 0.08em; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .tip, .seg-row { display: none; }
  body { background: #fff; }
}
