:root {
  --community-paper: #f4f2ea;
  --community-ink: #1a1815;
  --community-rust: #C8341F;
  --community-body: #3a362e;
  --community-muted: #777064;
  --community-rule: #c9c4b5;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--community-rust);
  outline-offset: 3px;
}

body.community-dialog-open {
  overflow: hidden;
}

.projects-layout {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(24px, 3vw, 42px);
  align-items: flex-start;
}

.projects-feed {
  flex: 1 1 600px;
  min-width: 300px;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(26px, 3vw, 40px);
  align-items: flex-start;
}

.editorial-column {
  flex: 1 1 250px;
  min-width: 220px;
  align-self: stretch;
}

.editorial-sticky {
  position: sticky;
  top: 20px;
  border-left: 2px solid var(--community-ink);
  padding-left: 18px;
}

.community-panel {
  border-top: 4px solid var(--community-rust);
  padding-top: 12px;
  margin-bottom: 30px;
}

.community-kicker,
.community-dialog-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--community-rust);
}

.community-heading {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(23px, 2.8vw, 32px);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  margin: 6px 0 8px;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.community-intro {
  font-family: 'PT Serif', serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--community-body);
  margin: 0 0 14px;
}

.community-compact-list {
  display: grid;
  border-bottom: 1px solid var(--community-rule);
}

.community-compact-list[aria-busy='true'] {
  min-height: 96px;
  align-content: center;
}

.community-loading,
.community-empty {
  font-family: 'PT Serif', serif;
  font-style: italic;
  font-size: 14px;
  line-height: 1.5;
  color: #5a564b;
  padding: 13px 0 17px;
  margin: 0;
}

.community-event {
  width: 100%;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  text-align: left;
  color: var(--community-ink);
  background: transparent;
  border: 0;
  border-top: 1px solid var(--community-rule);
  padding: 13px 0;
  cursor: pointer;
}

.community-event:first-child {
  border-top: 2px solid var(--community-ink);
}

.community-event:hover .community-event-title,
.community-event:focus-visible .community-event-title {
  color: var(--community-rust);
}

.community-event-date {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 29px;
  line-height: .85;
  color: var(--community-rust);
  text-transform: uppercase;
  white-space: nowrap;
}

.community-event-month,
.community-event-time {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.3;
  letter-spacing: .03em;
}

.community-event-month {
  font-size: 9px;
  margin-top: 6px;
  color: var(--community-muted);
}

.community-event-time {
  font-size: 10px;
  margin-top: 3px;
  color: var(--community-ink);
}

.community-event-game {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--community-rust);
  overflow-wrap: anywhere;
}

.community-event-title {
  display: block;
  font-family: 'PT Serif', serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.28;
  margin: 3px 0 8px;
  transition: color 140ms ease;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.community-event-organizer {
  display: grid;
  gap: 1px;
  font-family: 'PT Serif', serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--community-body);
  overflow-wrap: anywhere;
}

.community-event-organizer-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--community-muted);
}

.community-more,
.community-dialog-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--community-ink);
  border: 0;
  border-bottom: 3px solid var(--community-rust);
  padding: 4px 0 3px;
  margin-top: 13px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  line-height: 1.4;
  text-transform: uppercase;
  cursor: pointer;
}

.community-more:hover,
.community-dialog-action:hover {
  color: var(--community-rust);
}

.devlog-panel {
  border-top: 1px solid var(--community-rule);
  padding-top: 18px;
}

.devlog-panel .devscroll {
  max-height: clamp(230px, 35vh, 430px) !important;
}

.community-dialog {
  inset: 0 0 0 auto;
  width: min(720px, calc(100vw - 28px));
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 3px solid var(--community-ink);
  background: var(--community-paper);
  color: var(--community-ink);
  box-shadow: -8px 0 0 var(--community-rust);
  overflow: hidden;
}

.community-dialog[open] {
  animation: community-drawer-in 180ms ease-out;
}

@keyframes community-drawer-in {
  from { transform: translateX(32px); opacity: .7; }
  to { transform: translateX(0); opacity: 1; }
}

.community-dialog::backdrop {
  background: rgba(26, 24, 21, .68);
  backdrop-filter: blur(2px);
}

.community-dialog-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.community-dialog-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 2px solid var(--community-ink);
  padding: clamp(18px, 3vw, 28px) clamp(78px, 8vw, 92px) clamp(18px, 3vw, 28px) clamp(18px, 3vw, 28px);
}

.community-dialog-header > div {
  min-width: 0;
}

