@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&display=swap');

/* Social Archive - Minimal Archival Design */
/* Carried forward from /status/assets/styles.css, extended for SPA */

:root {
  --text: #1b1b1b;
  --text-muted: #687076;
  --bg: #f5f8fa;
  --card-bg: #fff;
  --border: #cdd5db;
  --link: #0085ff;
  --link-hover: #0066cc;
  --accent: #e9eef2;
  --source-bg: #e8f4ff;
  --source-border: #b8dcff;
  --source-text: #0066cc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header */
header {
  margin-bottom: 2rem;
}

.back {
  font-size: 0.875rem;
  color: var(--text-muted);
}

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

/* Tweet Article */
.tweet {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.main-tweet {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.tweet:first-child {
  padding-top: 0;
}

/* main-tweet card styles are now in the base .main-tweet above */

.reply-to {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.tweet-content {
  font-size: 1.125rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  word-wrap: break-word;
}

.tweet-content a {
  word-break: break-all;
}

.mention, .hashtag {
  color: var(--link);
}

/* Media */
.media-gallery {
  margin: 1rem 0;
}

.media-gallery img,
.media-gallery video {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  margin-bottom: 0.5rem;
}

.video-thumb {
  opacity: 0.9;
}

.geo-line {
  margin: 0.5rem 0;
  font-size: 0.85rem;
}

.geo-line a {
  color: var(--text-muted);
  text-decoration: none;
}

.geo-line a:hover {
  color: var(--link);
}

.load-more {
  display: block;
  width: 100%;
  padding: 0.75rem;
  margin: 0.5rem 0;
  background: var(--accent);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
}

.load-more:hover {
  background: var(--border);
  color: var(--text);
}

.external-media {
  border: 1px dashed var(--border);
}

/* Footer */
.tweet footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.engagement {
  margin: 0;
}

time {
  color: var(--text-muted);
}

/* Thread UI */
.thread-toggle {
  display: inline-block;
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  background: var(--accent);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text);
}

.thread-toggle:hover {
  background: var(--border);
}

.thread-toggle.loading {
  opacity: 0.6;
  cursor: wait;
}

.thread-ancestors,
.thread-descendants {
  border-left: 2px solid var(--link);
  margin-left: 0.5rem;
  padding-left: 1rem;
}

.thread-ancestors:empty,
.thread-descendants:empty {
  display: none;
}

.thread-ancestors .tweet,
.thread-descendants .tweet {
  border-bottom: none;
  padding: 1rem 0;
}

/* Site Footer */
.site-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Landing Page */
.landing header {
  text-align: center;
  margin-bottom: 2rem;
}

.landing h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--link);
}

.subtitle {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Stats */
.stats {
  margin: 2rem 0;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.stats dl {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
  justify-content: center;
}

.stats dl > div {
  text-align: center;
  min-width: 80px;
}

.stats dt {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stats dd {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--link);
}

/* Search */
.search-section {
  margin: 2rem 0;
}

#search {
  width: 100%;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  color: var(--text);
}

#search:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(0, 133, 255, 0.15);
}

#search-results {
  margin-top: 1rem;
}

#search-results:empty {
  display: none;
}

#search-results .no-results {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
}

