/* ==========================================================================
   HOODO — Giving Dashboard
   Light, friendly, cartoon-storybook. Palette still sampled from the
   hoodo.site attic artwork, but built on the warm floor/parchment tones
   rather than the dark wall shadow.
   ========================================================================== */

:root {
  /* --- Brand palette (from the artwork) --- */
  --lime:       #CCF444;   /* the cat                    */
  --lime-deep:  #B4DE2E;
  --green:      #55A240;   /* Robin Hood hat             */
  --red:        #E06E63;   /* the rug                    */
  --parchment:  #E9CA9B;   /* the floor                  */

  /* --- Light surfaces --- */
  --bg:         #F7EEDC;   /* warm paper                 */
  --card:       #FFFFFF;
  --card-warm:  #FDF7EA;
  --ink:        #1C0F09;   /* text + cartoon outlines    */
  --muted:      #7C6A55;

  /* --- Shape --- */
  --radius:     16px;
  --radius-sm:  10px;
  --bw:         3px;
  --shadow:     4px 4px 0 var(--ink);
  --shadow-sm:  3px 3px 0 var(--ink);

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;
  --font-marker:  "Permanent Marker", var(--font-display), cursive;

  --wrap: 1080px;
}

/* --------------------------------------------------------------- reset -- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.08; margin: 0; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92em;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 22px; }
.muted { color: var(--muted); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--lime); color: var(--ink); padding: 12px 18px; font-weight: 700;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

/* -------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-display); font-weight: 800; font-size: .9rem;
  padding: 9px 17px;
  border: var(--bw) solid var(--ink);
  border-radius: 100px;
  text-decoration: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
  white-space: nowrap;
}
.btn-lime  { background: var(--lime); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-ghost { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-sm    { padding: 6px 13px; font-size: .82rem; }
.btn:hover  { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(1px, 1px);  box-shadow: 1px 1px 0 var(--ink); }
.btn-lime:hover { background: var(--lime-deep); }

/* ---------------------------------------------------------- demo banner -- */
.demo-banner {
  background: var(--red); color: #2B0B08;
  border-bottom: var(--bw) solid var(--ink);
  padding: 11px 20px; text-align: center; font-size: .9rem;
}
.demo-banner code { background: rgba(28,15,9,.16); padding: 1px 6px; border-radius: 5px; }

/* --------------------------------------------------------------- header -- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247, 238, 220, .93);
  backdrop-filter: blur(10px);
  border-bottom: var(--bw) solid var(--ink);
}
.header-inner { display: flex; align-items: center; gap: 20px; padding-block: 13px; }

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; margin-right: auto; }
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; flex: none;
  background: var(--lime);
  border: var(--bw) solid var(--ink);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
  transform: rotate(-4deg);
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.28rem; }
.brand-tag  { font-family: var(--font-marker); font-size: .7rem; color: var(--green); margin-top: 4px; }

.site-nav { display: flex; gap: 24px; }
.site-nav a {
  text-decoration: none; font-weight: 600; font-size: .93rem;
  padding-block: 3px; border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--ink); }

.header-actions { display: flex; gap: 9px; }

/* ----------------------------------------------------------------- hero -- */
.hero { padding-block: 56px 40px; }

.hero h1 { font-size: clamp(2.3rem, 5vw, 3.5rem); letter-spacing: -.025em; }
.hl {
  /* marker underline, like the hand-drawn signs in the artwork */
  background: linear-gradient(transparent 62%, var(--lime) 62%);
  padding-inline: 2px;
}
.lede { margin-top: 18px; font-size: 1.1rem; color: var(--muted); max-width: 40ch; }

/* ---------------------------------------------------------------- stats -- */
.stats-band { padding-block: 8px 40px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat {
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  text-align: center;
}
.stat:nth-child(1) { background: var(--lime); }
.stat-value { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.8rem, 3.4vw, 2.4rem); line-height: 1; letter-spacing: -.02em; }
.stat-label { font-size: .8rem; color: var(--muted); margin-top: 9px; font-weight: 600; }
.stat:nth-child(1) .stat-label { color: rgba(28,15,9,.66); }

/* -------------------------------------------------------------- section -- */
.section { padding-block: 40px; }
.section-title { font-size: clamp(1.6rem, 2.9vw, 2.1rem); letter-spacing: -.02em; }
.section-sub { color: var(--muted); margin-top: 8px; margin-bottom: 24px; max-width: 52ch; }
.section-title + .ledger-grid { margin-top: 24px; }

