/* Vibecamp Survey Stats — matches vibe.camp's warm storybook look */

/* Vibecamp's own faces, if the files are present in /fonts (see fonts/README.txt).
   Until then the Google-Fonts fallbacks below carry the look. */
@font-face { font-family: "Bugaki";     src: url("fonts/Bugaki.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Recoleta";   src: url("fonts/Recoleta-RegularDEMO.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("fonts/Metropolis-Regular.otf") format("opentype"); font-display: swap; }

:root {
  color-scheme: light;
  /* brand plane (from vibe.camp) */
  --plane: #f6f0ea;
  --surface: #fffdf9;          /* card / chart surface */
  --ink: #141311;
  --ink-2: #52514e;
  --ink-muted: #898781;
  --grid: #ece7df;
  --baseline: #d8d2c8;
  --hairline: rgba(20,19,17,.08);
  --highlight: #f9ecb5;        /* the vibe.camp yellow-marker wash */

  /* validated categorical slots (dataviz method; relief via labels + tables) */
  --s1: #2a78d6;  /* blue */
  --s2: #eb6834;  /* orange */
  --s3: #1baf7a;  /* aqua */
  --s4: #eda100;  /* yellow */

  /* per-event accents (identity on cards & single-series panels) */
  --vc1: #c98500; --vc2: #2a78d6; --vibeclipse: #d55181;
  --vc3: #199e70; --vc4: #6250d6; --vc5: #d95926;

  --radius: 22px;
  --font-display: "Recoleta", "Fraunces", Georgia, serif;
  --font-caps: "Bugaki", "Marcellus", Georgia, serif;
  --font-body: "Metropolis", "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--plane);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: rgba(20,19,17,.35); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
strong { font-weight: 500; }

/* ---------- header / footer ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 44px);
}
.wordmark {
  font-family: var(--font-caps);
  text-transform: uppercase; letter-spacing: .14em;
  font-size: 19px; text-decoration: none;
}
.site-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-nav a {
  font-size: 13px; letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; color: var(--ink-2);
}
.site-nav a:hover { color: var(--ink); }

main {
  max-width: 1060px; margin: 0 auto;
  padding: 6px clamp(14px, 3vw, 28px) 40px;
  display: grid; gap: 26px; grid-template-columns: minmax(0, 1fr);
}
.card { min-width: 0; }
.site-footer { text-align: center; padding: 10px 16px 44px; color: var(--ink-2); font-size: 14px; }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: clamp(26px, 4.5vw, 52px);
  box-shadow: 0 1px 2px rgba(20,19,17,.04), 0 10px 32px -18px rgba(20,19,17,.14);
  position: relative;
}

/* ---------- type ---------- */
.kicker {
  font-size: 12.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-muted); margin: 0 0 10px;
}
h1 {
  font-family: var(--font-caps);
  text-transform: uppercase; letter-spacing: .06em;
  font-weight: 400; font-size: clamp(30px, 5.4vw, 54px);
  line-height: 1.12; margin: 0 0 14px;
}
h2.display {
  font-family: var(--font-display);
  font-weight: 400; font-size: clamp(25px, 3.6vw, 36px);
  line-height: 1.18; margin: 0 0 10px;
}
.hl { background: linear-gradient(transparent 58%, var(--highlight) 58%); }
.lede { max-width: 640px; font-size: 18px; margin: 0 0 30px; color: var(--ink-2); }
.section-sub { max-width: 680px; color: var(--ink-2); margin: 0 0 26px; }
.section-sub a { color: inherit; }

/* ---------- hero event cards ---------- */
.event-cards {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(235px, 100%), 1fr));
}
.event-card {
  border: 1.5px solid var(--hairline);
  border-top: 4px solid var(--ev, var(--ink));
  border-radius: 16px; padding: 16px 16px 14px;
  background: #fff;
  display: flex; flex-direction: column; gap: 3px;
}
.event-card .ev-name { font-family: var(--font-display); font-size: 19px; line-height: 1.2; }
.event-card .ev-where { font-size: 12px; color: var(--ink-muted); min-height: 2.6em; }
.event-card .ev-score {
  font-family: var(--font-body); font-weight: 600; font-size: 26px; line-height: 1.1;
  display: flex; align-items: baseline; gap: 7px;
}
.event-card .ev-score small { font-weight: 400; font-size: 12px; color: var(--ink-muted); }
.event-card .ev-stars { height: 16px; margin: 2px 0 1px; }
.event-card .ev-n { font-size: 12px; color: var(--ink-2); }
.badge {
  display: inline-block; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  background: var(--highlight); border-radius: 99px; padding: 2px 8px;
  color: var(--ink); margin-top: 6px; width: fit-content; font-weight: 500;
}
.badge.plain { background: #f0ebe3; }

/* ---------- takeaways ---------- */
.takeaways { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 760px; }
.takeaways li { padding-left: 30px; position: relative; font-size: 17.5px; }
.takeaways li::before { content: "✦"; position: absolute; left: 2px; top: 1px; color: var(--vc5); }
.takeaways .num { font-weight: 600; }

/* ---------- controls ---------- */
.controls {
  display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap;
  margin: 0 0 8px;
}
.control { display: grid; gap: 5px; }
.control label {
  font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted);
}
.control select {
  font: inherit; font-size: 14.5px; font-weight: 400;
  padding: 8px 34px 8px 12px; border-radius: 10px;
  border: 1.5px solid var(--baseline); background: #fff; color: var(--ink);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2352514e' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.control-note { font-size: 13px; color: var(--ink-muted); margin: 0 0 2px; flex-basis: 100%; }

/* ---------- legend ---------- */
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0 4px; }
.legend .key { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); }
.legend .swatch { width: 14px; height: 14px; border-radius: 5px; display: inline-block; }
.legend .swatch.line { height: 3px; border-radius: 2px; width: 18px; }

