:root {
  color-scheme: light;
  --ink: #161616;
  --muted: #62666f;
  --line: #d9dde5;
  --paper: #f7f7f4;
  --panel: #ffffff;
  --red: #b9162b;
  --blue: #1e7fd0;
  --blue-deep: #0d4775;
  --gold: #d9a441;
  --green: #168a5a;
  --shadow: 0 20px 45px rgba(20, 22, 28, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, Pretendard, "Noto Sans KR", "Segoe UI", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: #101115;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #fff;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.68);
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-list a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 8px;
}

.nav-list a.active,
.nav-list a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.wallet-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  background: rgba(255, 255, 255, 0.06);
}

.wallet-card span {
  grid-column: 1 / -1;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.wallet-card button,
.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

main {
  padding: 24px;
  display: grid;
  gap: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
}

.eyebrow,
.stage-label {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 980px;
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.05;
  letter-spacing: 0;
}

.topbar-copy p:last-child {
  max-width: 880px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

h2 {
  margin-bottom: 10px;
  font-size: 24px;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-button,
.ghost-button {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}

.primary-button {
  background: var(--red);
  color: #fff;
}

.ghost-button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.wide {
  width: 100%;
}

.project-board {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 18px;
}

.project-main,
.panel,
.phase-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.project-main {
  min-height: 330px;
  padding: 26px;
  display: grid;
  align-content: space-between;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0 46%, rgba(255, 255, 255, 0.34)),
    url("./assets/joker-dao.png") right 8% center / contain no-repeat,
    #fff;
}

.project-copy {
  max-width: 650px;
}

.hero-logo {
  width: 86px;
  height: 86px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
}

.project-copy h2 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.06;
}

.project-copy p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.62;
}

.story-section {
  display: grid;
}

.source-section {
  display: grid;
}

.compliance-section {
  display: grid;
}

.story-panel {
  display: grid;
  gap: 12px;
}

.story-panel p {
  max-width: 1120px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.legal-note,
.fee-note {
  margin-top: 8px;
  border-left: 4px solid var(--gold);
  padding: 12px 14px;
  background: #fff8e8;
  color: #59421a;
  line-height: 1.6;
}

.source-panel {
  display: grid;
  gap: 18px;
}

.compliance-panel {
  display: grid;
  gap: 18px;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.compliance-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.source-grid article,
.compliance-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf9;
}

.source-grid span,
.compliance-grid span {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 999px;
  padding: 6px 9px;
  background: #e9f4ff;
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 900;
}

.source-grid strong,
.compliance-grid strong {
  display: block;
  margin-bottom: 10px;
  font-size: 18px;
}

.source-grid p,
.compliance-grid p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font-weight: 900;
  text-decoration: none;
}

.source-link.compact {
  white-space: nowrap;
  margin-top: 0;
}

.funding-meter {
  max-width: 720px;
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.meter-head,
.meter-foot,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.meter-track {
  height: 14px;
  margin: 12px 0;
  border-radius: 999px;
  overflow: hidden;
  background: #e8ebef;
}

.meter-track span {
  display: block;
  width: 72.4%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--red));
}

.meter-foot {
  color: var(--muted);
  font-size: 14px;
}

.project-stats {
  display: grid;
  gap: 14px;
}

.project-stats article,
.distribution div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.project-stats span,
.distribution span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.project-stats strong,
.distribution strong {
  display: block;
  margin: 8px 0;
  font-size: 30px;
}

.project-stats small,
.distribution small {
  color: var(--muted);
}

