:root {
  --bg: #faf9f7;
  --ink: #1c1a17;
  --muted: #6f6a61;
  --card: #ffffff;
  --line: #e8e3da;
  --accent: #b3541e;
  --accent-soft: #f6ebe1;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { overflow-x: hidden; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(250, 249, 247, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.wordmark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.x-button {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  border: 1px solid #1c1a17;
  background: #1c1a17;
  padding: 8px 16px;
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s;
  opacity: 0;
  animation: pill-in 0.5s ease 2.4s forwards;
}
.x-button:hover { background: #000; border-color: #000; }
@keyframes pill-in {
  to { opacity: 1; }
}

/* Intro */
.intro { padding: 22px 0 4px; }
.intro h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(14px, 4.7vw, 56px);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.15;
  white-space: nowrap;
}
.intro h1 em { font-style: italic; color: var(--accent); }
.intro h1 .beat {
  display: inline-block;
  clip-path: inset(0 100% 0 0);
}
.intro h1 .beat-1 { animation: headline-reveal 0.95s ease forwards; }
.intro h1 .beat-2 { animation: headline-reveal 1.3s ease 1.3s forwards; }
@keyframes headline-reveal {
  to { clip-path: inset(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce) {
  .intro h1 .beat { animation: none; clip-path: none; }
  .x-button { animation: none; opacity: 1; }
}

/* Toolbar: chips + sort */
.toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 0 8px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.chip {
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.sort {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding-top: 8px;
}
.sort select {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

/* Grid + cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  padding: 16px 0 64px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(28, 26, 23, 0.08);
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 0;
}
.category {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
}
.card-date { font-size: 12.5px; color: var(--muted); }
.tweet-slot {
  padding: 6px 10px 10px;
  min-height: 200px;
  display: flex;
  justify-content: center;
  min-width: 0;
}
.tweet-slot > * { min-width: 0; }
.tweet-slot iframe, .tweet-slot twitter-widget {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
}
.tweet-slot .loading { color: var(--muted); font-size: 13px; padding: 40px 0; }
.tweet-slot iframe, .tweet-slot twitter-widget { max-width: 100% !important; }

.empty { text-align: center; color: var(--muted); padding: 40px 0 80px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 48px;
  color: var(--muted);
  font-size: 13px;
}
.footer-note {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 680px) {
  .footer-note { font-size: clamp(6px, 1.95vw, 12px); }
}

@media (max-width: 640px) {
  .intro { padding-top: 18px; }
  .grid { grid-template-columns: 1fr; }
  .toolbar { display: flex; flex-direction: column; gap: 12px; }
  .filters { width: 100%; }
  .sort { align-self: flex-end; padding-top: 0; margin-bottom: 0; }
  .chip { min-height: 44px; }
  .card-meta { flex-wrap: wrap; gap: 6px; }
}