/* ----------------------------------------------------------------- poll -- */
.poll-card {
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.poll-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; flex-wrap: wrap; margin-bottom: 20px;
}
.poll-flag {
  display: inline-block; margin-bottom: 9px;
  background: var(--lime); border: 2px solid var(--ink); border-radius: 100px;
  padding: 3px 12px; font-size: .7rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.is-closed .poll-flag { background: var(--parchment); }
.poll-q { font-size: clamp(1.2rem, 2.3vw, 1.6rem); letter-spacing: -.015em; }

.poll-clock { text-align: right; flex: none; }
.poll-clock-label { font-size: .72rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.poll-clock-digits {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums;
}

.poll-options { display: grid; gap: 10px; }
.poll-option {
  position: relative; overflow: hidden;
  background: var(--card-warm);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
}
.poll-option.is-winner { border-width: 3px; }
.poll-option-fill {
  position: absolute; inset: 0 auto 0 0;
  background: rgba(204, 244, 68, .55);
  transition: width .9s cubic-bezier(.2,.8,.2,1);
}
.is-winner .poll-option-fill { background: var(--lime); }

.poll-option-body {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 13px 15px;
}
.poll-option-left { display: flex; align-items: center; gap: 12px; }
.poll-key {
  display: grid; place-items: center; flex: none;
  width: 28px; height: 28px;
  background: var(--card); border: 2px solid var(--ink); border-radius: 8px;
  font-family: var(--font-display); font-weight: 800; font-size: .85rem;
}
.is-winner .poll-key { background: var(--ink); color: var(--lime); }
.poll-label  { font-weight: 700; font-size: .98rem; }
.poll-detail { font-size: .84rem; color: var(--muted); margin-top: 1px; }
.poll-option-right { text-align: right; flex: none; }
.poll-pct   { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.poll-votes { font-size: .75rem; color: var(--muted); }

.poll-foot {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 18px;
  border-top: 2px dashed rgba(28,15,9,.16);
}
.poll-note { font-size: .82rem; color: var(--muted); flex: 1 1 280px; }

.poll-past-title { font-size: 1.05rem; margin: 28px 0 12px; }
.poll-past-list { display: grid; gap: 10px; }
.poll-past-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  background: var(--card);
  border: 2px solid var(--ink); border-radius: var(--radius-sm);
  padding: 13px 15px;
}
.poll-past-q   { font-weight: 700; }
.poll-past-sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }

/* --------------------------------------------------------------- ledger -- */
.ledger-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 20px; align-items: start; }
.donation {
  display: flex; flex-direction: column;
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  transition: transform .14s ease, box-shadow .14s ease;
}
.donation:hover { transform: translate(-3px, -3px); box-shadow: 7px 7px 0 var(--ink); }

.d-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 11px; }
.d-date { font-size: .8rem; color: var(--muted); font-weight: 600; }
.d-status {
  font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 100px; border: 2px solid var(--ink); flex: none;
}
.d-status.completed { background: var(--lime); }
.d-status.pending   { background: var(--parchment); }

.d-title { font-size: 1.14rem; letter-spacing: -.01em; }
.d-meta  { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 11px; }
.d-summary { margin-top: 12px; font-size: .92rem; color: var(--muted); }

.d-amounts {
  display: flex; gap: 20px; align-items: baseline;
  margin-top: 16px; padding-top: 15px;
  border-top: 2px dashed rgba(28,15,9,.16);
}
.d-usd { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; line-height: 1; }
.d-eth { font-size: .82rem; color: var(--muted); }
.d-people { margin-left: auto; font-size: .82rem; color: var(--muted); text-align: right; }

.d-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.d-tx, .d-video {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 600;
  border: 2px solid var(--ink); border-radius: 100px;
  padding: 5px 12px; text-decoration: none;
}
.d-tx    { background: var(--card-warm); }
.d-video { background: var(--lime); }
.d-tx:hover, .d-video:hover { background: var(--lime-deep); }

/* Honest "not proven yet" states — never styled like a live link. */
.d-tx.is-warn, .d-video.is-warn {
  background: transparent; color: var(--muted);
  border-style: dashed; border-color: rgba(28,15,9,.32);
  cursor: default;
}

.d-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.d-photos img {
  width: 74px; height: 74px; object-fit: cover;
  border: 2px solid var(--ink); border-radius: var(--radius-sm);
}

/* --------------------------------------------------------- empty states -- */
.empty {
  grid-column: 1 / -1;
  background: var(--card-warm);
  border: var(--bw) dashed rgba(28,15,9,.28);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
}
.empty h3 { font-size: 1.15rem; margin-bottom: 8px; }
.empty p  { color: var(--muted); max-width: 46ch; margin-inline: auto; font-size: .92rem; }
.empty code { background: var(--card); padding: 2px 7px; border-radius: 5px; }

