/* The Quiver — black, aged gold, amulet teal. Renaissance serif over a dark room. */

:root {
  --ink: #08080a;
  --panel: #101014;
  --panel-2: #16161d;
  --line: #262631;
  --gold: #c9a227;
  --gold-lit: #f2d383;
  --teal: #4fd4cc;
  --ember: #ff7a3d;
  --parchment: #ece7dc;
  --muted: #8b8577;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 clamp(16px, 4vw, 48px) 80px;
  background:
    radial-gradient(120% 80% at 50% 0%, #14141b 0%, var(--ink) 60%) no-repeat,
    var(--ink);
  color: var(--parchment);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

/* --- masthead ----------------------------------------------------------- */

.masthead { max-width: 1180px; margin: 0 auto; padding: 28px 0 8px; }

.masthead-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}

.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--gold); letter-spacing: 0.34em; font-size: 13px; font-weight: 600;
}
.glyph { width: 22px; height: 22px; }

.tabs { display: flex; gap: 4px; }
.tabs a {
  color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 600;
  padding: 7px 15px; border-radius: 999px; border: 1px solid transparent;
}
.tabs a:hover { color: var(--parchment); }
.tabs a.is-here {
  color: var(--gold-lit); border-color: rgba(201,162,39,.45); background: rgba(201,162,39,.09);
}

