@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500;600;700&family=Source+Sans+3:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
::selection { background: rgba(200,160,78,0.3); color: #F5F0E6; }
html { scroll-behavior: smooth; }
body { min-height: 100vh; background: #1A1A22; color: #E8E4DC; font-family: 'Source Sans 3', -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; border: none; background: none; cursor: pointer; }

/* ══════ TOPBAR ══════ */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-logo { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; object-fit: cover; }
.topbar-brand { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: rgba(200,160,78,0.6); letter-spacing: 3px; text-transform: uppercase; font-weight: 600; }
.topbar-nav { display: flex; gap: 6px; align-items: center; }
.topbar-link { padding: 5px 12px; border-radius: 6px; font-size: 11px; font-family: 'JetBrains Mono', monospace; font-weight: 500; color: rgba(245,242,238,0.5); transition: all 0.2s; }
.topbar-link:hover { color: rgba(245,242,238,0.8); background: rgba(255,255,255,0.04); }
.topbar-link.active { color: #D4AD4E; background: rgba(200,160,78,0.1); }
.topbar-link.tipeee { color: #E84B53; }
.topbar-link.tipeee:hover { background: rgba(232,75,83,0.1); }

/* ══════ HERO ══════ */
.hero { text-align: center; padding: 40px 0 32px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.hero h1 { font-family: 'Lora', serif; font-size: clamp(24px, 4vw, 36px); font-weight: 700; line-height: 1.3; margin: 0 0 12px; color: #F0ECE4; }
.hero-subtitle { color: rgba(245,242,238,0.55); font-size: 16px; max-width: 600px; margin: 0 auto 8px; line-height: 1.6; }
.hero-hint { color: rgba(245,242,238,0.35); font-size: 13px; margin: 0 auto 20px; max-width: 500px; }
.hero-stats { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.hero-stat { display: flex; align-items: baseline; gap: 6px; }
.hero-stat-val { font-family: 'JetBrains Mono', monospace; font-size: 20px; font-weight: 700; color: #C8A04E; }
.hero-stat-label { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: rgba(245,242,238,0.4); letter-spacing: 1px; text-transform: uppercase; }

/* ══════ TOOLBAR ══════ */
.toolbar { display: flex; align-items: center; justify-content: space-between; padding: 20px 0 16px; gap: 16px; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 250px; }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 15px; color: rgba(200,160,78,0.35); }
.search-input { width: 100%; padding: 12px 16px 12px 42px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; color: #E8E4DC; font-size: 15px; font-family: 'Source Sans 3', sans-serif; outline: none; transition: all 0.3s; }
.search-input:focus { border-color: rgba(200,160,78,0.45); background: rgba(255,255,255,0.07); }
.search-input::placeholder { color: rgba(240,236,228,0.3); }
.type-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.type-btn { display: flex; align-items: center; gap: 5px; padding: 8px 16px; border-radius: 8px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); color: rgba(245,242,238,0.6); font-size: 12px; font-family: 'JetBrains Mono', monospace; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.type-btn:hover { border-color: rgba(200,160,78,0.2); color: rgba(245,242,238,0.8); }
.type-btn.active { background: rgba(200,160,78,0.14); border-color: rgba(200,160,78,0.4); color: #D4AD4E; font-weight: 700; }

/* ══════ FILTER BAR ══════ */
.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.05); align-items: center; }
.filter-select { padding: 6px 28px 6px 10px; border-radius: 6px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); color: rgba(245,242,238,0.6); font-size: 11px; font-family: 'JetBrains Mono', monospace; font-weight: 500; cursor: pointer; outline: none; transition: all 0.2s; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23888' d='M2 3l3 4 3-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }
.filter-select:focus { border-color: rgba(200,160,78,0.35); }
.filter-select option { background: #1A1A22; color: #E8E4DC; }
.theme-btn { padding: 5px 12px; border-radius: 6px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); color: rgba(245,242,238,0.5); font-size: 11px; font-family: 'JetBrains Mono', monospace; font-weight: 500; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.theme-btn:hover { border-color: rgba(200,160,78,0.2); color: rgba(245,242,238,0.7); }
.theme-btn.active { background: rgba(200,160,78,0.12); border-color: rgba(200,160,78,0.35); color: #D4AD4E; font-weight: 700; }
.sort-btn { padding: 5px 12px; border-radius: 6px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); color: rgba(140,200,190,0.7); font-size: 11px; font-family: 'JetBrains Mono', monospace; font-weight: 500; cursor: pointer; transition: all 0.2s; white-space: nowrap; margin-left: auto; }
.sort-btn:hover { border-color: rgba(140,200,190,0.3); color: rgba(140,200,190,0.9); }
.reset-btn { padding: 5px 12px; border-radius: 6px; border: none; background: none; color: rgba(232,75,83,0.5); font-size: 11px; font-family: 'JetBrains Mono', monospace; font-weight: 500; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.reset-btn:hover { color: rgba(232,75,83,0.8); }

/* ══════ RESULTS ══════ */
.results-bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 12px; }
.results-count { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: rgba(245,242,238,0.5); }
.results-count strong { color: #C8A04E; font-weight: 700; }

/* ══════ GRID ══════ */
.archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; padding-bottom: 32px; }

/* ══════ CARDS ══════ */
.archive-card { background: rgba(255,255,255,0.055); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; overflow: hidden; transition: all 0.25s; cursor: pointer; display: block; }
.archive-card:hover { border-color: rgba(200,160,78,0.25); background: rgba(255,255,255,0.07); }

.card-visual {
  width: 100%; aspect-ratio: 16/9; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: #111;
}
.card-thumb {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s, opacity 0.3s;
}
.archive-card:hover .card-thumb { transform: scale(1.03); opacity: 0.85; }
.card-visual.thumb-error .card-thumb { display: none; }
.card-visual.thumb-error { background: rgba(255,255,255,0.03); }
.card-visual.thumb-error::after {
  content: '·'; font-size: 28px; opacity: 0.15; font-family: 'Lora', serif;
}
.card-visual-fallback {
  display: flex; align-items: center; justify-content: center;
}
.card-visual-fallback.video-visual {
  background: linear-gradient(135deg, rgba(180,160,140,0.12) 0%, rgba(140,130,120,0.08) 100%);
}
.card-visual-fallback.article-visual {
  background: linear-gradient(135deg, rgba(140,155,170,0.12) 0%, rgba(120,140,160,0.08) 100%);
}
.card-visual-icon {
  font-size: 32px; opacity: 0.2; font-family: 'Lora', serif; line-height: 1;
}
.card-type-badge {
  position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.card-type-badge.video { background: rgba(180,160,140,0.85); color: #F0ECE4; }
.card-type-badge.article { background: rgba(140,155,170,0.85); color: #F0ECE4; }
.card-body { padding: 16px 18px 18px; }
.card-date { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: rgba(200,160,78,0.5); margin-bottom: 6px; }
.card-title { font-family: 'Lora', serif; font-size: 16px; font-weight: 700; line-height: 1.4; color: #F0ECE4; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-title mark { background: rgba(200,160,78,0.3); color: #F0ECE4; padding: 0 2px; border-radius: 2px; }
.card-desc { font-size: 14px; line-height: 1.6; color: rgba(245,242,238,0.6); margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-desc mark { background: rgba(200,160,78,0.25); color: rgba(245,242,238,0.8); padding: 0 2px; border-radius: 2px; }
.card-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.card-tag { padding: 2px 8px; border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; background: rgba(200,160,78,0.08); border: 1px solid rgba(200,160,78,0.15); color: rgba(200,160,78,0.6); }
.card-link-row { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.04); font-family: 'JetBrains Mono', monospace; font-size: 10px; color: rgba(140,200,190,0.5); transition: color 0.2s; }
.archive-card:hover .card-link-row { color: rgba(140,200,190,0.8); }

/* ══════ MODAL ══════ */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 9999; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-overlay.active { display: flex; }
.modal-content { width: min(900px, 92vw); max-height: 90vh; overflow-y: auto; background: #1A1A22; border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; position: relative; }
.modal-close { position: sticky; top: 0; float: right; z-index: 10; margin: 12px 14px 0 0; width: 32px; height: 32px; border-radius: 8px; background: rgba(255,255,255,0.08); color: rgba(245,242,238,0.6); font-size: 16px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; border: none; }
.modal-close:hover { background: rgba(232,75,83,0.2); color: #E84B53; }
.modal-media { width: 100%; background: #000; }
.modal-media iframe { width: 100%; aspect-ratio: 16/9; border: none; display: block; }
.modal-media.article-media { background: linear-gradient(135deg, rgba(140,155,170,0.15) 0%, rgba(100,120,140,0.08) 100%); display: flex; align-items: center; justify-content: center; padding: 32px; min-height: 80px; }
.modal-media.article-media .modal-type-label { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: rgba(140,155,170,0.5); }
.modal-body { padding: 20px 24px 24px; }
.modal-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.modal-meta-badge { padding: 4px 10px; border-radius: 6px; font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.modal-meta-badge.video { background: rgba(180,160,140,0.85); color: #F0ECE4; }
.modal-meta-badge.article { background: rgba(140,155,170,0.85); color: #F0ECE4; }
.modal-meta-date { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: rgba(200,160,78,0.6); }
.modal-title { font-family: 'Lora', serif; font-size: 20px; font-weight: 700; line-height: 1.4; color: #F0ECE4; margin-bottom: 16px; }
.modal-text { font-size: 15px; line-height: 1.7; color: rgba(245,242,238,0.7); margin-bottom: 16px; white-space: pre-line; }
.modal-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 16px; }
.modal-tags .card-tag { font-size: 10px; padding: 3px 10px; }
.modal-source-link { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 8px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); font-family: 'JetBrains Mono', monospace; font-size: 12px; color: rgba(140,200,190,0.7); transition: all 0.2s; }
.modal-source-link:hover { border-color: rgba(200,160,78,0.3); color: rgba(200,160,78,0.9); }

/* ══════ PAGINATION ══════ */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 12px 0 40px; }
.page-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); color: rgba(245,242,238,0.6); padding: 9px 16px; border-radius: 8px; font-size: 12px; cursor: pointer; font-family: 'JetBrains Mono', monospace; transition: all 0.2s; }
.page-btn:hover { border-color: rgba(200,160,78,0.3); color: rgba(245,242,238,0.8); }
.page-btn.active { background: rgba(200,160,78,0.15); border-color: rgba(200,160,78,0.4); color: #C8A04E; font-weight: 700; }
.page-btn:disabled { opacity: 0.3; cursor: default; }
.page-info { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: rgba(245,242,238,0.3); }

/* ══════ FOOTER ══════ */
footer { text-align: center; padding: 28px 0 20px; border-top: 1px solid rgba(255,255,255,0.06); }
.footer-brand { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: rgba(200,160,78,0.3); letter-spacing: 3px; text-transform: uppercase; margin-bottom: 10px; }
.footer-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.footer-links a { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: rgba(245,242,238,0.25); transition: color 0.2s; }
.footer-links a:hover { color: rgba(200,160,78,0.5); }
.footer-copy { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: rgba(245,242,238,0.15); }

/* ══════ LOADING ══════ */
.loading { text-align: center; padding: 80px 20px; grid-column: 1 / -1; }
.loading-text { color: rgba(200,160,78,0.5); font-size: 14px; }
@keyframes pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }
.loading-dots { animation: pulse 1.5s ease-in-out infinite; }
.empty { text-align: center; padding: 60px 20px; color: rgba(245,242,238,0.25); font-size: 14px; grid-column: 1 / -1; }

/* ══════ MOBILE ══════ */
@media (max-width: 768px) {
  .topbar { flex-direction: column; gap: 10px; align-items: flex-start; }
  .topbar-nav { flex-wrap: wrap; }
  .hero { padding: 28px 0 24px; }
  .hero h1 { font-size: 24px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .type-filters { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .type-filters::-webkit-scrollbar { display: none; }
  .filter-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .filter-bar::-webkit-scrollbar { display: none; }
  .archive-grid { grid-template-columns: 1fr; }
  .card-title { font-size: 15px; }
  .modal-content { width: 96vw; border-radius: 12px; }
  .modal-title { font-size: 17px; }
  .modal-body { padding: 16px; }
}
