/* The avatar home page (home/index.html). Calm, readable, in the avatar's own colour (--accent, set from the record). */
:root {
  --accent: #2a7768;
  --accent-soft: color-mix(in srgb, var(--accent) 13%, #fff); --accent-ink: color-mix(in srgb, var(--accent) 78%, #000);
  --ink: #1f2a28; --muted: #5d6b67; --faint: #8a9692; --paper: #f7f5ef; --card: #fffefb; --line: #e3e0d6; --line-strong: #cfcabd;
  --pass: #1f7a4d; --pass-soft: #e2f3e9; --fail: #a8322a; --fail-soft: #f8e4e1; --warn: #9a6a12; --warn-soft: #f8eed8;
  --radius: 12px; --shadow: 0 1px 2px rgba(31, 42, 40, .05), 0 4px 18px rgba(31, 42, 40, .05);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--paper); }
a { color: var(--accent-ink); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 19px; margin: 0; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(247, 245, 239, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line);
       box-shadow: inset 0 3px 0 var(--accent); }
.top-row { display: flex; align-items: center; gap: 18px; min-height: 58px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; line-height: 1.15; }
.eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.title { font: 600 18px Georgia, serif; }
.switch { display: flex; gap: 6px; margin-left: auto; }
.switch a { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--ink); padding: 6px 12px; border-radius: 999px;
            border: 1px solid var(--line-strong); font-weight: 600; font-size: 14px; background: var(--card); }
.switch a .swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.switch a[aria-current=page] { background: var(--c); border-color: var(--c); color: #fff; }
.switch a[aria-current=page] .swatch { background: #fff; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 150px; justify-content: flex-end; }
.live .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.live[data-state=live] .dot { background: var(--pass); animation: pulse 2s ease-out infinite; }
.live[data-state=down] .dot { background: var(--fail); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31, 122, 77, .45); } 70% { box-shadow: 0 0 0 7px rgba(31, 122, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 122, 77, 0); } }

main { padding-top: 22px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 13px; }

