.mobile-sticky-bar {
  display: none;
}

.shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 56px;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 56px 0;
}

.profile {
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 28px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(222, 222, 215, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 24px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  letter-spacing: 0;
}

.avatar.compact {
  width: 40px;
  height: 40px;
  margin-bottom: 0;
  font-size: 13px;
}

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 28px 0;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
}

.stat-label {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  min-height: 280px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.project-card p,
.timeline p {
  color: var(--muted);
  line-height: 1.6;
}

.project-topline,
.project-money,
.event-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.status,
.updated,
.event-head,
.live-pill {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status {
  color: var(--accent);
}

.accent-gold .status {
  color: var(--gold);
}

.accent-stone .status {
  color: var(--stone);
}

.meter {
  height: 10px;
  margin-top: 28px;
  overflow: hidden;
  background: #edede8;
  border-radius: 999px;
}

.meter span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.accent-gold .meter span {
  background: var(--gold);
}

.accent-stone .meter span {
  background: var(--stone);
}

.project-money {
  margin-top: 14px;
}

.project-money span {
  color: var(--muted);
  font-size: 14px;
}

.project-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.deadline-chip,
.deadline-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.deadline-chip {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: #efefe9;
}

.deadline-chip.ended,
.deadline-note.ended {
  color: #8a6c2f;
}

.live-pill {
  position: relative;
  padding: 8px 12px 8px 24px;
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent);
}

.live-pill::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  transform: translateY(-50%);
  animation: pulse 1.8s ease-in-out infinite;
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 18px;
}

.timeline-item + .timeline-item {
  margin-top: 2px;
}

.marker {
  position: relative;
}

.marker::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 20px;
  bottom: -34px;
  width: 1px;
  background: var(--line);
}

.timeline-item:last-child .marker::before {
  display: none;
}

.marker::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 18px;
  width: 11px;
  height: 11px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 50%;
}

.event-update .marker::after {
  border-color: var(--gold);
}

.event-milestone .marker::after {
  border-color: var(--stone);
}

.event-body {
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--line);
}

.event-body h3 {
  margin: 10px 0 8px;
  font-size: 18px;
}

.amount {
  display: inline-block;
  margin-top: 4px;
  color: var(--accent);
}

.detail-shell {
  width: min(1100px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
  color: var(--muted);
  font-size: 14px;
}

.top-nav a {
  font-weight: 700;
  text-decoration: none;
}

.project-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  align-items: end;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.lede {
  max-width: 68ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.project-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.project-meta-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 10px 14px;
  border-radius: 6px;
  background: #f4f4ef;
  color: var(--muted);
  flex-wrap: wrap;
}

.project-meta-note span {
  font-size: 13px;
}

.project-meta-note strong {
  color: var(--text);
  font-size: 14px;
}

.funding-panel,
.donation-form,
.thanks-panel,
.pay-panel {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.funding-panel strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.funding-panel p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.deadline-note {
  margin-top: 12px;
}

.panel-label,
.amount-grid legend {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.donation-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 44px;
  align-items: start;
  padding-top: 44px;
}

.donation-closed p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.form-heading {
  margin-bottom: 22px;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.amount-grid legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
}

.amount-grid label {
  cursor: pointer;
}

.amount-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.amount-grid span {
  display: grid;
  min-height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
}

.amount-grid input:checked + span {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.timeline-preview {
  min-width: 0;
}

.thanks-panel {
  width: min(540px, 100%);
}

.pay-panel {
  display: grid;
  gap: 18px;
  width: min(640px, 100%);
}

.thanks-panel h1 {
  font-size: clamp(34px, 8vw, 52px);
}

.pay-meta,
.pay-actions,
.pay-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pay-meta span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #efefe9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.pay-summary {
  justify-content: space-between;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.pay-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.code-block {
  width: 100%;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.project-list-actions,
.timeline-actions {
  padding-top: 18px;
}

.inline-action {
  width: auto;
  min-width: 132px;
}

.projects-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.projects-header,
.projects-meta,
.pagination-row {
  display: flex;
  align-items: center;
}

.projects-header,
.pagination-row {
  justify-content: space-between;
}

.projects-header {
  gap: 24px;
  margin-bottom: 28px;
}

.projects-meta {
  gap: 8px;
  flex-wrap: wrap;
}

.projects-meta span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #efefe9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.projects-index-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.pagination-row {
  margin-top: 28px;
}

.pagination-spacer {
  display: inline-block;
  min-width: 132px;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
  50% {
    opacity: 0.45;
    transform: translateY(-50%) scale(1.45);
  }
}

@media (max-width: 860px) {
  .mobile-sticky-bar {
    position: sticky;
    top: 74px;
    z-index: 20;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px 12px;
    align-items: center;
    width: min(100% - 32px, 680px);
    margin: 10px auto 0;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(222, 222, 215, 0.95);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(46, 49, 42, 0.08);
  }

  .mobile-sticky-copy {
    min-width: 0;
  }

  .mobile-sticky-copy strong,
  .mobile-sticky-copy span {
    display: block;
  }

  .mobile-sticky-copy strong {
    font-size: 15px;
    line-height: 1.1;
  }

  .mobile-sticky-copy span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  }

  .shell,
  .detail-shell,
  .projects-shell {
    width: min(100% - 32px, 680px);
  }

  .shell {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 18px 0 40px;
  }

  .profile {
    position: static;
    display: block;
    padding: 24px;
    background: rgba(255, 255, 255, 0.76);
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
    margin: 24px 0;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
  }

  .avatar {
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
  }

  .profile .eyebrow {
    margin-bottom: 8px;
  }

  .profile h1 {
    margin-bottom: 14px;
    font-size: clamp(30px, 7vw, 40px);
  }

  .project-list,
  .projects-index-grid,
  .project-hero,
  .donation-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 540px) {
  .mobile-sticky-bar {
    top: 68px;
    grid-template-columns: auto minmax(0, 1fr);
    width: min(100% - 24px, 680px);
    gap: 8px 10px;
    padding: 10px 12px;
  }

  .profile,
  .project-card {
    padding: 20px;
  }

  .avatar {
    width: 48px;
    height: 48px;
  }

  .top-nav {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .projects-header,
  .pagination-row {
    align-items: start;
    flex-direction: column;
    gap: 14px;
  }

  .pay-summary {
    align-items: start;
    flex-direction: column;
  }

  .project-topline,
  .project-money,
  .event-head {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }

  .project-card-actions {
    align-items: start;
    flex-direction: column;
  }

  .amount-grid {
    grid-template-columns: 1fr;
  }

  .primary-link.compact {
    grid-column: 1 / -1;
    width: 100%;
  }
}
