/* =====================================================
   Hop Proxy Ghost Theme — screen.css
   Design: dark minimal, emerald accent (#10b981)
   ===================================================== */

/* === Variables === */
:root {
  --bg:            #0a0a0b;
  --bg-2:          #141415;
  --surface-1:     rgba(255,255,255,0.03);
  --surface-2:     rgba(255,255,255,0.05);
  --surface-3:     rgba(255,255,255,0.08);
  --border:        rgba(255,255,255,0.08);
  --border-hi:     rgba(255,255,255,0.14);
  --border-accent: rgba(16,185,129,0.3);
  --text:          #ffffff;
  --text-2:        rgba(255,255,255,0.85);
  --text-muted:    rgba(255,255,255,0.5);
  --accent:        #10b981;
  --accent-dark:   #0ea572;
  --accent-soft:   rgba(16,185,129,0.12);
  --accent-glow:   rgba(16,185,129,0.35);
  --radius-sm:     10px;
  --radius:        16px;
  --radius-lg:     20px;
  --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  --max-w:         1200px;
  --content-w:     720px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; color: inherit; }

/* === Base === */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: -0.01em;
  min-height: 100vh;
}

.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1; }

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

/* =====================================================
   HEADER
   ===================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,11,0.8);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s ease;
}
.site-header.scrolled { box-shadow: 0 2px 32px rgba(0,0,0,0.5); }

.site-header .container {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 0;
}

/* Logo */
.site-logo { display: flex; align-items: center; flex-shrink: 0; margin-right: auto; }
.site-logo img { height: 28px; width: auto; }
.site-logo-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.75) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Search button */
.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  cursor: pointer;
}
.search-btn:hover {
  border-color: var(--border-accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.search-btn svg { flex-shrink: 0; }
.search-btn-label { display: none; }
@media (min-width: 480px) { .search-btn-label { display: inline; } }

/* Nav */
.site-nav { flex: 1; }
.site-nav ul, .site-nav .nav { display: flex; gap: 2px; list-style: none; }
.site-nav li a, .site-nav .nav-item a {
  display: block;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}
.site-nav li a:hover,
.site-nav .nav-item a:hover,
.site-nav .nav-current a { color: var(--text); background: var(--surface-2); }

/* CTA button */
.btn-cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 0 24px var(--accent-glow);
}
.btn-cta:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 0 32px var(--accent-glow);
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  margin-left: 12px;
  transition: all 0.15s;
}
.mobile-menu-btn:hover { border-color: var(--border-accent); color: var(--accent); }

/* =====================================================
   HERO
   ===================================================== */