.community-dialog-title {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(30px, 5vw, 50px);
  font-weight: 700;
  line-height: .98;
  text-transform: uppercase;
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.community-dialog-title:focus {
  outline: none;
}

.community-dialog-close {
  position: absolute;
  top: clamp(18px, 3vw, 28px);
  right: clamp(18px, 3vw, 28px);
  z-index: 1;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 2px solid var(--community-ink);
  background: transparent;
  color: var(--community-ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.community-dialog-close:hover {
  background: var(--community-ink);
  color: var(--community-paper);
}

.community-dialog-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: clamp(18px, 3vw, 30px);
  overscroll-behavior: contain;
}

.community-dialog-section + .community-dialog-section {
  border-top: 4px solid var(--community-ink);
  margin-top: 34px;
  padding-top: 18px;
}

.community-dialog-section-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(23px, 3vw, 32px);
  line-height: 1.05;
  text-transform: uppercase;
  margin: 0 0 5px;
}

.community-dialog-note {
  font-family: 'PT Serif', serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.5;
  color: #625d52;
  margin: 0 0 16px;
}

.community-week-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 2px solid var(--community-ink);
}

.community-week-list .community-event {
  padding: 16px 13px;
  border-top: 0;
  border-bottom: 1px solid var(--community-rule);
}

.community-week-list .community-event:nth-child(odd) {
  border-right: 1px solid var(--community-rule);
}

.community-week-list .community-event:first-child {
  border-top: 0;
}

.community-rank-list {
  border-top: 2px solid var(--community-ink);
}

.community-rank {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--community-rule);
}

.community-rank-number {
  font-family: 'Oswald', sans-serif;
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
  color: var(--community-rust);
}

.community-rank-name {
  font-family: 'PT Serif', serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.community-rank-activity {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  line-height: 1.55;
  letter-spacing: .035em;
  text-transform: uppercase;
  color: #625d52;
  margin-top: 5px;
}

.community-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 10px;
}

.community-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.4;
  text-decoration: none;
  border-bottom: 2px solid var(--community-rust);
  padding-bottom: 2px;
  overflow-wrap: anywhere;
}

.community-link:hover {
  color: var(--community-rust);
}

.community-detail-back {
  margin: 0 0 20px;
}

.community-detail-cover {
  display: block;
  width: calc(100% - 6px);
  max-height: 390px;
  object-fit: cover;
  border: 2px solid var(--community-ink);
  box-shadow: 6px 6px 0 var(--community-rust);
  margin: 0 6px 25px 0;
}

.community-detail-placeholder {
  display: grid;
  place-items: center;
  min-height: 190px;
  border: 2px solid var(--community-ink);
  background: repeating-linear-gradient(-45deg, #ebe7dc, #ebe7dc 12px, var(--community-paper) 12px, var(--community-paper) 24px);
  font-family: 'Oswald', sans-serif;
  font-size: clamp(30px, 6vw, 60px);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  text-align: center;
  color: var(--community-rust);
  padding: 30px;
  margin: 0 6px 25px 0;
  overflow-wrap: anywhere;
}

.community-detail-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--community-rust);
  margin-bottom: 13px;
}

.community-detail-description {
  font-family: 'PT Serif', serif;
  font-size: clamp(16px, 2.3vw, 19px);
  line-height: 1.62;
  color: var(--community-body);
  margin: 0;
  max-width: 62ch;
  white-space: pre-line;
}

.community-detail-group {
  border-top: 2px solid var(--community-ink);
  margin-top: 25px;
  padding-top: 16px;
}

.community-detail-group-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--community-muted);
}

.community-detail-group-name {
  font-family: 'PT Serif', serif;
  font-size: clamp(19px, 3vw, 24px);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 4px;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

@media (max-width: 760px) {
  .editorial-column,
  .editorial-sticky {
    display: contents;
  }

  .community-panel {
    order: 1;
    flex: 1 1 100%;
    width: 100%;
    border: 2px solid var(--community-ink);
    border-top: 5px solid var(--community-rust);
    box-shadow: 5px 5px 0 var(--community-rust);
    padding: 17px;
    margin: 0 5px 15px 0;
  }

  .projects-feed {
    order: 2;
  }

  .devlog-panel {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    border-top: 4px solid var(--community-ink);
    border-left: 2px solid var(--community-ink);
    padding: 18px 0 0 18px;
    margin-top: 10px;
  }

  .devlog-panel .devscroll {
    max-height: min(55vh, 520px) !important;
  }

  .community-week-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-week-list .community-event:nth-child(odd) {
    border-right: 0;
  }
}

@media (max-width: 520px) {
  .community-dialog {
    width: calc(100vw - 8px);
    border-left-width: 2px;
    box-shadow: -5px 0 0 var(--community-rust);
  }

  .community-dialog-header,
  .community-dialog-content {
    padding: 17px;
  }

  .community-dialog-header {
    padding-right: 76px;
  }

  .community-dialog-close {
    top: 17px;
    right: 17px;
  }

  .community-dialog-title {
    font-size: clamp(27px, 9vw, 40px);
  }

  .community-dialog-close {
    width: 42px;
    height: 42px;
  }

  .community-detail-placeholder {
    min-height: 140px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }

  .community-dialog::backdrop {
    backdrop-filter: none;
  }
}
