/* Mad Bitcoins History — Main Stylesheet */

:root {
  --btc-orange: #F7931A;
  --btc-orange-dark: #E8851A;
  --btc-orange-light: #FFB347;
  --twitter-blue: #1DA1F2;
  --twitter-blue-dark: #1A8CD8;
  --bg-primary: #0D0D0D;
  --bg-secondary: #161616;
  --bg-card: #1A1A1A;
  --bg-elevated: #222222;
  --text-primary: #F0F0F0;
  --text-secondary: #A0A0A0;
  --text-muted: #666666;
  --border-color: #2A2A2A;
  --border-accent: #333333;
  --red: #E74C3C;
  --green: #2ECC71;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --max-width: 1280px;
  --header-height: 64px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--btc-orange); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--btc-orange-light); }

img { max-width: 100%; display: block; }

/* === MOCK DATA BANNER === */
.mock-banner {
  background: repeating-linear-gradient(45deg, #1a1200, #1a1200 10px, #1f1500 10px, #1f1500 20px);
  border-bottom: 2px solid var(--btc-orange);
  padding: 10px 20px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--btc-orange);
  position: sticky;
  top: 0;
  z-index: 1000;
  letter-spacing: 0.02em;
}
.mock-banner span { font-weight: 700; }
.mock-banner.real-data {
  background: repeating-linear-gradient(45deg, #0a1a0a, #0a1a0a 10px, #0d1f0d 10px, #0d1f0d 20px);
  border-bottom: 2px solid var(--green);
  color: var(--green);
}

/* === HEADER / NAV === */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 38px;
  z-index: 999;
  height: var(--header-height);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--btc-orange);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #000;
  font-family: var(--font-mono);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.logo-text .accent { color: var(--btc-orange); }

nav { display: flex; align-items: center; gap: 4px; }

nav a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  padding: 8px 14px;
  border-radius: 6px;
  transition: all 0.2s;
  font-weight: 500;
}

nav a:hover, nav a.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

nav a.active { color: var(--btc-orange); }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
}

/* === LAYOUT === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.page-content { padding: 40px 0 80px; }

/* === TYPOGRAPHY === */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--btc-orange);
  font-weight: 600;
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.5;
  max-width: 600px;
}

/* === HERO === */
.hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border-color);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

.hero-title .accent { color: var(--btc-orange); }

.hero-description {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}

.hero-stats {
  display: flex;
  gap: 32px;
}

.stat { text-align: left; }

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--btc-orange);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.hero-featured {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.hero-featured::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--btc-orange), var(--btc-orange-light));
}

/* === ARTICLE CARDS === */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 28px;
  transition: all 0.25s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.article-card:hover {
  border-color: var(--btc-orange);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(247, 147, 26, 0.1);
}

.article-card .topic-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--btc-orange);
  margin-bottom: 12px;
}

.article-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.article-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* === TWEET CARDS (Twitter-like) === */
.tweet-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  transition: background 0.15s;
  cursor: default;
}

.tweet-card:hover { background: var(--bg-elevated); }

/* Reply context line */
.tweet-reply-context {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding-left: 52px;
}

.tweet-reply-context svg { flex-shrink: 0; }

.tweet-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tweet-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--btc-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  color: #000;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.tweet-body { flex: 1; min-width: 0; }

.tweet-name-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  line-height: 1.3;
}