/* ---------- chart grids ---------- */
.chart-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr));
  margin-top: 14px;
}
.panel {
  border: 1.5px solid var(--hairline); border-radius: 16px;
  padding: 16px 14px 10px; background: #fff;
}
.panel h3 {
  margin: 0 0 2px; font-family: var(--font-body); font-weight: 500; font-size: 15.5px;
}
.panel .q { font-size: 12px; color: var(--ink-muted); margin: 0 0 10px; line-height: 1.45; min-height: 2.4em; }
.panel svg { display: block; width: 100%; height: auto; overflow: visible; }

.dist-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr));
}
.demo-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }

/* ---------- tables ---------- */
.table-view { margin-top: 22px; }
.table-view summary {
  cursor: pointer; font-size: 14px; color: var(--ink-2); width: fit-content;
  padding: 6px 2px;
}
.table-view { overflow-x: auto; }
.table-view table {
  border-collapse: collapse; width: 100%; font-size: 13.5px; margin-top: 10px;
}
.table-view th, .table-view td {
  text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--grid);
  font-variant-numeric: tabular-nums;
}
.table-view th:first-child, .table-view td:first-child { text-align: left; }
.table-view th { font-weight: 500; color: var(--ink-2); }
.table-view .tbl-caption { font-size: 13px; color: var(--ink-muted); margin: 16px 0 0; }

