:root {
  color-scheme: dark;
  --bg: #0c0d0c;
  --bg-2: #121412;
  --card: rgba(15, 16, 15, 0.92);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #e7e8e6;
  --muted: #a4a8a2;
  --accent: #d7dbd4;
  --accent-2: #ffffff;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 30%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 38px;
  opacity: 0.65;
}

.shell {
  width: min(920px, calc(100% - 24px));
  margin: 0 auto;
  padding: 24px 0 40px;
  display: grid;
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  border-radius: 16px;
}

.hero {
  padding: 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

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

h1 {
  font-size: clamp(1.7rem, 3vw, 2.8rem);
  line-height: 1.1;
  max-width: 14ch;
  margin-bottom: 10px;
  font-weight: 600;
}

.lead {
  max-width: 54ch;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
  margin-bottom: 18px;
}

.composer {
  display: grid;
  gap: 12px;
}

.composer label {
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
  color: var(--muted);
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

textarea {
  resize: vertical;
  min-height: 96px;
}

button {
  justify-self: start;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.status {
  min-height: 1.5em;
  margin: 10px 0 0;
  color: var(--muted);
}

.hint {
  margin: 4px 0 0;
  color: rgba(231, 232, 230, 0.72);
  font-size: 0.86rem;
  line-height: 1.5;
}

.feed {
  padding: 18px;
}

.feed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.feed-head h2 {
  margin-bottom: 0;
}

.feed-head span {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.messages {
  display: grid;
  gap: 10px;
}

.message-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--message-accent) 24%, transparent), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid color-mix(in srgb, var(--message-accent) 35%, rgba(255, 255, 255, 0.08));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--message-accent) 12%, transparent) inset;
}

.message-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.message-nick {
  color: var(--message-accent);
  font-weight: 600;
}

.message-text {
  white-space: pre-wrap;
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.footer {
  padding: 14px 18px;
  text-align: center;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
}

.message-card:nth-child(6n + 1) { --message-accent: #9eff6d; }
.message-card:nth-child(6n + 2) { --message-accent: #54d48b; }
.message-card:nth-child(6n + 3) { --message-accent: #67b7ff; }
.message-card:nth-child(6n + 4) { --message-accent: #ffb86b; }
.message-card:nth-child(6n + 5) { --message-accent: #ff7ad9; }
.message-card:nth-child(6n + 6) { --message-accent: #f7f37a; }

@media (min-width: 900px) {
  .shell {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: start;
    padding-top: 28px;
  }

  .hero {
    position: sticky;
    top: 18px;
  }

  .footer {
    grid-column: 1 / -1;
  }
}
