@font-face { font-family: Ringbearer; src: url("fonts/ringbearer.ttf") format("truetype"); font-display: swap; }

/* Tokens shared with the lembas health page and Cuatro's dashboard. */
:root {
  --bg: #ece2cb; --surface: #f6efdd; --sunk: #e5d9bd;
  --line: color-mix(in srgb, var(--text) 12%, transparent);
  --text: #2a2016; --text-2: #5a4731; --muted: #7d6849;
  --series: #2f6b3a; --series-2: #7d5f17; --gold: #7d5f17; --stone: #2c3a4a; --glow: #c8742a;
  --good: #2f6b3a; --warning: #a8741a; --serious: #b4562e; --critical: #a8322b;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --r-panel: 8px; --r-small: 4px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12100c; --surface: #1b1813; --sunk: #24201a;
    --text: #f2e8cf; --text-2: #cdbe9b; --muted: #9a8a68;
    --series: #8dbb72; --series-2: #d4af37; --gold: #d4af37; --stone: #0d141c; --glow: #f0a050;
    --good: #8dbb72; --warning: #e0a940; --serious: #e08a5e; --critical: #e5675c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
::selection { background: color-mix(in srgb, var(--gold) 30%, transparent); }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 "Alegreya Sans", "Gill Sans", sans-serif; font-variant-numeric: tabular-nums lining-nums; }
main { max-width: 1240px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); }
h1, h2, h3, p { margin: 0; }
b { font-weight: 500; }