.tweet-display-name {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.tweet-username {
  color: var(--text-muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.tweet-dot {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.tweet-date {
  color: var(--text-muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.tweet-date:hover { text-decoration: underline; }

.tweet-text {
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 4px 0 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  color: var(--text-primary);
}

.tweet-text .hashtag { color: var(--btc-orange); }
.tweet-text .mention { color: var(--btc-orange); }
.tweet-text .t-link { color: var(--btc-orange); }

/* Media grid */
.tweet-media {
  margin-top: 12px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  display: grid;
  gap: 2px;
}

.tweet-media.media-1 { grid-template-columns: 1fr; }
.tweet-media.media-2 { grid-template-columns: 1fr 1fr; }
.tweet-media.media-3 { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
.tweet-media.media-3 .tweet-media-item:first-child { grid-row: 1 / 3; }
.tweet-media.media-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.tweet-media-item {
  position: relative;
  overflow: hidden;
  background: #000;
}

.tweet-media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
  max-height: 340px;
}

.tweet-media.media-1 .tweet-media-item img { max-height: 480px; object-fit: contain; background: #000; }
.tweet-media.media-2 .tweet-media-item img { max-height: 280px; }
.tweet-media.media-3 .tweet-media-item img,
.tweet-media.media-4 .tweet-media-item img { max-height: 200px; }

.tweet-media-item img:hover { opacity: 0.92; }

.tweet-media-item img[data-error="true"] {
  display: none;
}

/* Video play badge */
.tweet-media-item .video-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tweet-media-item video {
  width: 100%;
  max-height: 480px;
  border-radius: 0;
  display: block;
  background: #000;
}

/* Metrics bar */
.tweet-metrics {
  display: flex;
  gap: 4px;
  margin-top: 12px;
  padding-top: 4px;
}

.tweet-metric {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: all 0.15s;
  cursor: pointer;
}

.tweet-metric:hover { background: rgba(255, 255, 255, 0.05); }
.tweet-metric.replies:hover { color: #1DA1F2; background: rgba(29, 161, 242, 0.08); }
.tweet-metric.retweets:hover { color: var(--green); background: rgba(46, 204, 113, 0.08); }
.tweet-metric.likes:hover { color: #E0245E; background: rgba(224, 36, 94, 0.08); }

.tweet-metric svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.tweet-metric .metric-count {
  font-size: 0.82rem;
  font-family: var(--font-body);
}

/* === TOPIC CHIPS === */
.topics-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.topic-chip:hover, .topic-chip.active {
  border-color: var(--btc-orange);
  color: var(--btc-orange);
  background: rgba(247, 147, 26, 0.08);
}

/* === SEARCH BAR === */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 20px;
  gap: 12px;
  margin-bottom: 24px;
  transition: border-color 0.2s;
}

.search-bar:focus-within { border-color: var(--btc-orange); }

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-body);
  outline: none;
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-icon { color: var(--text-muted); font-size: 1.1rem; }

/* === FILTER BAR === */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filter-bar select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
}

.filter-bar select:focus { border-color: var(--btc-orange); outline: none; }

.results-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* === TIMELINE === */
.timeline {
  position: relative;
  padding: 40px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: var(--border-color);
  top: 0;
}

.timeline-item {
  display: flex;
  align-items: center;
  margin-bottom: 48px;
  position: relative;
}

.timeline-item:nth-child(odd) { flex-direction: row-reverse; }

.timeline-content {
  width: 45%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 28px;
  position: relative;
  transition: all 0.25s;
}

.timeline-content:hover {
  border-color: var(--btc-orange);
  box-shadow: 0 4px 16px rgba(247, 147, 26, 0.08);
}

.timeline-dot {
  width: 16px;
  height: 16px;
  background: var(--btc-orange);
  border: 3px solid var(--bg-primary);
  border-radius: 50%;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--btc-orange);
  font-weight: 700;
  margin-bottom: 6px;
}

.timeline-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.timeline-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 12px;
}

.timeline-milestone {
  display: inline-block;
  background: rgba(247, 147, 26, 0.12);
  color: var(--btc-orange);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 100px;
  font-weight: 600;
}

/* === BOOK CARDS (Old Twitter Aesthetic) === */
.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.book-card {
  background: linear-gradient(135deg, #15202B 0%, #1A2836 100%);
  border: 1px solid rgba(29, 161, 242, 0.2);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.book-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--twitter-blue), #66D9EF);
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(29, 161, 242, 0.15);
  border-color: var(--twitter-blue);
}

.book-bird {
  font-size: 2.5rem;
  margin-bottom: 16px;
  opacity: 0.6;
}

.book-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #FFFFFF;
}

.book-subtitle {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 16px;
  line-height: 1.4;
}

.book-meta {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--twitter-blue);
}

/* === BOOK PAGE (Old Twitter Tweet Style) === */
.book-page {
  background: #15202B;
  min-height: 100vh;
}

.book-page .mock-banner {
  background: repeating-linear-gradient(45deg, #0D1A27, #0D1A27 10px, #0F1D2B 10px, #0F1D2B 20px);
  border-color: var(--twitter-blue);
  color: var(--twitter-blue);
}

.book-page .site-header {
  background: #192734;
  border-color: rgba(29, 161, 242, 0.15);
}

.book-page nav a:hover,
.book-page nav a.active {
  color: var(--twitter-blue);
  background: rgba(29, 161, 242, 0.08);
}

.book-header {
  text-align: center;
  padding: 64px 0 48px;
  border-bottom: 1px solid rgba(29, 161, 242, 0.15);
}

.book-header .section-label { color: var(--twitter-blue); }

.old-tweet {
  background: #192734;
  border: 1px solid rgba(29, 161, 242, 0.12);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  transition: background 0.2s;
}

.old-tweet:hover { background: #1D2F3F; }

.old-tweet .tweet-avatar { background: var(--twitter-blue); }
.old-tweet .tweet-display-name { color: #FFFFFF; }
.old-tweet .tweet-username { color: #8899A6; }
.old-tweet .tweet-date { color: #8899A6; }
.old-tweet .tweet-dot { color: #8899A6; }
.old-tweet .tweet-text { color: #D9D9D9; }
.old-tweet .tweet-reply-context { color: #8899A6; }
.old-tweet .tweet-media { border-color: rgba(29, 161, 242, 0.15); }
.old-tweet .tweet-metric { color: #8899A6; }
.old-tweet .tweet-metric.replies:hover { color: #1DA1F2; }
.old-tweet .tweet-metric.retweets:hover { color: #17BF63; }
.old-tweet .tweet-metric.likes:hover { color: #E0245E; }

/* === FOOTER === */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 48px 0 32px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-brand .logo-text { font-size: 1.1rem; margin-bottom: 12px; }

.footer-description {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.footer-section h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-section a {
  display: block;
  color: var(--text-secondary);
  font-size: 0.88rem;
  padding: 4px 0;
  transition: color 0.2s;
}

.footer-section a:hover { color: var(--btc-orange); }

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* === TWEETS LIST === */
.tweets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* === TOPIC PAGE HEADER === */
.topic-header {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border-color);
}

.topic-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

/* === ARTICLE PAGE === */
.article-header {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--border-color);
  max-width: 720px;
}

.article-body {
  max-width: 720px;
  padding: 40px 0;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text-primary);
  margin: 40px 0 16px;
}

.article-body p { margin-bottom: 20px; }

.article-body blockquote {
  border-left: 3px solid var(--btc-orange);
  padding-left: 20px;
  margin: 28px 0;
  font-style: italic;
  color: var(--text-primary);
}

/* === PAGINATION === */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination button {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: all 0.2s;
}

.pagination button:hover,
.pagination button.active {
  border-color: var(--btc-orange);
  color: var(--btc-orange);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-title { font-size: 2.4rem; }
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .books-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .section-title { font-size: 1.5rem; }
  .articles-grid { grid-template-columns: 1fr; }
  .books-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }

  nav { display: none; }
  nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
  }

  .mobile-menu-btn { display: block; }

  .timeline::before { left: 20px; }
  .timeline-item,
  .timeline-item:nth-child(odd) { flex-direction: row; padding-left: 48px; }
  .timeline-content { width: 100%; }
  .timeline-dot { left: 20px; }

  .hero-stats { gap: 20px; }
  .stat-value { font-size: 1.4rem; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* === UTILITIES === */
.text-orange { color: var(--btc-orange); }
.text-muted { color: var(--text-muted); }
.mt-section { margin-top: 64px; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-accent); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Google Fonts import handled in HTML head */