.results-count {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

/* Recent / Tweet List */
.recent h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.tweet-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tweet-preview {
  display: block;
  padding: 1rem;
  margin: 0 -1rem;
  border-bottom: none;
  border-radius: 12px;
  margin-bottom: 4px;
  background: var(--card-bg);
  color: var(--text);
  text-decoration: none;
}

.tweet-preview:hover {
  background: #e8f4ff;
  text-decoration: none;
}

.tweet-preview .date {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.tweet-preview .text {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.tweet-preview .text a {
  color: var(--link);
  pointer-events: none;
}

mark {
  background: rgba(0, 133, 255, 0.15);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

/* Source badge */
.source-badge {
  display: inline-block;
  font-size: 0.6875rem;
  padding: 1px 6px;
  border-radius: 12px;
  background: var(--source-bg, var(--accent));
  color: var(--source-text, var(--text-muted));
  border: 1px solid var(--source-border, var(--border));
  vertical-align: middle;
  margin-left: 0.5rem;
  text-transform: capitalize;
}

/* Link Preview Cards */
.link-card {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 0.75rem 0;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

.link-card:hover {
  border-color: var(--link);
  text-decoration: none;
}

.link-card-image {
  width: 120px;
  min-height: 80px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--accent);
}

.link-card-body {
  padding: 0.625rem 0.75rem;
  min-width: 0;
  flex: 1;
}

.link-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.link-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.link-card-domain {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Link card skeleton shimmer */
.link-card-skeleton {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 0.75rem 0;
  height: 80px;
}

.link-card-skeleton .shimmer {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 25%, #e8e8e8 50%, var(--accent) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Dead link indicator */
.link-dead {
  opacity: 0.5;
  text-decoration: line-through;
}

.link-dead-note {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Year browser */
.year-browser {
  margin: 2rem 0;
}

.year-browser h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--text-muted);
}

.year-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.year-btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}

.year-btn:hover {
  background: var(--accent);
  text-decoration: none;
}

.year-btn.active {
  background: var(--link);
  color: white;
  border-color: var(--link);
}

.year-btn .count {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

.year-btn.active .count {
  color: rgba(255,255,255,0.7);
}

/* Loading state */
.loading-msg {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

/* ================================================================
   Theme Switcher Pill
   ================================================================ */

#theme-switcher {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  border-radius: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.theme-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s, border-color 0.15s;
}

.theme-swatch:hover {
  transform: scale(1.2);
}

.theme-swatch.active {
  border-color: var(--text);
  transform: scale(1.15);
}


/* ================================================================
   Theme: Terminal — dark, monospace, archival hacker energy
   ================================================================ */

.theme-mono {
  --text: #d4d4d4;
  --text-muted: #707070;
  --bg: #121212;
  --card-bg: #1a1a1a;
  --border: #2a2a2a;
  --link: #33ff99;
  --link-hover: #66ffbb;
  --accent: #1a1a1a;
  --source-bg: #1a2a1a;
  --source-border: #2a4a2a;
  --source-text: #33ff99;
}

.theme-mono body {
  font-family: "JetBrains Mono", "SF Mono", "Fira Code", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
}

.theme-mono .container {
  max-width: 680px;
}

.theme-mono .landing h1 {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.75rem;
  color: var(--link);
}

.theme-mono .subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.theme-mono .subtitle::before {
  content: "> ";
  color: var(--link);
}

.theme-mono .stats {
  background: var(--accent);
  border: 1px solid var(--border);
  border-radius: 0;
}

.theme-mono .stats dt {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: lowercase;
}

.theme-mono .stats dd {
  font-family: "JetBrains Mono", monospace;
  color: var(--link);
}

.theme-mono .main-tweet {
  border-radius: 0;
  box-shadow: none;
}

.theme-mono .tweet-content {
  font-size: 0.9375rem;
  line-height: 1.65;
}

.theme-mono .tweet {
  border-bottom-color: var(--border);
}

.theme-mono .tweet-preview {
  border-bottom-color: var(--border);
  border-radius: 0;
  color: var(--text);
}

.theme-mono .tweet-preview:hover {
  background: var(--accent);
  border-color: var(--border);
}

.theme-mono .tweet-preview .date {
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6875rem;
}

.theme-mono .tweet-preview .text {
  font-size: 0.875rem;
}

.theme-mono a {
  color: var(--link);
}

.theme-mono a:hover {
  color: var(--link-hover);
  text-decoration: none;
}

.theme-mono .mention {
  color: #66ccff;
}

.theme-mono .hashtag {
  color: #ffcc33;
}

.theme-mono #search {
  background: var(--accent);
  color: var(--text);
  border-color: var(--border);
  border-radius: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
}

.theme-mono #search::placeholder {
  color: var(--text-muted);
}

.theme-mono #search:focus {
  border-color: var(--link);
  box-shadow: 0 0 0 1px var(--link);
}

.theme-mono .year-btn {
  border-radius: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8125rem;
  background: var(--accent);
  border-color: var(--border);
  color: var(--text);
}

.theme-mono .year-btn:hover {
  background: var(--border);
  border-color: var(--link);
}

.theme-mono .year-btn.active {
  background: var(--link);
  color: #000;
  border-color: var(--link);
  font-weight: 600;
}

.theme-mono .year-btn .count {
  color: var(--text-muted);
}

.theme-mono .year-btn.active .count {
  color: rgba(0,0,0,0.5);
}

.theme-mono .source-badge {
  background: var(--source-bg);
  border-color: var(--source-border);
  color: var(--source-text);
  border-radius: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.625rem;
}

.theme-mono .link-card {
  border-radius: 0;
  border-color: var(--border);
  background: var(--accent);
}

.theme-mono .link-card:hover {
  border-color: var(--link);
}

.theme-mono .link-card-image {
  background-color: var(--border);
}

.theme-mono .link-card-title {
  color: var(--text);
}

.theme-mono .link-card-desc {
  color: var(--text-muted);
}

.theme-mono .link-card-domain {
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
}

.theme-mono .link-card-skeleton {
  border-radius: 0;
  border-color: var(--border);
}

.theme-mono .link-card-skeleton .shimmer {
  background: linear-gradient(90deg, var(--accent) 25%, var(--border) 50%, var(--accent) 75%);
  background-size: 200% 100%;
}

.theme-mono .media-gallery img,
.theme-mono .media-gallery video {
  border-radius: 0;
  border: 1px solid var(--border);
}

.theme-mono .geo-line a {
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
}

.theme-mono .geo-line a:hover {
  color: var(--link);
}

.theme-mono .load-more {
  background: var(--accent);
  border-color: var(--border);
  color: var(--text-muted);
  border-radius: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8125rem;
}

.theme-mono .load-more:hover {
  background: var(--border);
  color: var(--link);
  border-color: var(--link);
}

.theme-mono mark {
  background: rgba(51, 255, 153, 0.2);
  color: var(--link);
}

.theme-mono .thread-ancestors,
.theme-mono .thread-descendants {
  border-left-color: var(--border);
}

.theme-mono .site-footer {
  border-top-color: var(--border);
}

.theme-mono .back {
  color: var(--text-muted);
}

.theme-mono .back:hover {
  color: var(--link);
}

.theme-mono time {
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8125rem;
}

.theme-mono .reply-to {
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8125rem;
}

.theme-mono .recent h2,
.theme-mono .year-browser h2 {
  font-family: "JetBrains Mono", monospace;
  color: var(--text-muted);
  text-transform: lowercase;
  font-size: 0.875rem;
}

.theme-mono .recent h2::before,
.theme-mono .year-browser h2::before {
  content: "# ";
  color: var(--link);
}

.theme-mono .results-count {
  font-family: "JetBrains Mono", monospace;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.theme-mono #theme-switcher {
  background: rgba(18,18,18,0.9);
  border-color: var(--border);
}

.theme-mono .theme-swatch.active {
  border-color: var(--link);
}


/* ================================================================
   Theme: Fruity Bits — bright, playful, fun but readable
   ================================================================ */

.theme-fruity {
  --text: #2a1a3a;
  --text-muted: #7a5a9a;
  --bg: #fff5f0;
  --card-bg: #fff;
  --border: #f0c8e0;
  --link: #e8198b;
  --link-hover: #cc1177;
  --accent: #fff0f5;
  --source-bg: #f0e8ff;
  --source-border: #d8c0f0;
  --source-text: #8833cc;
}

.theme-fruity body {
  font-family: "Avenir Next", "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.theme-fruity .container {
  max-width: 620px;
}

.theme-fruity .landing h1 {
  font-weight: 800;
  font-size: 2.25rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #e8198b, #ff6633, #ffcc00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.theme-fruity .subtitle {
  color: var(--text-muted);
  font-weight: 500;
}

.theme-fruity .stats {
  background: linear-gradient(135deg, #fff0f5, #f0e8ff, #e8f4ff);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.theme-fruity .stats dd {
  color: var(--link);
  font-weight: 700;
}

.theme-fruity .tweet-content {
  font-size: 1.0625rem;
  line-height: 1.65;
}

.theme-fruity .tweet {
  border-bottom-color: var(--border);
}

.theme-fruity .tweet-preview {
  border-bottom-color: var(--border);
  color: var(--text);
}

.theme-fruity .tweet-preview:hover {
  background: linear-gradient(135deg, #fff5f0, #fff0f5);
}

.theme-fruity a {
  color: var(--link);
}

.theme-fruity a:hover {
  color: var(--link-hover);
}

.theme-fruity .mention {
  color: #8833cc;
}

.theme-fruity .hashtag {
  color: #ff6633;
}

.theme-fruity #search {
  border-radius: 24px;
  padding: 0.75rem 1.25rem;
  border-color: var(--border);
  background: var(--card-bg);
  color: var(--text);
}

.theme-fruity #search::placeholder {
  color: var(--text-muted);
}

.theme-fruity #search:focus {
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(232, 25, 139, 0.12);
}

.theme-fruity .year-btn {
  border-radius: 24px;
  font-weight: 600;
  border-color: var(--border);
  background: var(--card-bg);
  color: var(--text);
}

.theme-fruity .year-btn:hover {
  background: var(--accent);
  border-color: var(--link);
}

.theme-fruity .year-btn.active {
  background: linear-gradient(135deg, #e8198b, #ff6633);
  color: #fff;
  border-color: transparent;
}

.theme-fruity .year-btn .count {
  color: var(--text-muted);
}

.theme-fruity .year-btn.active .count {
  color: rgba(255,255,255,0.75);
}

.theme-fruity .source-badge {
  background: var(--source-bg);
  border-color: var(--source-border);
  color: var(--source-text);
  border-radius: 12px;
  font-weight: 600;
}

.theme-fruity .link-card {
  border-radius: 16px;
  border-color: var(--border);
  background: var(--card-bg);
}

.theme-fruity .link-card:hover {
  border-color: var(--link);
  box-shadow: 0 2px 12px rgba(232, 25, 139, 0.1);
}

.theme-fruity .link-card-image {
  background-color: var(--accent);
}

.theme-fruity .link-card-title {
  color: var(--text);
}

.theme-fruity .link-card-skeleton {
  border-radius: 16px;
}

.theme-fruity .link-card-skeleton .shimmer {
  background: linear-gradient(90deg, var(--accent) 25%, #f8e0f0 50%, var(--accent) 75%);
  background-size: 200% 100%;
}

.theme-fruity .media-gallery img,
.theme-fruity .media-gallery video {
  border-radius: 16px;
  border: 2px solid var(--border);
}

.theme-fruity .geo-line a {
  color: var(--text-muted);
}

.theme-fruity .geo-line a:hover {
  color: var(--link);
}

.theme-fruity .load-more {
  border-radius: 24px;
  font-weight: 600;
  background: var(--card-bg);
  border-color: var(--border);
  color: var(--text-muted);
}

.theme-fruity .load-more:hover {
  background: var(--accent);
  color: var(--link);
  border-color: var(--link);
}

.theme-fruity mark {
  background: rgba(232, 25, 139, 0.15);
  color: var(--text);
}

.theme-fruity .thread-ancestors,
.theme-fruity .thread-descendants {
  border-left-color: var(--link);
  border-left-width: 2px;
}

.theme-fruity .site-footer {
  border-top-color: var(--border);
}

.theme-fruity .back {
  color: var(--text-muted);
}

.theme-fruity .back:hover {
  color: var(--link);
}

.theme-fruity time {
  color: var(--text-muted);
}

.theme-fruity .reply-to {
  color: var(--text-muted);
}

.theme-fruity .recent h2,
.theme-fruity .year-browser h2 {
  color: var(--text-muted);
  font-weight: 700;
}

.theme-fruity .results-count {
  color: var(--text-muted);
}

.theme-fruity #theme-switcher {
  background: rgba(255,245,240,0.95);
  border-color: var(--border);
}


/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 480px) {
  .container {
    padding: 1rem;
  }

  .tweet-content {
    font-size: 1rem;
  }

  .stats dl > div {
    min-width: 70px;
  }

  .link-card-image {
    width: 80px;
  }

  #theme-switcher {
    top: 0.5rem;
    right: 0.5rem;
  }
}