.hero {
  position: relative;
  padding: 86px 0 72px;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px; left: 50%;
  transform: translateX(-50%);
  width: 700px; height: 500px;
  background: radial-gradient(ellipse at center, rgba(16,185,129,0.09) 0%, transparent 65%);
  pointer-events: none;
}
.hero-inner { max-width: 620px; margin: 0 auto; position: relative; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(34px, 5.5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(160deg, #fff 40%, rgba(255,255,255,0.6) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 460px;
  margin: 0 auto;
}

/* =====================================================
   POST GRID & CARDS
   ===================================================== */
.posts-section { padding: 48px 0 80px; }

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* First card spans full width (featured) */
.posts-grid > .post-card:first-child {
  grid-column: 1 / -1;
  flex-direction: row;
}
.posts-grid > .post-card:first-child .post-card-image { aspect-ratio: unset; min-height: 260px; flex: 1 1 40%; }
.posts-grid > .post-card:first-child .post-card-content { flex: 1 1 60%; }
.posts-grid > .post-card:first-child .post-card-title { font-size: 24px; }
.posts-grid > .post-card:first-child .post-card-excerpt { -webkit-line-clamp: 4; }

.post-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(145deg, rgba(255,255,255,0.035) 0%, rgba(255,255,255,0.015) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), box-shadow 0.3s ease, border-color 0.3s ease;
}
/* Accent line at top on hover */
.post-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 40%, var(--accent) 60%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.post-card:hover {
  transform: translateY(-5px);
  border-color: rgba(16,185,129,0.2);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(16,185,129,0.08), inset 0 1px 0 rgba(255,255,255,0.05);
}
.post-card:hover::after { opacity: 1; }

.post-card-image-link { display: block; overflow: hidden; flex-shrink: 0; }
.post-card-image { margin: 0; aspect-ratio: 16/9; overflow: hidden; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.post-card:hover .post-card-image img { transform: scale(1.05); }

.post-card-content {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-card-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.post-card-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.3;
}
.post-card-title a { transition: color 0.15s; }
.post-card-title a:hover { color: var(--accent); }

.post-card-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.post-card-meta { display: flex; align-items: center; gap: 8px; }
.post-card-author { font-weight: 500; }
.post-card-author:hover { color: var(--text); }
.author-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.post-card-date-time { display: flex; align-items: center; gap: 4px; }
.post-card-reading-time::before { content: '·'; margin-right: 4px; opacity: 0.5; }

/* No posts */
.no-posts { text-align: center; padding: 72px 24px; color: var(--text-muted); font-size: 16px; }

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 56px;
}
.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface-1);
  transition: all 0.15s;
  text-decoration: none;
}
.pagination-btn:hover {
  border-color: var(--border-accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
/* Legacy pagination fallback — hide page number text */
.pagination .page-number { display: none; }

/* =====================================================
   POST ARTICLE
   ===================================================== */
.post { padding-bottom: 80px; }

.post-header { padding: 60px 0 40px; }
.post-tag-meta { margin-bottom: 14px; }
.post-tag-link {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--border-accent);
  padding-bottom: 2px;
  transition: border-color 0.15s;
}
.post-tag-link:hover { border-color: var(--accent); }

.post-title {
  font-size: clamp(28px, 4.5vw, 50px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.12;
  margin-bottom: 18px;
}
.post-excerpt {
  font-size: 19px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 640px;
  margin-bottom: 28px;
}
.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: var(--text-muted);
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.post-author { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.author-link { display: flex; align-items: center; gap: 8px; transition: color 0.15s; }
.author-link .author-avatar { width: 32px; height: 32px; }
.author-link:hover { color: var(--text); }
.post-meta-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.separator { opacity: 0.3; }

.post-feature-image { margin-bottom: 40px; }
.post-feature-image .container { padding-top: 0; }
.post-feature-image img {
  width: 100%;
  max-height: 540px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.post-feature-image figcaption {
  font-size: 13px; color: var(--text-muted);
  text-align: center; margin-top: 10px;
}

/* =====================================================
   ARTICLE CONTENT
   ===================================================== */
.post-content { padding-bottom: 48px; }
.gh-content {
  max-width: var(--content-w);
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.78;
  color: var(--text-2);
}
.gh-content > * + * { margin-top: 1.5em; }

.gh-content h2 { font-size: 27px; font-weight: 700; letter-spacing: -0.03em; color: var(--text); margin-top: 2.2em; line-height: 1.25; }
.gh-content h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); margin-top: 2em; }
.gh-content h4 { font-size: 18px; font-weight: 600; color: var(--text); margin-top: 1.8em; }
.gh-content h2 + *, .gh-content h3 + *, .gh-content h4 + * { margin-top: 0.75em; }

.gh-content a { color: var(--accent); border-bottom: 1px solid var(--border-accent); transition: border-color 0.15s; }
.gh-content a:hover { border-color: var(--accent); }
.gh-content strong { color: var(--text); font-weight: 600; }

.gh-content ul, .gh-content ol { padding-left: 1.6em; }
.gh-content li + li { margin-top: 0.4em; }
.gh-content li::marker { color: var(--accent); }

.gh-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 16px 24px;
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2);
  font-style: italic;
}