/* --------------------------------------------------------------- footer -- */
.site-footer {
  margin-top: 30px;
  border-top: var(--bw) solid var(--ink);
  background: var(--card-warm);
  padding-block: 28px;
}
.footer-inner { display: grid; gap: 14px; }
.footer-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-brand { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; }
.tm { font-size: .68rem; vertical-align: super; color: var(--green); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; font-weight: 600; font-size: .92rem; border-bottom: 2px solid var(--lime); }
.footer-links a:hover { background: var(--lime); }
.footer-treasury { font-size: .84rem; color: var(--muted); }
.footer-treasury a { color: inherit; }

/* --------------------------------------------------------- detail modal -- */

.detail {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: 20px;
}
.detail[hidden] { display: none; }

.detail-backdrop {
  position: absolute; inset: 0;
  background: rgba(28, 15, 9, .55);
  backdrop-filter: blur(3px);
}

.detail-panel {
  position: relative;
  width: 100%; max-width: 620px;
  max-height: 88vh; overflow-y: auto;
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 8px 8px 0 var(--ink);
  padding: 28px;
}

.detail-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--card-warm);
  border: 2px solid var(--ink); border-radius: 50%;
  font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.detail-close:hover { background: var(--lime); }

.dt-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dt-date { font-size: .84rem; color: var(--muted); font-weight: 600; }
.dt-title { font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -.02em; padding-right: 40px; }
.dt-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }

.dt-figures { display: flex; gap: 34px; flex-wrap: wrap; margin-top: 22px; }
.dt-figure-v { font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1; }
.dt-figure-l { font-size: .8rem; color: var(--muted); margin-top: 5px; }

.dt-summary { margin-top: 18px; font-size: .96rem; color: var(--muted); }

.dt-block {
  margin-top: 24px; padding-top: 20px;
  border-top: 2px dashed rgba(28,15,9,.16);
}
.dt-h3 { font-size: 1rem; margin-bottom: 12px; }
.dt-muted { font-size: .9rem; color: var(--muted); }

.dt-links { display: flex; gap: 8px; flex-wrap: wrap; }
.dt-link {
  display: inline-block;
  font-size: .85rem; font-weight: 700;
  background: var(--lime); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 100px;
  padding: 6px 14px; text-decoration: none;
}
.dt-link:hover { background: var(--lime-deep); }

.dt-hash {
  margin-top: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .74rem; color: var(--muted);
  overflow-wrap: anywhere;
}

.dt-embeds { margin-top: 16px; display: grid; gap: 14px; }
.dt-embeds .twitter-tweet { margin: 0 !important; }

@media (max-width: 620px) {
  .detail { padding: 10px; }
  .detail-panel { padding: 22px 18px; max-height: 92vh; }
  .dt-figures { gap: 22px; }
}

/* ---------------------------------------------------------------- toast -- */
.toast {
  position: fixed; left: 50%; bottom: 28px;
  /* Must clear its own height AND the 28px offset, or a sliver of it stays
     stuck to the bottom of every page. A percentage alone is not enough. */
  transform: translate(-50%, calc(100% + 40px));
  background: var(--lime); color: var(--ink);
  border: var(--bw) solid var(--ink); border-radius: 100px;
  box-shadow: var(--shadow);
  padding: 11px 24px;
  font-family: var(--font-display); font-weight: 800; font-size: .92rem;
  transition: transform .3s cubic-bezier(.2,.9,.3,1.2);
  z-index: 60; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }

.refresh-icon { display: inline-block; }
.is-loading .refresh-icon { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------- responsive -- */
@media (max-width: 900px) {
  .site-nav { display: none; }
}

@media (max-width: 620px) {
  .hero { padding-block: 36px 28px; }
  .header-inner { gap: 12px; }
  .stat-grid { grid-template-columns: 1fr; gap: 12px; }
  .ledger-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ------------------------------------------------- video inside the card -- */
.d-media { margin-top: 16px; }
.d-media .twitter-tweet { margin: 0 !important; }

.d-rest { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.d-rest-label { font-size: .8rem; color: var(--muted); font-weight: 600; }

.d-more {
  font-family: var(--font-display); font-weight: 800; font-size: .78rem;
  background: var(--ink); color: var(--card);
  border: 2px solid var(--ink); border-radius: 100px;
  padding: 5px 13px; cursor: pointer; margin-left: auto;
}
.d-more:hover { background: var(--lime); color: var(--ink); }