/* who */
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; }
.who { display: flex; gap: 20px; align-items: flex-start; border-top: 4px solid var(--accent); }
.portrait { width: 132px; height: 132px; border-radius: 14px; object-fit: cover; background: var(--accent-soft); flex: 0 0 auto; border: 1px solid var(--line); }
.who-text { min-width: 0; flex: 1; }
.who h1 { font-size: 34px; margin: 0; line-height: 1.1; color: var(--accent-ink); }
.sub { margin: 4px 0 12px; color: var(--muted); }
.facts { display: flex; gap: 26px; margin: 0 0 12px; flex-wrap: wrap; }
.facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.address { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.address .label { color: var(--muted); }
.address a { font-family: var(--mono); font-size: 12.5px; }
.rev { display: inline-block; font: 650 12px var(--mono); padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap; }
.rev.big { font-size: 15px; padding: 2px 10px; }
.rev.old { background: #efede6; color: var(--muted); }

/* signature */
.sig { display: flex; flex-direction: column; gap: 6px; }
.verdict { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.verdict .mark { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #ecebe5; color: var(--muted); font-weight: 800; font-size: 20px; }
.verdict .mark::before { content: "…"; }
.verdict-word { font: 700 26px Georgia, serif; letter-spacing: .01em; }
.sig[data-verdict=pass] .mark { background: var(--pass); color: #fff; }
.sig[data-verdict=pass] .mark::before { content: "✓"; }
.sig[data-verdict=pass] .verdict-word { color: var(--pass); }
.sig[data-verdict=fail] .mark { background: var(--fail); color: #fff; }
.sig[data-verdict=fail] .mark::before { content: "✕"; }
.sig[data-verdict=fail] .verdict-word { color: var(--fail); }
.sig[data-verdict=pass] { border-top: 4px solid var(--pass); }
.sig[data-verdict=fail] { border-top: 4px solid var(--fail); background: linear-gradient(var(--fail-soft), var(--card) 120px); }
.verdict-why { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 14px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv code, .mono { font-family: var(--mono); font-size: 12.5px; }
.kv.wide { grid-template-columns: max-content minmax(0, 1fr); }

/* carried items */
.carry { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.carry li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fcfbf7; }
.carry img { width: 52px; height: 52px; object-fit: contain; flex: 0 0 auto; }
.carry strong { display: block; font-size: 15px; }
.carry .slot { font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); font-style: italic; }

/* rights */
.rights { display: flex; flex-direction: column; gap: 10px; }
.right-row { display: grid; grid-template-columns: minmax(170px, 1.1fr) minmax(150px, 1fr) minmax(180px, 1.2fr) minmax(200px, 1.5fr); gap: 14px; align-items: start;
             padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.right-row .item { display: flex; align-items: center; gap: 10px; }
.right-row .item img { width: 36px; height: 36px; object-fit: contain; }
.right-row .label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-strong);
        background: #fff; white-space: nowrap; }
.chip.yes { background: var(--pass-soft); border-color: #b9dcc7; color: #175c3a; }
.chip.no { background: #f2f0ea; border-color: var(--line); color: var(--faint); text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .25); }
.chip.warn { background: var(--warn-soft); border-color: #e6d1a6; color: var(--warn); }
.chip.bad { background: var(--fail-soft); border-color: #e8bdb7; color: var(--fail); }
.chip .w { width: 8px; height: 8px; border-radius: 50%; background: var(--wc, var(--faint)); }
.small { font-size: 12.5px; color: var(--muted); margin-top: 5px; overflow-wrap: anywhere; }

/* two columns: revisions and reads */
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 16px 42px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 9px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 2px solid var(--line-strong); }
.timeline li.current::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.rev-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rev-head time { color: var(--muted); font-size: 13px; }
.rev-head .now { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); }
.change { margin: 4px 0 4px; font-size: 14px; }
.change .add { color: #175c3a; font-weight: 600; }
.change .rem { color: var(--fail); font-weight: 600; }
.icons { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.icons img { width: 26px; height: 26px; object-fit: contain; background: #f6f4ee; border-radius: 6px; padding: 2px; }
.rev-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.rev-meta a { font-weight: 600; }
.readby { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.fresh { animation: fresh 2.4s ease-out; border-radius: 8px; }
@keyframes fresh { 0% { background: var(--accent-soft); } 100% { background: transparent; } }

.worlds { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.world { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; border-left: 4px solid var(--wc, var(--faint)); background: #fcfbf7; min-width: 0; }
.world strong { display: block; font-size: 13.5px; }
.world .state { font-size: 12.5px; color: var(--muted); }
.world.behind .state { color: var(--warn); font-weight: 600; }
.world.none { opacity: .7; }
.reads { list-style: none; margin: 0; padding: 0; }
.reads li { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.reads li:last-child { border-bottom: 0; }
.reads time { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.reads .reader { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.reads .file { color: var(--muted); font-size: 12.5px; }
.reads .hash { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.more { margin-top: 10px; font: inherit; font-size: 13px; font-weight: 600; background: none; border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 12px; cursor: pointer; color: var(--ink); }
.more:hover { background: #f2f0ea; }

.raw summary { cursor: pointer; font-weight: 600; color: var(--accent-ink); margin-top: 12px; }
.raw pre { margin: 10px 0 0; max-height: 420px; overflow: auto; background: #f6f4ee; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font: 12px/1.45 var(--mono); }
.foot { color: var(--faint); font-size: 12.5px; text-align: center; margin: 4px 0 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

@media (max-width: 980px) {
  .hero, .two { grid-template-columns: minmax(0, 1fr); }
  .right-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .wrap { padding: 0 14px; }
  .who { flex-direction: column; }
  .right-row { grid-template-columns: minmax(0, 1fr); }
  .live { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .live[data-state=live] .dot, .fresh { animation: none; } }