.gh-content pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.65;
}
.gh-content code {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 0.875em;
  font-family: var(--font-mono);
  color: var(--accent);
}
.gh-content pre code { background: none; border: none; padding: 0; font-size: inherit; color: #e0e0e0; }

.gh-content img { border-radius: var(--radius); border: 1px solid var(--border); }
.gh-content figure { margin: 2em 0; }
.gh-content figcaption { font-size: 13px; color: var(--text-muted); text-align: center; margin-top: 8px; }
.gh-content hr { border: none; border-top: 1px solid var(--border); margin: 2.5em 0; }
.gh-content table { width: 100%; border-collapse: collapse; font-size: 15px; }
.gh-content th, .gh-content td { padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.gh-content th { font-weight: 600; color: var(--text); background: var(--surface-2); }
.gh-content tr:hover td { background: var(--surface-1); }

/* Ghost card types */
.gh-content .kg-width-wide {
  max-width: min(calc(100vw - 48px), 1100px);
  margin-left: calc(50% - min(calc(50vw - 24px), 550px));
}
.gh-content .kg-width-full {
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.gh-content .kg-callout-card {
  display: flex; gap: 16px;
  padding: 20px 24px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.gh-content .kg-callout-emoji { font-size: 24px; flex-shrink: 0; line-height: 1.4; }
.gh-content .kg-bookmark-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}
.gh-content .kg-bookmark-card:hover { border-color: var(--border-accent); }
.gh-content .kg-bookmark-container { display: flex; color: var(--text-2); }
.gh-content .kg-bookmark-content { flex: 1; padding: 20px; }
.gh-content .kg-bookmark-title { font-weight: 600; color: var(--text); margin-bottom: 6px; }
.gh-content .kg-bookmark-description { font-size: 14px; color: var(--text-muted); }
.gh-content .kg-bookmark-thumbnail { width: 140px; flex-shrink: 0; }
.gh-content .kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; border: none; }

/* =====================================================
   POST FOOTER
   ===================================================== */
.post-footer { border-top: 1px solid var(--border); padding-top: 32px; }
.post-footer .container { display: flex; flex-direction: column; gap: 20px; }

.post-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.post-tag {
  display: inline-block;
  padding: 5px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.15s;
}
.post-tag:hover { border-color: var(--border-accent); color: var(--accent); background: var(--accent-soft); }

.post-share { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-muted); flex-wrap: wrap; }
.share-link {
  display: inline-flex; align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s;
}
.share-link:hover { border-color: var(--border-accent); color: var(--accent); background: var(--accent-soft); }

/* =====================================================
   ARCHIVE (TAG / AUTHOR)
   ===================================================== */
.archive-header {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.archive-header-inner { max-width: 600px; }

.tag-feature-image {
  width: 72px; height: 72px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 1px solid var(--border-accent);
  margin-bottom: 20px;
}
.author-profile-image {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-accent);
  margin-bottom: 20px;
}
.archive-label {
  display: block;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.archive-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
}
.archive-desc { font-size: 16px; color: var(--text-muted); max-width: 480px; margin-bottom: 12px; }
.archive-count { font-size: 14px; color: var(--text-muted); }
.author-website { font-size: 14px; color: var(--accent); margin-top: 10px; display: inline-block; }
.author-website:hover { text-decoration: underline; }

/* =====================================================
   STATIC PAGE
   ===================================================== */
.page { padding-bottom: 80px; }
.page-header { padding: 60px 0 40px; border-bottom: 1px solid var(--border); margin-bottom: 40px; }
.page-title { font-size: clamp(28px, 4vw, 46px); font-weight: 800; letter-spacing: -0.04em; margin-bottom: 12px; }
.page-excerpt { font-size: 18px; color: var(--text-muted); line-height: 1.65; max-width: 560px; }

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: 80px;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.footer-brand { font-size: 18px; font-weight: 800; letter-spacing: -0.04em; }
.footer-desc { font-size: 14px; color: var(--text-muted); max-width: 380px; line-height: 1.6; }
.footer-nav ul, .footer-nav .nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; list-style: none; }
.footer-nav li a, .footer-nav .nav-item a { font-size: 14px; color: var(--text-muted); padding: 5px 10px; border-radius: 8px; transition: color 0.15s; }
.footer-nav li a:hover, .footer-nav .nav-item a:hover { color: var(--text); }
.footer-copy { font-size: 13px; color: rgba(255,255,255,0.25); }
.footer-copy a { color: rgba(255,255,255,0.35); transition: color 0.15s; }
.footer-copy a:hover { color: var(--accent); }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .site-nav {
    display: none;
    position: fixed; top: 64px; left: 0; right: 0;
    background: rgba(10,10,11,0.97); backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border); padding: 12px 16px 20px;
    transform: translateY(-110%); opacity: 0; visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
  }
  .site-nav.nav-open {
    transform: translateY(0); opacity: 1; visibility: visible; display: block;
  }
  .site-nav ul, .site-nav .nav { flex-direction: column; width: 100%; }
  .site-nav li a, .site-nav .nav-item a { padding: 12px 16px; font-size: 16px; }
  .mobile-menu-btn { display: inline-flex; }
  .btn-cta { display: none; }

  .hero { padding: 48px 0 40px; }
  .hero-desc { font-size: 16px; }

  .posts-grid { grid-template-columns: 1fr; gap: 16px; }
  .posts-grid > .post-card:first-child { flex-direction: column; }
  .posts-grid > .post-card:first-child .post-card-image { aspect-ratio: 16/9; min-height: unset; }
  .posts-grid > .post-card:first-child .post-card-title { font-size: 19px; }

  .post-header { padding: 36px 0 28px; }
  .post-meta { flex-direction: column; align-items: flex-start; gap: 10px; }
  .post-meta-right { margin-left: 0; }
  .gh-content { font-size: 16px; }
  .gh-content h2 { font-size: 22px; }
  .gh-content h3 { font-size: 19px; }
  .gh-content .kg-bookmark-container { flex-direction: column; }
  .gh-content .kg-bookmark-thumbnail { width: 100%; height: 180px; }

  .archive-header { padding: 40px 0 32px; }
  .post-share { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .post-card-footer { flex-direction: column; align-items: flex-start; }
}

/* =====================================================
   ANIMATION
   ===================================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.post-card { animation: fadeInUp 0.45s cubic-bezier(0.16,1,0.3,1) both; }
.post-card:nth-child(2) { animation-delay: 0.05s; }
.post-card:nth-child(3) { animation-delay: 0.10s; }
.post-card:nth-child(4) { animation-delay: 0.15s; }
.post-card:nth-child(5) { animation-delay: 0.20s; }
.post-card:nth-child(6) { animation-delay: 0.25s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