/* ---------- structure stat ---------- */
.stat-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); margin-bottom: 20px; }
.stat-tile { border: 1.5px solid var(--hairline); border-radius: 16px; padding: 18px; background:#fff; }
.stat-tile .label { font-size: 13px; color: var(--ink-2); }
.stat-tile .value { font-weight: 600; font-size: 38px; line-height: 1.15; }
.stat-tile .sub { font-size: 12.5px; color: var(--ink-muted); }

/* ---------- themes ---------- */
.toggle-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.toggle-btn {
  font: inherit; font-size: 14px; font-weight: 400;
  border: 1.5px solid var(--baseline); background: #fff; color: var(--ink-2);
  border-radius: 99px; padding: 8px 18px; cursor: pointer;
}
.toggle-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.thread {
  border: 1.5px solid var(--hairline); border-radius: 18px; background: #fff;
  padding: 22px 22px 8px; margin-bottom: 16px;
}
.thread h3 {
  font-family: var(--font-display); font-weight: 400; font-size: 23px; margin: 0 0 6px;
}
.thread .blurb { color: var(--ink-2); margin: 0 0 16px; max-width: 700px; }
.thread-entry {
  display: grid; grid-template-columns: 92px 1fr; gap: 14px;
  padding: 13px 0; border-top: 1px solid var(--grid);
}
.thread-entry .chip {
  font-size: 12px; font-weight: 500; letter-spacing: .04em;
  color: var(--ev); white-space: nowrap; padding-top: 2px;
}
.thread-entry .t-title { font-weight: 500; font-size: 15.5px; }
.thread-entry .t-sum { font-size: 14.5px; color: var(--ink-2); margin-top: 2px; }

.thread-response {
  margin: 14px 0 12px; padding: 12px 16px; border-radius: 12px;
  background: var(--highlight); font-size: 14.5px;
}
.thread-response .tag {
  display: inline-block; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 600; margin-right: 10px; color: var(--ink-2);
}

.event-block { margin-bottom: 34px; }
.event-block > h3 {
  font-family: var(--font-display); font-weight: 400; font-size: 24px; margin: 0;
  border-left: 5px solid var(--ev); padding-left: 14px;
}
.event-block > .ev-sub { color: var(--ink-muted); font-size: 13.5px; margin: 2px 0 16px; padding-left: 19px; }
.theme-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.theme-card {
  border: 1.5px solid var(--hairline); border-left: 4px solid var(--good, var(--s3));
  border-radius: 14px; background: #fff; padding: 16px 18px;
}
.theme-card.crit { --good: var(--s2); }
.theme-card h4 { margin: 0 0 6px; font-size: 16px; font-weight: 500; }
.theme-card h4 .mark { margin-right: 6px; }
.theme-card .t-sum { font-size: 14.5px; color: var(--ink-2); margin: 0 0 10px; }
.theme-card .note {
  font-size: 13.5px; background: #faf6f0; border-radius: 10px;
  padding: 9px 12px; margin-top: 8px; color: var(--ink-2);
}
.show-more {
  font: inherit; font-size: 13.5px; background: none; border: none; cursor: pointer;
  color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px;
  padding: 10px 0 0;
}

/* ---------- methodology ---------- */
.method-body { max-width: 740px; display: grid; gap: 14px; }
.method-body p { margin: 0; }

/* ---------- tooltip ---------- */
.tooltip {
  position: fixed; pointer-events: none; z-index: 50;
  background: var(--ink); color: #fdfcf9;
  font-size: 12.5px; line-height: 1.45; font-weight: 400;
  border-radius: 10px; padding: 8px 11px; max-width: 240px;
  opacity: 0; transform: translateY(3px); transition: opacity .12s;
}
.tooltip.show { opacity: 1; }
.tooltip .tt-head { font-weight: 500; }
.tooltip .tt-muted { color: #c9c5bb; }

/* ---------- svg chart text ---------- */
svg text {
  font-family: var(--font-body);
  fill: var(--ink-2);
}
svg .axis-label { font-size: 11px; fill: var(--ink-muted); }
svg .val-label { font-size: 11.5px; font-weight: 500; fill: var(--ink); }
svg .bar-label { font-size: 11px; fill: var(--ink-2); }

@media (max-width: 560px) {
  .site-header { flex-direction: column; gap: 10px; }
  .thread-entry { grid-template-columns: 1fr; gap: 3px; }
}
