/* ===== PIXELBAY — Premium Minimal UI ===== */

:root {
  --bg-primary: #0b1220;
  --bg-secondary: #111b2d;
  --bg-elevated: #122033;
  --bg-card: rgba(15, 23, 42, 0.82);
  --bg-soft: rgba(148, 163, 184, 0.06);
  --border-color: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(96, 165, 250, 0.34);
  --text-primary: #e5edf8;
  --text-secondary: #b7c6d8;
  --text-muted: #7e8fa8;
  --accent: #60a5fa;
  --accent-strong: #7dd3fc;
  --accent-hover: #93c5fd;
  --accent-soft: rgba(96, 165, 250, 0.12);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.12);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.22);
  --shadow-lg: 0 18px 42px rgba(15, 23, 42, 0.28);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --gradient-1: linear-gradient(135deg, #60a5fa 0%, #7dd3fc 50%, #8b5cf6 100%);
  --gradient-2: linear-gradient(135deg, rgba(96,165,250,0.18), rgba(139,92,246,0.12));
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.14), transparent 30%),
    radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.12), transparent 36%),
    var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.12), transparent 35%, rgba(15, 23, 42, 0.06));
  z-index: 0;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

a:hover { color: var(--accent-hover); }

button,
input,
textarea,
select {
  font: inherit;
}

button,
input,
textarea,
select,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.8);
  outline-offset: 2px;
}

::selection {
  background: rgba(96, 165, 250, 0.28);
  color: #fff;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

#header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(11, 18, 32, 0.82);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
}

.site-logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.site-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.site-name {
  font-size: clamp(1.2rem, 1.1rem + 0.4vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.search-box {
  display: flex;
  align-items: center;
  width: min(520px, 100%);
  min-height: 48px;
  background: rgba(17, 27, 45, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.12);
}

.search-box input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 0 18px;
  font-size: 0.94rem;
  min-height: 48px;
}

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

.search-box button {
  border: none;
  background: var(--gradient-1);
  color: #f8fbff;
  min-width: 104px;
  min-height: 48px;
  padding: 0 20px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.search-box button:hover {
  filter: brightness(1.04);
}

.search-box button:active {
  transform: translateY(1px);
}

.nav-bar {
  border-top: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.68);
}

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 4px;
}

.nav-menu::-webkit-scrollbar { display: none; }

.nav-menu li a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 12px;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.nav-menu li a:hover,
.nav-menu li a.active {
  color: var(--accent-strong);
  border-bottom-color: rgba(125, 211, 252, 0.8);
  background: rgba(96, 165, 250, 0.05);
}

.nav-menu .nav-highlight {
  color: var(--accent-strong);
  font-weight: 700;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 54px;
  border-bottom: 1px solid var(--border-color);
  background:
    linear-gradient(180deg, rgba(96, 165, 250, 0.12), rgba(15, 23, 42, 0) 45%),
    rgba(11, 18, 32, 0.6);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(96, 165, 250, 0.18), transparent 30%),
              radial-gradient(circle at 80% 10%, rgba(139, 92, 246, 0.10), transparent 26%);
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  z-index: 1;
}

.hero-title {
  text-align: center;
  font-size: clamp(2.2rem, 1.5rem + 2vw, 4.4rem);
  line-height: 1.06;
  letter-spacing: -0.08em;
  margin-bottom: 14px;
  font-weight: 900;
}

.hero-title .gradient {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.06rem;
}

.hero-search {
  max-width: 640px;
  margin: 0 auto 24px;
}

.hero-search .search-box {
  width: 100%;
  border-radius: 18px;
  box-shadow: var(--shadow-md);
}

.hero-search .search-box input {
  min-height: 56px;
}

.hero-search .search-box button {
  min-height: 56px;
  border-radius: 0 18px 18px 0;
}

.hero-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 20px;
}

.hero-stat {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.32);
  text-align: center;
}

.hero-stat-num {
  font-size: clamp(1.3rem, 1.1rem + 0.7vw, 2rem);
  font-weight: 800;
  color: var(--accent-strong);
}

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

#main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  padding: 28px 0 24px;
}

.site-content {
  min-width: 0;
}

.page-header {
  margin-bottom: 22px;
  padding: 22px 24px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.09), rgba(15, 23, 42, 0.4));
  box-shadow: var(--shadow-sm);
}

.page-header h2 {
  font-size: clamp(1.3rem, 1.1rem + 0.7vw, 2rem);
  letter-spacing: -0.05em;
  font-weight: 800;
}

.page-header .count {
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 500;
}

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

.post-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  box-shadow: var(--shadow-sm);
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.card-thumb-wrap {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.08);
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .card-thumb {
  transform: scale(1.04);
}

.card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(96,165,250,0.18), rgba(139,92,246,0.18));
  font-size: 2.6rem;
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px 18px 16px;
}

.card-title {
  margin-bottom: 10px;
  font-size: 1.02rem;
  line-height: 1.5;
  font-weight: 700;
}

.card-title a {
  color: var(--text-primary);
}

.card-title a:hover {
  color: var(--accent-strong);
}

.card-excerpt {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.74rem;
}

.cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.18);
  color: var(--accent-strong);
  font-weight: 600;
}