.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.mark { display: flex; align-items: center; gap: 12px; }
.mark svg { flex: none; }
h1 { font: 400 32px/1 Ringbearer, "EB Garamond", Georgia, serif; color: var(--gold); letter-spacing: .02em; }
.quote { font: italic 400 16px/1.3 "EB Garamond", Georgia, serif; color: var(--text-2); margin: 4px 0 0 48px; }
.age { color: var(--muted); font-size: 14px; }
.age.stale { color: var(--critical); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 20px 24px; min-width: 0; }
h2 { font: 500 20px/1.2 "EB Garamond", Georgia, serif; color: var(--gold); margin-bottom: 12px; }
.aside { font: 400 14px "Alegreya Sans", sans-serif; color: var(--muted); margin-left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Status eye: a word always sits beside it. */
.eye { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 14px; white-space: nowrap; }
.eye svg { width: 16px; height: 16px; flex: none; }
.eye[data-lvl="good"] svg { color: var(--good); }
.eye[data-lvl="warning"] svg { color: var(--warning); }
.eye[data-lvl="serious"] svg { color: var(--serious); }
.eye[data-lvl="critical"] svg { color: var(--critical); }
.eye[data-lvl="idle"] { color: var(--muted); }
.eye[data-lvl="idle"] svg { color: var(--muted); opacity: .5; }

/* The palantír: its fire widens and warms with the chip temperature. */
.now { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 20px; align-items: center; }
.orb { width: 88px; height: 88px; }
.orb .iris { transition: rx .8s var(--ease), ry .8s var(--ease), opacity .8s var(--ease), fill .8s var(--ease); }
.now h2 { font-size: 28px; color: var(--text); margin: 0 0 4px; }
.now[data-lvl="warning"] h2 { color: var(--warning); }
.now[data-lvl="serious"] h2 { color: var(--serious); }
.now[data-lvl="critical"] h2 { color: var(--critical); }
.now .what { color: var(--text-2); overflow-wrap: anywhere; }
.issues { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.issues:empty { display: none; }
.issues li { display: flex; gap: 12px; align-items: baseline; color: var(--text-2); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.facts b { color: var(--text); }

/* Big readings: temperature and fan, set in the display serif */
.readings { display: flex; flex-wrap: wrap; gap: 16px 40px; margin: 4px 0 20px; }
.reading { display: grid; gap: 2px; }
.reading .n { font: 500 40px/1 "EB Garamond", Georgia, serif; }
.reading .n small { font-size: 20px; color: var(--muted); margin-left: 2px; }
.reading .l { font-size: 14px; color: var(--muted); }
.reading[data-lvl="warning"] .n { color: var(--warning); }
.reading[data-lvl="serious"] .n { color: var(--serious); }
.reading[data-lvl="critical"] .n { color: var(--critical); }

/* Range switch */
.range { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-small); overflow: hidden; float: right; margin-top: -2px; }
.range button { font: 14px "Alegreya Sans", sans-serif; color: var(--muted); background: none; border: 0; padding: 6px 12px; min-height: 32px; cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease); }
.range button[aria-pressed="true"] { background: var(--sunk); color: var(--text); }
.range button:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* Strip charts sharing one time axis */
.strips { position: relative; touch-action: pan-y; }
.strip { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: stretch; padding: 8px 0; border-top: 1px solid var(--line); }
.strip:first-child { border-top: 0; padding-top: 0; }
.strip .lab { font-size: 14px; color: var(--muted); display: grid; align-content: start; gap: 2px; }
.strip .lab b { color: var(--text); font-size: 16px; white-space: nowrap; }
.strip .lab .k { display: inline-flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.strip .lab .k i { width: 10px; height: 2px; display: inline-block; }
.strip .plot { position: relative; min-width: 0; }
.strip .plot .hi { position: absolute; right: 0; top: -2px; font-size: 12px; color: var(--muted); }
.strip svg { display: block; width: 100%; overflow: visible; }
.strip svg text { font: 12px "Alegreya Sans", sans-serif; fill: var(--muted); }
.axis { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; font-size: 12px; color: var(--muted); padding-top: 4px; }
.axis div { display: flex; justify-content: space-between; }
.cursor { position: absolute; top: 0; bottom: 18px; width: 1px; background: var(--text-2); opacity: .5; pointer-events: none; display: none; }
.tip { position: absolute; top: -8px; pointer-events: none; background: var(--text); color: var(--surface); font-size: 13px; line-height: 1.35;
  padding: 6px 10px; border-radius: var(--r-small); white-space: nowrap; transform: translate(-50%, -100%); display: none; z-index: 2; }

/* Figures and meters (right column) */
.figure { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.figure .n { font-size: 32px; font-weight: 500; line-height: 1; }
.figure .of { color: var(--muted); }
.meter { height: 4px; border-radius: 2px; background: var(--sunk); margin: 12px 0 4px; overflow: hidden; position: relative; }
.meter i { display: block; height: 100%; background: var(--series); transition: width .6s var(--ease); }
.meter i[data-lvl="warning"] { background: var(--warning); }
.meter i[data-lvl="serious"] { background: var(--serious); }
.meter i[data-lvl="critical"] { background: var(--critical); }
.meta { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.sep { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 0; border-top: 1px solid var(--line); vertical-align: baseline; }
th { color: var(--muted); font-weight: 400; font-size: 14px; border-top: 0; }
td.r, th.r { text-align: right; padding-left: 12px; white-space: nowrap; }
td.name { overflow-wrap: anywhere; }
td .x { color: var(--muted); font-size: 14px; }
.tables { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.tables h3 { font: italic 400 16px "EB Garamond", Georgia, serif; color: var(--muted); margin-bottom: 4px; }

/* Cores: one bar per core, E cores then P cores */
.cores { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 12px; align-items: end; }
.cores .tier { font-size: 14px; color: var(--muted); align-self: center; }
.cores .bars { display: flex; gap: 4px; height: 40px; align-items: flex-end; }
.cores .bars span { flex: 1; background: var(--sunk); height: 100%; border-radius: 2px; position: relative; overflow: hidden; }
.cores .bars span i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--series); transition: height .6s var(--ease); }
.cores .mhz { font-size: 14px; color: var(--muted); align-self: center; white-space: nowrap; }

.rows { display: grid; gap: 4px; }
.rows div { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.rows span:first-child { color: var(--text-2); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.list li:first-child { border-top: 0; padding-top: 0; }
.list .name { overflow-wrap: anywhere; }

@media (max-width: 960px) {
  .layout { display: flex; flex-direction: column; align-items: stretch; }
  .stack { display: contents; }
  #p-now { order: 0; } #p-heat { order: 1; } #p-mem { order: 2; } #p-disk { order: 3; } #p-power { order: 4; }
  #p-cores { order: 5; } #p-procs { order: 6; } #p-services { order: 7; } #p-machine { order: 8; }
}
@media (max-width: 560px) {
  .panel { padding: 16px; }
  .now { grid-template-columns: 64px minmax(0, 1fr); gap: 16px; }
  .orb { width: 64px; height: 64px; }
  .now h2 { font-size: 24px; }
  .quote { margin-left: 0; }
  .reading .n { font-size: 32px; }
  .readings { gap: 12px 28px; }
  .strip, .axis { grid-template-columns: 72px minmax(0, 1fr); gap: 8px; }
  .tables { grid-template-columns: 1fr; gap: 16px; }
  .range { float: none; display: inline-flex; margin: 0 0 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