.grid-section,
.vote-lab {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.panel {
  padding: 24px;
}

.status-pill {
  white-space: nowrap;
  border-radius: 999px;
  padding: 7px 10px;
  background: #e9f4ff;
  color: var(--blue-deep);
  font-size: 13px;
  font-weight: 800;
}

.status-pill.locked {
  background: #fff2d8;
  color: #8a5b00;
}

.evidence-form,
.vote-controls {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: #30343a;
  font-weight: 800;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 13px;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.privacy-note {
  border-left: 4px solid var(--gold);
  padding: 12px 14px;
  background: #fff8e8;
  color: #59421a;
  line-height: 1.6;
}

.evidence-list {
  display: grid;
  gap: 12px;
}

.evidence-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf9;
}

.evidence-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.evidence-card h3 {
  margin: 0;
  font-size: 18px;
}

.evidence-card p {
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.score-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.score-row span {
  display: grid;
  gap: 2px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.score-row strong {
  color: var(--ink);
  font-size: 17px;
}

.formula {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 18px;
  border-radius: 8px;
  background: #101115;
  color: #fff;
}

.formula span {
  color: rgba(255, 255, 255, 0.64);
}

.formula strong {
  font-size: 20px;
  line-height: 1.4;
}

input[type="range"] {
  accent-color: var(--red);
}

output {
  color: var(--blue-deep);
  font-weight: 900;
}

.influence-panel {
  display: grid;
  align-content: center;
  gap: 18px;
  background:
    linear-gradient(135deg, rgba(185, 22, 43, 0.08), rgba(30, 127, 208, 0.12)),
    #fff;
}

.influence-number {
  font-size: clamp(48px, 8vw, 92px);
  font-weight: 900;
  line-height: 1;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 360px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segmented button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-weight: 900;
}

.segmented button.selected {
  background: var(--ink);
  color: #fff;
}

#voteResult {
  max-width: 520px;
  color: var(--muted);
  line-height: 1.6;
}

.td-logo {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
}

.distribution {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.distribution div:first-child {
  border-color: rgba(185, 22, 43, 0.32);
  background: #fff8f8;
}

.fee-note {
  margin-top: 16px;
}

.roadmap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.phase-card {
  padding: 24px;
}

.phase-card span {
  display: inline-flex;
  margin-bottom: 16px;
  border-radius: 999px;
  padding: 7px 10px;
  background: #eef0f2;
  color: var(--muted);
  font-weight: 900;
  font-size: 13px;
}

.phase-card.active {
  border-color: rgba(185, 22, 43, 0.4);
}

.phase-card.active span {
  background: var(--red);
  color: #fff;
}

.phase-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 14px 16px;
  border-radius: 8px;
  background: #101115;
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(120px);
  opacity: 0;
  transition: 0.24s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .nav-list {
    grid-auto-flow: column;
    overflow-x: auto;
  }

  .wallet-card {
    margin-left: auto;
    margin-top: 0;
  }

  .project-board,
  .grid-section,
  .vote-lab,
  .distribution,
  .source-grid,
  .compliance-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 780px) {
  main {
    padding: 14px;
    gap: 14px;
  }

  .topbar,
  .section-head,
  .meter-head,
  .meter-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions,
  .top-actions button {
    width: 100%;
  }

  .project-board,
  .grid-section,
  .vote-lab,
  .distribution,
  .source-grid,
  .compliance-grid,
  .roadmap,
  .form-grid,
  .score-row {
    grid-template-columns: 1fr;
  }

  .project-main {
    min-height: auto;
    padding: 18px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0 72%, rgba(255, 255, 255, 0.62)),
      url("./assets/joker-dao.png") right 14px bottom 14px / 38% auto no-repeat,
      #fff;
  }

  .sidebar {
    padding: 12px 14px;
    gap: 12px;
  }

  .brand img {
    width: 50px;
    height: 50px;
  }

  .nav-list {
    width: 100%;
  }

  h1 {
    font-size: 30px;
  }

  .topbar-copy p:last-child,
  .project-copy p,
  .story-panel p {
    font-size: 14px;
    line-height: 1.52;
  }

  .hero-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 8px;
  }

  .project-copy h2 {
    font-size: 30px;
  }

  .funding-meter {
    margin-top: 10px;
    padding: 14px;
  }

  .panel,
  .phase-card {
    padding: 18px;
  }

  .wallet-card {
    width: 100%;
  }
}
