:root {
  --bg: #f5efe6;
  --surface: rgba(255, 252, 248, 0.84);
  --surface-strong: #fffdf9;
  --ink: #1e1b18;
  --muted: #6e6256;
  --line: rgba(49, 34, 20, 0.12);
  --accent: #b84f2d;
  --accent-deep: #8d381d;
  --positive: #256b4a;
  --negative: #9c2f3e;
  --neutral: #7f6d49;
  --shadow: 0 24px 70px rgba(78, 48, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 190, 140, 0.45), transparent 25%),
    radial-gradient(circle at top right, rgba(211, 115, 79, 0.22), transparent 20%),
    linear-gradient(180deg, #f8f1e7 0%, #efe4d6 100%);
  font-family: Georgia, "Times New Roman", serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 72px;
}

.locale-switcher {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding-top: 18px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.locale-switcher__label {
  color: var(--muted);
  font-size: 0.88rem;
}

.hero,
.community-hero,
.thread-header {
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: "Courier New", monospace;
  font-size: 0.74rem;
  color: var(--accent-deep);
}

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

h1 {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 0.95;
  max-width: 12ch;
  margin-bottom: 16px;
}

.hero-copy {
  max-width: 54rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
}

.community-grid,
.message-list,
.thread-stack {
  display: grid;
  gap: 18px;
}

.community-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.community-card,
.composer,
.message-card,
.hero-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.community-card,
.composer,
.message-card {
  border-radius: 28px;
  padding: 24px;
}

.community-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
}

.community-card__header,
.message-card__topline,
.message-card__footer,
.composer__actions,
.field-row,
.community-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.community-card__meta,
.message-card__author,
.message-card__timestamp,
.community-card__description,
.reaction-status,
.form-status,
.reaction-user span {
  color: var(--muted);
}

.community-card h2 {
  font-size: 1.8rem;
  margin-bottom: 14px;
}

.community-card__description,
.message-card__content {
  line-height: 1.7;
  font-size: 1rem;
}

.community-card__description {
  flex: 1;
}

.count-pill,
.sentiment-pill {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-family: "Courier New", monospace;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.sentiment-positive {
  background: rgba(37, 107, 74, 0.12);
  color: var(--positive);
}

.sentiment-negative {
  background: rgba(156, 47, 62, 0.12);
  color: var(--negative);
}

.sentiment-neutral {
  background: rgba(127, 109, 73, 0.12);
  color: var(--neutral);
}

.primary-link,
.secondary-link,
.back-link,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.primary-link,
.primary-button {
  background: var(--accent);
  color: #fff8f2;
  padding: 12px 18px;
  border: none;
  cursor: pointer;
}

.primary-link:hover,
.primary-button:hover,
.secondary-link:hover,
.back-link:hover,
.reaction-button:hover {
  transform: translateY(-1px);
}

.secondary-link,
.back-link {
  border: 1px solid var(--line);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.52);
}

.hero-stat {
  border-radius: 24px;
  padding: 18px 20px;
  min-width: 180px;
}

.hero-stat span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.hero-stat strong {
  font-size: 1.4rem;
}

.composer {
  margin-bottom: 24px;
}

.composer__heading p {
  color: var(--muted);
}

label {
  display: block;
  flex: 1;
}

label span {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 8px;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

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

.message-card__author {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 4px;
}

.message-card__timestamp {
  font-size: 0.88rem;
}

.message-card__content {
  margin: 18px 0;
  font-size: 1.1rem;
}

.reaction-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.reaction-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  padding: 10px 14px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
}

.reaction-user {
  min-width: 120px;
}

.reaction-user input {
  min-width: 110px;
}

.message-card__meta {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}

.thread-node {
  margin-left: calc((var(--depth) - 1) * 22px);
  padding-left: 18px;
  border-left: 2px solid rgba(184, 79, 45, 0.18);
}

.thread-children {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.form-status[data-state="busy"] {
  color: var(--accent-deep);
}

@media (max-width: 768px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding-top: 24px;
  }

  h1 {
    max-width: none;
    font-size: 2.6rem;
  }

  .community-hero,
  .message-card__footer,
  .message-card__topline,
  .field-row,
  .composer__actions {
    flex-direction: column;
  }

  .hero-stat {
    min-width: auto;
  }

  .thread-node {
    margin-left: calc((var(--depth) - 1) * 12px);
    padding-left: 12px;
  }
}