.post-article,
.sidebar-widget,
.related-posts {
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.post-article {
  overflow: hidden;
}

.post-hero {
  padding: 32px 28px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.12), rgba(139, 92, 246, 0.08));
}

.post-article .post-title {
  font-size: clamp(1.5rem, 1.2rem + 0.9vw, 2.5rem);
  line-height: 1.25;
  letter-spacing: -0.06em;
  margin-bottom: 12px;
  font-weight: 800;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 18px;
  padding: 0 2px;
}

.breadcrumb a {
  color: var(--text-secondary);
}

.entry-content {
  padding: 28px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content blockquote,
.entry-content pre {
  margin-bottom: 18px;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin: 28px 0 14px;
  color: var(--text-primary);
  letter-spacing: -0.04em;
}

.entry-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.entry-content pre {
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.6);
  overflow-x: auto;
}

.entry-content code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: rgba(96, 165, 250, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--accent-strong);
}

.entry-content blockquote {
  border-left: 3px solid var(--accent-strong);
  background: rgba(96, 165, 250, 0.05);
  border-radius: 0 12px 12px 0;
  padding: 14px 18px;
  color: var(--text-secondary);
}

.entry-content img {
  border-radius: 16px;
  margin: 18px 0;
  box-shadow: var(--shadow-md);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-widget {
  padding: 20px 18px;
}

.widget-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.widget-title .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(96, 165, 250, 0.08);
  color: var(--accent-strong);
}

.cat-list {
  list-style: none;
}

.cat-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.cat-list li:last-child {
  border-bottom: none;
}

.cat-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.cat-list a:hover {
  color: var(--accent-strong);
}

.cat-list .cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(96, 165, 250, 0.08);
  flex-shrink: 0;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.sidebar-search {
  width: 100%;
  border-radius: 12px;
}

.sidebar-search input {
  min-height: 44px;
}

.sidebar-search button {
  min-height: 44px;
  min-width: 58px;
  border-radius: 0 12px 12px 0;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 16px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.pagination a:hover {
  color: var(--accent-strong);
  border-color: var(--border-strong);
}

.pagination .current {
  background: var(--gradient-1);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.pagination .dots {
  border: none;
  background: transparent;
  min-width: 20px;
  padding: 0 4px;
  color: var(--text-muted);
}

.pagination-info {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-bottom: 12px;
}

#footer {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  padding: 42px 0 20px;
  border-top: 1px solid var(--border-color);
  background: rgba(11, 18, 32, 0.7);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 30px;
  margin-bottom: 28px;
}

.footer-col h4 {
  margin-bottom: 14px;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.footer-col p,
.footer-col li,
.footer-col a,
.footer-bottom {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.footer-col ul {
  list-style: none;
  display: grid;
  gap: 8px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.footer-bottom .copyright,
.footer-bottom .credit {
  color: var(--text-muted);
}

.no-results {
  padding: 52px 20px;
  text-align: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.6);
}

.no-results h2 {
  margin-bottom: 8px;
  font-size: 1.5rem;
  color: var(--accent-strong);
}

.no-results p {
  color: var(--text-secondary);
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--gradient-1);
  color: #fff;
  font-size: 1.25rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  filter: brightness(1.04);
}

.related-posts {
  margin-top: 24px;
  padding: 22px 20px;
}

.related-posts h3 {
  margin-bottom: 16px;
  font-size: 1rem;
  letter-spacing: -0.03em;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.related-item {
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(17, 27, 45, 0.8);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.related-item:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.related-item a {
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
}

@media (max-width: 1024px) {
  #main {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .wrap {
    padding: 0 16px;
  }

  .header-top {
    flex-wrap: wrap;
  }

  .search-box {
    width: 100%;
    order: 3;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 10px;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-menu li a {
    justify-content: flex-start;
    width: 100%;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(96, 165, 250, 0.08);
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
  }

  .hero {
    padding-top: 48px;
  }

  .hero-search .search-box input,
  .hero-search .search-box button {
    min-height: 50px;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .entry-content {
    padding: 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .hero-stats {
    flex-direction: column;
    gap: 14px;
  }

  .hero-stat {
    width: 100%;
  }

  .page-header {
    padding: 18px 18px;
  }

  .site-name {
    font-size: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.menu-toggle {
  display: none;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.8);
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.42);
}

.post-card {
  animation: fadeIn 0.3s ease-out both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card:nth-child(1) { animation-delay: 0.04s; }
.post-card:nth-child(2) { animation-delay: 0.08s; }
.post-card:nth-child(3) { animation-delay: 0.12s; }
.post-card:nth-child(4) { animation-delay: 0.16s; }
.post-card:nth-child(5) { animation-delay: 0.20s; }
.post-card:nth-child(6) { animation-delay: 0.24s; }

/* Detail pages */
.post-article .entry-content > :first-child {
  margin-top: 0;
}

.entry-content hr {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 30px 0;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.entry-content th,
.entry-content td {
  padding: 11px 14px;
  border: 1px solid var(--border-color);
  text-align: left;
}

.entry-content th {
  color: var(--text-primary);
  background: rgba(96, 165, 250, 0.08);
}

.entry-content strong {
  color: var(--text-primary);
}

.related-posts {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.08), rgba(15, 23, 42, 0.82));
}
