/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  line-height: 1.75;
  color: #fff;
  background: #111;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: #7eb8da;
  text-decoration: none;
}
a:hover {
  color: #b0d9f5;
  text-decoration: underline;
}

/* === Video Background === */
.video-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}
.video-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}
.video-bg video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* === Nav Menu Button (top-left dropdown) === */
.nav-menu {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
}
.nav-trigger {
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.2s;
}
.nav-trigger:hover {
  background: rgba(0, 0, 0, 0.7);
}
.nav-trigger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: all 0.25s;
}
.nav-trigger.active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}
.nav-trigger.active span:nth-child(2) {
  opacity: 0;
}
.nav-trigger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* Dropdown */
.nav-dropdown {
  position: absolute;
  top: 52px;
  left: 0;
  min-width: 160px;
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}
.nav-dropdown a {
  display: block;
  padding: 10px 20px;
  color: #ddd;
  font-size: 0.92rem;
  white-space: nowrap;
}
.nav-dropdown a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}

/* Desktop: hover opens dropdown */
@media (min-width: 769px) {
  .nav-menu:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/* Mobile: class-based toggle */
.nav-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* === Site Main === */
.site-main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.container {
  max-width: 750px;
  margin: 0 auto;
  padding: 0 20px;
}

/* === Hero (homepage) === */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 80px 20px;
}
.hero-title {
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.hero-desc {
  margin-top: 10px;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.hero-arrow {
  position: absolute;
  bottom: 32px;
  animation: bounce 2s infinite;
  color: rgba(255, 255, 255, 0.6);
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(8px); }
  60% { transform: translateY(4px); }
}

/* === Content Section === */
.content-section {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 14px 14px 0 0;
  padding: 40px 28px;
  margin-top: 20px; /* only applies to non-home pages (no hero) */
  min-height: 80vh;
}

/* Homepage: content after hero doesn't need extra top margin */
.hero + .content-section {
  margin-top: 0;
}

/* But hero is not a direct sibling in the DOM — handle via neg margin on content-section when body has has-video */
.has-video .content-section:first-of-type {
  margin-top: -20px;
}

/* === Post Cards === */
.post-card {
  padding: 24px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.post-card:last-child {
  border-bottom: none;
}
.post-title {
  font-size: 1.3rem;
  line-height: 1.4;
  margin-bottom: 6px;
}
.post-title a {
  color: #fff;
}
.post-title a:hover {
  color: #b0d9f5;
  text-decoration: none;
}
.post-meta {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
}
.post-thumb {
  display: block;
  margin-bottom: 10px;
}
.post-thumb img {
  border-radius: 8px;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.post-excerpt {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.93rem;
  margin-bottom: 10px;
}
.post-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}
.cat-tag {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #b0d9f5;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.cat-tag:hover {
  background: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}
.tag-label {
  color: rgba(255, 255, 255, 0.45);
}
.tag-label:hover {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}
.read-more {
  margin-left: auto;
  font-size: 0.83rem;
  color: #7eb8da;
}

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 32px 0;
}
.page-info {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}
.page-prev, .page-next {
  padding: 6px 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.06);
}
.page-prev:hover, .page-next:hover {
  background: rgba(255, 255, 255, 0.15);
  text-decoration: none;
  color: #fff;
}

/* === Single Post / Page === */
.single-post, .single-page {
  margin-bottom: 30px;
}
.entry-header {
  margin-bottom: 20px;
}
.entry-title {
  font-size: 1.7rem;
  line-height: 1.35;
  color: #fff;
  margin-bottom: 8px;
}
.featured-image {
  border-radius: 10px;
  margin-bottom: 24px;
}

/* Entry content */
.entry-content {
  font-size: 1rem;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.88);
}
.entry-content h2 {
  font-size: 1.3rem;
  margin: 32px 0 12px;
  color: #fff;
}
.entry-content h3 {
  font-size: 1.15rem;
  margin: 24px 0 8px;
  color: #eee;
}
.entry-content p {
  margin: 0 0 1.2em;
}
.entry-content ul, .entry-content ol {
  margin: 0 0 1.2em 1.5em;
}
.entry-content blockquote {
  margin: 0 0 1.2em;
  padding: 4px 0 4px 16px;
  border-left: 3px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.6);
}
.entry-content pre {
  background: rgba(0, 0, 0, 0.3);
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.88rem;
  margin-bottom: 1.2em;
  line-height: 1.6;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.entry-content code {
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.88em;
}
.entry-content pre code {
  background: none;
  padding: 0;
}
.entry-content img {
  border-radius: 8px;
}
.entry-content hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 32px 0;
}
.entry-content a {
  color: #7eb8da;
}

.entry-footer {
  margin-top: 32px;
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.88rem;
}
.entry-cats, .entry-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.back-link {
  margin: 24px 0 30px;
  font-size: 0.9rem;
}

/* === Archive === */
.archive-title {
  font-size: 1.4rem;
  margin-bottom: 4px;
  color: #fff;
}
.archive-desc {
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 20px;
}

/* === 404 === */
.not-found {
  text-align: center;
  padding: 60px 0;
}
.not-found h1 {
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.2);
  margin-bottom: 8px;
}
.not-found p {
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 24px;
}
.btn-home {
  display: inline-block;
  padding: 8px 24px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-home:hover {
  background: rgba(255, 255, 255, 0.25);
  text-decoration: none;
  color: #fff;
}

/* === Empty state === */
.empty-state {
  text-align: center;
  padding: 60px 0;
  color: rgba(255, 255, 255, 0.5);
}
.empty-state h2 {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}

/* === Footer === */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px 0;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.3);
}
.site-footer a {
  color: rgba(255, 255, 255, 0.35);
}

/* === Mobile === */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .nav-menu {
    top: 12px;
    left: 12px;
  }
  .nav-trigger {
    width: 40px;
    height: 40px;
    border-radius: 6px;
  }
  .nav-dropdown {
    position: fixed;
    top: 60px;
    left: 12px;
    right: 12px;
    min-width: unset;
  }

  .hero-title {
    font-size: 1.8rem;
  }
  .hero-desc {
    font-size: 0.95rem;
  }

  .content-section {
    padding: 28px 16px;
    border-radius: 12px 12px 0 0;
  }

  .entry-title {
    font-size: 1.35rem;
  }

  .post-title {
    font-size: 1.1rem;
  }

  .post-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .read-more {
    margin-left: 0;
  }

  .entry-footer {
    flex-direction: column;
    gap: 10px;
  }
}

/* === Small phones === */
@media (max-width: 400px) {
  .hero-title {
    font-size: 1.5rem;
  }
  .content-section {
    padding: 20px 12px;
  }
}