.identity { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.identity .handle { color: var(--gold-lit); font-weight: 600; }
.identity .robert-badge {
  color: var(--ink); background: linear-gradient(160deg, var(--gold-lit), var(--gold));
  border-radius: 999px; padding: 1px 9px; font-size: 11px; letter-spacing: .1em;
  font-weight: 700; text-transform: uppercase;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(46px, 9vw, 96px);
  line-height: 0.95;
  margin: 22px 0 10px;
  font-weight: 400;
  letter-spacing: -0.015em;
  background: linear-gradient(178deg, #fff6dd 8%, var(--gold-lit) 42%, #9c7c1c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline { color: var(--muted); font-size: 17px; margin: 0 0 34px; max-width: 46ch; }

/* --- hero: the quiver --------------------------------------------------- */

.hero {
  max-width: 1180px; margin: 0 auto 64px;
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(22px, 4vw, 48px); align-items: center;
  background: linear-gradient(150deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(22px, 3.4vw, 38px);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(60% 90% at 6% 40%, rgba(201,162,39,.12), transparent 70%);
  pointer-events: none;
}
.hero-copy { position: relative; }
.hero-copy h2 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.1; margin: 0 0 14px; color: #fff8e6;
}
.hero-note { color: var(--muted); font-size: 15.5px; margin: 0 0 22px; max-width: 46ch; }
.bounty-line {
  margin: 16px 0 0; font-size: 13.5px; color: var(--gold);
  padding-left: 13px; border-left: 2px solid rgba(201,162,39,.45);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--gold); text-transform: uppercase; letter-spacing: .2em;
  font-size: 11.5px; font-weight: 700; margin: 0 0 14px;
}
.pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 0 3px rgba(79,212,204,.18);
}

/* --- anatomy of a meme -------------------------------------------------- */
/* Laid out like an anatomical plate: the figure on the left, numbered parts
   beside it. He is posed as the Vitruvian Man, so the page leans into it. */

.anatomy {
  max-width: 1180px; margin: 0 auto 64px;
  display: grid; grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(24px, 4.5vw, 56px); align-items: start;
}
/* Sticky so the figure stays beside the parts it is labelling. */
.anatomy-plate { position: sticky; top: 24px; }
.anatomy-plate img {
  width: 100%; border-radius: 12px;
  border: 1px solid rgba(201,162,39,.3);
  filter: saturate(.82) contrast(1.03);
}
.plate-caption {
  position: absolute; bottom: 12px; left: 12px;
  font-family: var(--serif); font-style: italic; font-size: 13px;
  color: var(--gold-lit); background: rgba(8,8,10,.72);
  padding: 3px 11px; border-radius: 999px; letter-spacing: .04em;
}

.anatomy-lede {
  font-family: var(--serif); font-size: clamp(19px, 2.1vw, 23px); line-height: 1.42;
  color: #f3ecdd; margin: 0 0 30px; max-width: 56ch;
}

.anatomy-list { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 22px; }
.anatomy-list li {
  display: grid; grid-template-columns: 46px 1fr; column-gap: 16px; row-gap: 3px;
  padding-top: 18px; border-top: 1px solid var(--line);
}
.anatomy-list .num {
  grid-row: 1 / span 2; font-family: var(--serif); font-size: 22px;
  color: var(--gold); opacity: .78; line-height: 1.1;
}
.anatomy-list b { font-size: 16px; letter-spacing: .01em; }
.anatomy-list p { margin: 0; color: var(--muted); font-size: 14.8px; line-height: 1.55; max-width: 58ch; }

.anatomy-close {
  color: var(--parchment); font-size: 15.5px; line-height: 1.6; margin: 0;
  max-width: 58ch; padding: 18px 0 0 18px;
  border-top: 1px solid var(--line); border-left: 2px solid rgba(201,162,39,.45);
}

/* --- buttons ------------------------------------------------------------ */

.btn {
  font: inherit; font-size: 15px; font-weight: 600;
  padding: 11px 22px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--parchment);
}
.btn:hover { border-color: #3a3a48; }
.btn-primary {
  background: linear-gradient(160deg, var(--gold-lit), var(--gold));
  color: #2a1f00; border-color: transparent;
}
.btn-primary:hover { filter: brightness(1.08); }

/* --- legend ------------------------------------------------------------- */

.legend { max-width: 1180px; margin: 0 auto 52px; }
.section-title {
  font-family: var(--serif); font-weight: 400; font-size: 26px;
  margin: 0 0 6px; color: var(--parchment);
}
.section-sub { color: var(--muted); margin: 0 0 22px; max-width: 62ch; font-size: 15px; }

.legend-grid {
  display: grid; gap: 12px; margin-top: 18px;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}
.legend-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: grid; gap: 3px;
}
.legend-item b { font-size: 15px; }
.legend-item span:last-child { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.legend-emoji { font-size: 22px; line-height: 1; margin-bottom: 6px; }
.arrow-legend { border-color: rgba(201,162,39,.4); }
.arrow-legend .legend-emoji { color: var(--gold-lit); }

/* --- charts ------------------------------------------------------------- */

.charts {
  max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px;
  border-bottom: 1px solid var(--line); padding-bottom: 14px;
}
.chart-tab {
  font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
  background: none; border: 1px solid transparent; color: var(--muted);
  padding: 8px 16px; border-radius: 999px;
}
.chart-tab:hover { color: var(--parchment); }
.chart-tab.is-active {
  color: var(--gold-lit); border-color: rgba(201,162,39,.45);
  background: rgba(201,162,39,.09);
}
.chart-blurb {
  max-width: 1180px; margin: 14px auto 26px; color: var(--muted);
  font-size: 14.5px; min-height: 22px;
}

/* --- grid --------------------------------------------------------------- */

.grid {
  max-width: 1180px; margin: 0 auto 64px;
  display: grid; gap: 20px;
  /* Cards size to their own art rather than stretching to the tallest in the row. */
  align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}

.shot {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; display: flex; flex-direction: column;
  position: relative;
}
.shot.has-arrow { border-color: rgba(201,162,39,.55); box-shadow: 0 0 0 1px rgba(201,162,39,.14); }

.shot-img { background: #000; }
.shot-img img { width: 100%; }

.shot-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.shot-title { font-size: 15px; line-height: 1.35; margin: 0; }
.shot-meta { color: var(--muted); font-size: 13px; margin: 0; }
.shot-meta .by { color: #b3ac9b; }

.arrow-seal {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(160deg, var(--gold-lit), var(--gold));
  color: #2a1f00; font-size: 11px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0,0,0,.5);
}

.reactions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: auto; }
.react {
  font: inherit; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--parchment);
  border-radius: 999px; padding: 5px 12px; line-height: 1;
}
.react:hover { border-color: #3d3d4a; }
.react .count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.react.on { background: rgba(201,162,39,.14); border-color: rgba(201,162,39,.5); }
.react.on .count { color: var(--gold-lit); }
.react.on[data-kind="eye"] { background: rgba(79,212,204,.13); border-color: rgba(79,212,204,.5); }
.react.on[data-kind="eye"] .count { color: var(--teal); }
.react.on[data-kind="fire"] { background: rgba(255,122,61,.13); border-color: rgba(255,122,61,.5); }
.react.on[data-kind="fire"] .count { color: var(--ember); }

.shot-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.linkish {
  font: inherit; font-size: 13px; background: none; border: none; cursor: pointer;
  color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 0;
}
.linkish:hover { color: var(--gold-lit); }
.linkish.arrow-btn { color: var(--gold); }

.empty {
  grid-column: 1 / -1; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 14px; padding: 56px 24px;
}

/* --- the sources (inside the hero) -------------------------------------- */

.sources {
  position: relative;
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
}
.source {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; display: flex; flex-direction: column;
}
.source img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.source-body { padding: 12px 14px; display: grid; gap: 4px; }
.source-body b { font-size: 14.5px; }
.source-body span { color: var(--muted); font-size: 13px; }
.source-links { display: flex; gap: 12px; padding: 0 14px 13px; }

.footer {
  max-width: 1180px; margin: 0 auto; padding-top: 26px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 14px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.footer p { margin: 0; }
/* Deliberately unremarkable — the only door that needs a key. */
.footer-staff .linkish { opacity: .45; text-decoration: none; }
.footer-staff .linkish:hover { opacity: 1; }

/* --- dialogs ------------------------------------------------------------ */

.dialog {
  border: 1px solid var(--line); border-radius: 16px; padding: 0;
  background: var(--panel); color: var(--parchment);
  width: min(460px, calc(100vw - 32px));
}
.dialog::backdrop { background: rgba(0,0,0,.72); }
.dialog-inner { padding: 26px 26px 22px; display: grid; gap: 15px; }
.dialog h3 { font-family: var(--serif); font-weight: 400; font-size: 25px; margin: 0; }
.dialog-sub { color: var(--muted); font-size: 14px; margin: -6px 0 0; }
.field { display: grid; gap: 6px; font-size: 14px; }
.field > span { color: var(--muted); }
.field em { font-style: normal; opacity: .65; }
.field input, .field select {
  font: inherit; font-size: 15px; padding: 10px 12px; border-radius: 8px;
  background: var(--ink); border: 1px solid var(--line); color: var(--parchment);
}
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.dialog-error { color: #ff8f7a; font-size: 14px; margin: 0; }

@media (max-width: 900px) {
  .hero, .anatomy { grid-template-columns: 1fr; }
  .anatomy-plate { max-width: 420px; }
}

/* --- the philosophy essay ------------------------------------------------ */
/* A reading page, not an app screen: narrow measure, serif body, generous
   leading. Everything here is scoped to body.reading so the board is untouched. */

.reading { padding-bottom: 40px; }

.essay { max-width: 1180px; margin: 0 auto; }

.essay-head { max-width: 40rem; margin: 10px 0 52px; }
.essay-head h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(42px, 7.5vw, 78px); line-height: 0.98; margin: 18px 0 22px;
  letter-spacing: -0.015em;
  background: linear-gradient(178deg, #fff6dd 8%, var(--gold-lit) 45%, #9c7c1c 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.essay-lede {
  font-family: var(--serif); font-size: clamp(19px, 2.2vw, 24px); line-height: 1.45;
  color: #f3ecdd; margin: 0;
}

/* Contents sits beside the text on wide screens and above it on narrow ones. */
.contents {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 22px 0; margin-bottom: 56px;
}
.contents-label {
  color: var(--gold); text-transform: uppercase; letter-spacing: .2em;
  font-size: 11px; font-weight: 700; margin: 0 0 14px;
}
.contents ol {
  margin: 0; padding: 0; list-style: none; counter-reset: toc;
  columns: 2; column-gap: 40px;
}
.contents li { counter-increment: toc; margin-bottom: 7px; break-inside: avoid; }
.contents a {
  color: var(--muted); text-decoration: none; font-size: 14.5px;
  display: inline-flex; gap: 10px;
}
.contents a::before {
  content: counter(toc, upper-roman) '.';
  color: var(--gold); opacity: .7; min-width: 2.2em; font-family: var(--serif);
}
.contents a:hover { color: var(--gold-lit); }

.essay section {
  max-width: 40rem;
  margin: 0 0 60px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}
.essay .num {
  font-family: var(--serif); font-size: 34px; line-height: 1;
  color: var(--gold); opacity: .55; margin: 0 0 10px;
}
.essay h2 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(27px, 3.6vw, 37px);
  line-height: 1.14; margin: 0 0 22px; color: #fff8e6;
}
.essay h3 {
  font-family: var(--sans); font-size: 15px; font-weight: 700; margin: 0 0 5px;
  color: var(--gold-lit); letter-spacing: .01em;
}
.essay p {
  font-family: var(--serif); font-size: 19.5px; line-height: 1.62;
  color: #ddd6c8; margin: 0 0 20px;
}
.essay p em { color: #fff8e6; font-style: italic; }
.essay cite { font-style: italic; color: #fff8e6; }

/* First line of the argument, set larger so each section has a way in. */
.essay .opener { font-size: 23px; line-height: 1.44; color: #fff8e6; }

.pull {
  margin: 34px 0; padding: 4px 0 4px 26px;
  border-left: 2px solid var(--gold);
}
.pull p {
  font-size: clamp(22px, 2.8vw, 28px); line-height: 1.32; font-style: italic;
  color: #fff8e6; margin: 0;
}

.properties { margin: 28px 0 30px; display: grid; gap: 18px; }
.properties dt {
  font-family: var(--sans); font-size: 14px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--gold-lit); margin-bottom: 5px;
}
.properties dd {
  margin: 0; font-family: var(--serif); font-size: 18px; line-height: 1.55; color: var(--muted);
}

.charts-explainer {
  display: grid; gap: 14px; margin: 30px 0;
}
.charts-explainer > div {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 17px 19px;
}
.charts-explainer p {
  font-size: 16.5px; line-height: 1.5; color: var(--muted); margin: 0;
}

.axis-table {
  width: 100%; border-collapse: collapse; margin: 26px 0 28px;
  font-family: var(--sans); font-size: 15px;
}
.axis-table th, .axis-table td {
  text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line);
}
.axis-table th {
  color: var(--gold); font-size: 12px; text-transform: uppercase; letter-spacing: .12em;
}
.axis-table td:not(:first-child), .axis-table th:not(:first-child) {
  text-align: center; width: 68px; font-variant-numeric: tabular-nums;
}
.axis-table tbody tr:last-child td { border-bottom: none; }
.react-inline { font-size: 19px; vertical-align: -2px; }

.closing { margin-top: 36px; }
.closing a {
  font-family: var(--sans); font-size: 16px; font-weight: 600;
  color: var(--gold-lit); text-decoration: none;
  border-bottom: 1px solid rgba(201,162,39,.5); padding-bottom: 2px;
}
.closing a:hover { color: #fff8e6; }

@media (min-width: 1000px) {
  /* Roman numeral moves into the left margin so the text column stays clean. */
  .essay section { padding-left: 92px; max-width: calc(40rem + 92px); position: relative; }
  .essay .num { position: absolute; left: 0; top: 34px; margin: 0; }
}

@media (max-width: 640px) {
  .contents ol { columns: 1; }
}

.anatomy-more { margin: 24px 0 0; }
.anatomy-more a {
  font-size: 15px; font-weight: 600; color: var(--gold-lit); text-decoration: none;
  border-bottom: 1px solid rgba(201,162,39,.45); padding-bottom: 2px;
}
.anatomy-more a:hover { color: #fff8e6; }

/* The essay is a reading column, so it centres rather than hugging the left edge
   the way the board's full-width grid does. The 92px is the numeral gutter, so the
   masthead, contents and body text all align to the same left edge. */
.essay { max-width: calc(40rem + 92px); }
@media (min-width: 1000px) {
  .essay-head, .contents { padding-left: 92px; }
  .essay-head { max-width: none; }
}
.reading .masthead { max-width: calc(40rem + 92px); }
.reading .footer { max-width: calc(40rem + 92px); }
@media (min-width: 1000px) {
  .reading .masthead-bar, .reading .footer { padding-left: 92px; }
}
