:root {
  /* Mango & Clay palette */
  --bg: #fbf3ea;
  --card-bg: #ffffff;
  --ink: #3b2a22;
  --ink-soft: #b08765;
  --clay: #c97c5d;
  --clay-soft: #f0dccb;
  --mango: #f5a623;
  --mango-hover: #e2941a;
  --coffee: #6f4630;
  --coffee-hover: #5b3722;
  --like-pink: #e8536b;
  --border: #ecdcc9;
  --dark-pill: #3b2a22;
  --shadow: 0 8px 24px rgba(90, 60, 30, 0.10);
  --radius: 18px;
}

* { box-sizing: border-box; }

/* Make sure anything marked hidden actually stays hidden, even though
   .modal-overlay and .screen also set their own display value below. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Nunito', system-ui, sans-serif;
  min-height: 100vh;
}

#app {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* Header */
.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 8px;
}

.brand-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 15px;
  color: var(--clay);
}

.why-link {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.tagline {
  font-size: 13px;
  color: var(--ink-soft);
  text-align: right;
  max-width: 260px;
  line-height: 1.4;
}

/* Screens */
.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 8px 40px;
}

.today-date {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.handwritten-headline {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 46px;
  line-height: 1.2;
  color: var(--clay);
  max-width: 520px;
  margin: 0 0 34px;
}

.question-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  max-width: 480px;
  margin: 0 0 16px;
}

.big-btn {
  font-size: 16px;
  padding: 14px 30px;
}

/* Buttons */
.primary-btn {
  background: var(--mango);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

.primary-btn:hover { background: var(--mango-hover); }
.primary-btn:active { transform: scale(0.97); }
.primary-btn:disabled {
  background: #e6d3bd;
  cursor: not-allowed;
}

.text-btn {
  background: none;
  border: none;
  color: var(--clay);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
}

.error-text {
  color: #c23b2b;
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
}

/* Compose screen */
#compose-area textarea,
#compose-screen textarea {
  width: 100%;
  max-width: 520px;
  min-height: 140px;
  border-radius: 18px;
  border: 1.5px solid var(--clay-soft);
  background: var(--card-bg);
  padding: 18px;
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 16px;
  resize: vertical;
  color: var(--ink);
  box-shadow: var(--shadow);
}

#compose-screen textarea::placeholder {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  color: var(--ink-soft);
}

#compose-screen textarea:focus {
  outline: 2px solid var(--mango);
  outline-offset: 1px;
}

.compose-footer {
  width: 100%;
  max-width: 520px;
  display: flex;
  justify-content: flex-end;
  margin: 10px 0 20px;
}

.char-count {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}

.char-count.limit-close {
  color: var(--clay);
}

.already-posted-note {
  background: var(--clay-soft);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 24px;
  max-width: 480px;
}

/* Feed screen */
.feed-screen {
  align-items: stretch;
  text-align: left;
  padding-top: 20px;
}

.feed-screen .question-label {
  text-align: center;
  max-width: none;
}

.section-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 14px;
  font-weight: 800;
  color: var(--clay);
  text-align: center;
  margin: 26px 0 14px;
}

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

@media (max-width: 640px) {
  .feed-row { grid-template-columns: 1fr; }
  .tagline { text-align: left; max-width: none; }
}

.post-card {
  border: 1.5px solid var(--clay-soft);
  border-radius: 14px;
  padding: 16px;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.post-username {
  font-weight: 800;
  font-size: 14px;
}

.post-time {
  font-size: 12px;
  color: var(--ink-soft);
}

.post-content {
  font-size: 15px;
  line-height: 1.45;
  margin: 6px 0 12px;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.like-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.like-btn.liked {
  color: var(--like-pink);
  border-color: var(--like-pink);
  background: #fdeef2;
}

.comment-toggle-btn {
  width: 100%;
  background: var(--dark-pill);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}

.comments-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.comment-item {
  font-size: 14px;
  margin-bottom: 8px;
}

.comment-item .c-username {
  font-weight: 800;
  margin-right: 6px;
}

.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.comment-form input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 8px 14px;
  font-size: 13px;
  font-family: 'Nunito', system-ui, sans-serif;
}

.comment-form button {
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.empty-feed {
  color: var(--ink-soft);
  font-size: 14px;
  padding: 12px 0;
  text-align: center;
  grid-column: 1 / -1;
}

.site-footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  margin-top: 30px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(59, 42, 34, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}

.modal-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow);
  position: relative;
}

.modal-card h2 {
  margin: 0 0 8px;
}

.modal-sub {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 16px;
}

.modal-card input {
  width: 100%;
  border-radius: 999px;
  border: 1.5px solid var(--clay-soft);
  padding: 12px 18px;
  font-size: 15px;
  margin-bottom: 10px;
  font-family: 'Nunito', system-ui, sans-serif;
  text-align: center;
}

.modal-card .primary-btn {
  width: 100%;
  margin-top: 4px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
}

.about-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.about-label strong {
  color: var(--clay);
}

.about-text {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 12px;
}

.about-list {
  font-family: 'Caveat', cursive;
  font-size: 20px;
  color: var(--ink);
  margin: 0 0 20px;
  padding-left: 22px;
  line-height: 1.5;
}

.about-list li::marker {
  color: var(--clay);
}

.donate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px dashed var(--border);
  padding-top: 16px;
}

.donate-note {
  font-size: 13px;
  color: var(--ink-soft);
  flex: 1;
  min-width: 160px;
}

.coffee-btn {
  background: var(--coffee);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-decoration: none;
  white-space: nowrap;
}

.coffee-btn:hover {
  background: var(--coffee-hover);
}
