/* ─────────────────────────────────────────────────────────────────────────────
   home/research.css
   THE RESEARCH PALETTE. One source, for every gold surface.

   Sits beside home/home.css (the person's town chrome) and home/org.css (the
   org's blue twin). Consumers live in grange/research/ and research/, the same
   way gate/ pages consume org.css. The palette file lives with its siblings,
   not with its callers.

   WHY IT EXISTS: three research pages carried three different golds. Panel was
   on #C67B3E, the SITE copper, with a flat green field, so it was not gold at
   all. Join was on #D09233, a value used nowhere else. Commons had the right
   accent and the wrong text, white and translucent white instead of the warm
   neutrals every other surface uses. lab-index is the sole colour holder and
   these values are its values.

   ── THE PALETTE'S THREE JOBS ──────────────────────────────────────────────
   gold             research identity: accents, borders, active states
   violet           authored instruments (surveys), never the room itself
   warm neutrals    information hierarchy: title, body, metadata

   Do NOT paint a survey-authoring page gold merely because surveys live under
   research. Gold is the research LIFECYCLE (what are we doing); violet is the
   authored INSTRUMENT (how are we asking). The moment those two blur, a person
   can no longer tell a study from the questionnaire inside it.

   ── WHY THE FIELD STOPS SHORT OF GOLD ─────────────────────────────────────
   The field runs near-black to a deep gold-brown, NOT to #D9A828. Measured
   against full gold, cream text scores 1.73 to 1 and body text 1.25, against a
   4.5 threshold; even pure white only reaches 2.19. Nothing light is readable
   down there, which is why one page tried white text and still failed. Against
   --research-bg-end, cream is 7.15 and body 5.17.
   THE FIELD WAS WARMED 2026-08-07 (#4A3A12 -> #5A4614) because the rooms read
   brown rather than gold. This is the GOLDEST the field can go: the next step
   toward gold (#6B5417) drops body text to 4.13 and fails AA, and full gold
   (#D9A828) puts cream at 1.73 and body at 1.25, which is unreadable. Do not
   push it further without changing the text colours too.

   lab-index runs to full gold and gets away with it because its bright end sits
   under the footer. Any page with content at the bottom cannot. Gold stays the
   room's identity; it does not become the surface text has to survive on.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  /* ── The source of truth. Name these when writing new rules. ── */
  --research-gold:        #D9A828;   /* identity, accents, active states */
  --research-gold-rgb:    217,168,40;
  --research-bg-start:    #120F0A;   /* the field, top */
  --research-bg-end:      #5A4614;   /* the field, bottom. NOT full gold. */
  --research-shell:       #1D1C0F;   /* header and footer bars */

  --research-head:        #ECE4D3;   /* titles */
  --research-body:        #CBC3B2;   /* running text */
  --research-muted:       #B9AE95;   /* metadata, timestamps, status labels.
                                        WARM. The old #8B9298 was a cool system
                                        chrome grey, the only cool token on a
                                        warm page, and it scored 1.44 on the
                                        field's bright end. */

  --research-rule:        rgba(236,228,211,0.12);
  --research-rule-strong: rgba(236,228,211,0.22);

  --research-violet:      #9E77E0;   /* authored instruments only */

  /* ── Aliases. ──────────────────────────────────────────────────────────
     The pages already reference --copper, --head, --body, --muted, --rule,
     --rule-hard and --shell in hundreds of rules. Renaming those references
     would be a rewrite of four files to change three colours. So the site's
     existing names point at the values above: a page links this file, deletes
     its own :root, and every rule it already has keeps working.
     New rules should prefer the --research-* names, which say what they mean. */
  --copper:      var(--research-gold);
  --copper-rgb:  var(--research-gold-rgb);
  --shell:       var(--research-shell);
  --head:        var(--research-head);
  --body:        var(--research-body);
  --muted:       var(--research-muted);
  --rule:        var(--research-rule);
  --rule-hard:   var(--research-rule-strong);
  --violet:      var(--research-violet);

  /* Kept because two pages build the field from these two names directly. */
  --field-start: var(--research-bg-start);
  --field-end:   var(--research-bg-end);
}

/* ── The field ───────────────────────────────────────────────────────────
   Owned here so all three pages share one background. A converting page
   deletes its own body background declaration; leaving both in place makes
   the page's copy win and reintroduces the drift this file removes. */
body {
  /* THE FIELD ENDS AT THE FOOTER, not at the bottom of the document. The gradient
     used to run the full body height, so the last stretch of it was painted
     underneath the footer's own solid bar and the gold end was never actually
     seen: every page read as start-colour with a brown drift. Ending the ramp
     one footer-height early means the bottom of the READABLE page is the bottom
     of the gradient. --footer-h is the room a page's footer takes; a page with a
     taller or shorter footer sets its own. */
  background: linear-gradient(180deg,
    var(--research-bg-start) 0,
    var(--research-bg-end) calc(100% - var(--footer-h, 12rem)));
  background-repeat: no-repeat;
  color: var(--research-body);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 300;
  line-height: 1.7;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── Source chips: how a study or survey can be found ─────────────────
   Public is the open square, listed on the board, teal. Private is the enclosed
   square with one entrance, PIN roster only, org blue. The mark is DERIVED from
   the study's listing state, never a second stored field. Glyphs live here as
   backgrounds so a call site is one span. Blue matches home/org.css. */
.source-chip{
  display:inline-flex; align-items:center; gap:0.4rem;
  font-family:'DM Mono',monospace; font-size:0.72rem; letter-spacing:0.04em;
  border-radius:999px; padding:0.18rem 0.55rem 0.18rem 0.5rem; white-space:nowrap;
}
.source-chip::before{
  content:''; width:0.95rem; height:0.95rem; flex:none;
  background-repeat:no-repeat; background-position:center; background-size:contain;
}
.source-chip.source-public{ background:#37BE93; color:#08402E; }
.source-chip.source-public::before{ background-image:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%2308402E'%20stroke-width='1.6'%20stroke-linecap='round'%3E%3Crect%20x='4'%20y='4'%20width='16'%20height='16'%20rx='1.5'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='3'/%3E%3Cline%20x1='4'%20y1='4'%20x2='9.88'%20y2='9.88'/%3E%3Cline%20x1='20'%20y1='4'%20x2='14.12'%20y2='9.88'/%3E%3Cline%20x1='4'%20y1='20'%20x2='9.88'%20y2='14.12'/%3E%3Cline%20x1='20'%20y1='20'%20x2='14.12'%20y2='14.12'/%3E%3C/svg%3E"); }
.source-chip.source-private{ background:#45A8FF; color:#0C1E34; }
.source-chip.source-private::before{ background-image:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%230C1E34'%20stroke-width='1.6'%20stroke-linecap='round'%3E%3Cpath%20d='M4%2020%20V4%20H20%20V20'/%3E%3Cline%20x1='4'%20y1='20'%20x2='9'%20y2='20'/%3E%3Cline%20x1='15'%20y1='20'%20x2='20'%20y2='20'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='3'/%3E%3C/svg%3E"); }
