/* ============================================
   vbtronic.com — Dark Engineering Aesthetic
   ============================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: #e0e0e0;
  background-color: #0a0a0a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* --- Typography Scale --- */
h1, h2, h3, h4, h5, h6 {
  color: #f5f5f5;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p {
  margin-bottom: 1.25rem;
}

strong {
  font-weight: 600;
  color: #f5f5f5;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.125rem;
  font-weight: 500;
  color: #f5f5f5;
  letter-spacing: -0.01em;
  transition: opacity 0.2s ease;
}

.site-logo:hover {
  opacity: 0.8;
}

.site-logo .accent {
  color: #00b4d8;
}

.site-nav {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 400;
  color: #999;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: #f5f5f5;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: #00b4d8;
}

/* --- Main --- */
.site-main {
  flex: 1;
  padding: 3rem 0;
}

/* --- Hero --- */
.hero {
  padding: 4rem 0 3rem;
  text-align: left;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  color: #f5f5f5;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 300;
  color: #999;
  line-height: 1.6;
  max-width: 560px;
  margin-bottom: 2rem;
}

.hero-line {
  width: 120px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #00b4d8, #0077b6, transparent);
  background-size: 200% 100%;
  animation: hero-line-glow 3s ease-in-out infinite alternate;
}

@keyframes hero-line-glow {
  0% {
    opacity: 0.7;
    background-position: 0% 0%;
  }
  100% {
    opacity: 1;
    background-position: 100% 0%;
  }
}

/* --- About Card (home) --- */
.about-card {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 2.5rem;
  margin-top: 0.5rem;
}

.about-heading {
  font-size: 1.5rem;
  font-weight: 600;
  color: #00b4d8;
  margin-bottom: 1.25rem;
}

.about-body {
  color: #bbb;
  line-height: 1.7;
  font-size: 1.05rem;
}

.about-body p:last-child {
  margin-bottom: 0;
}

.about-links {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.about-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: #00b4d8;
  transition: color 0.2s ease;
}

.about-link:hover {
  color: #48cae4;
}

/* --- Page Nav Bar (back/forward arrows) --- */
.page-nav-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.page-nav-bar--single {
  margin-bottom: 0;
  padding-bottom: 1.5rem;
}

.page-nav-title {
  flex: 1;
  text-align: center;
}

.page-nav-title h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.page-nav-title .page-description {
  color: #999;
  font-size: 1rem;
  font-weight: 300;
  margin-bottom: 0;
}

.nav-breadcrumb {
  flex: 1;
  text-align: center;
  font-size: 0.9rem;
  color: #666;
}

.nav-arrow {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #999;
  font-size: 1.1rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.nav-arrow:hover:not(.disabled) {
  background: rgba(0, 180, 216, 0.1);
  border-color: rgba(0, 180, 216, 0.3);
  color: #00b4d8;
}

.nav-arrow.disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* --- Search Box --- */
.search-box {
  margin-bottom: 1.5rem;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #e0e0e0;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.search-box input::placeholder {
  color: #666;
}

.search-box input:focus {
  border-color: rgba(0, 180, 216, 0.4);
  background: rgba(255, 255, 255, 0.06);
}

/* --- No Results --- */
.no-results {
  text-align: center;
  color: #666;
  font-size: 0.95rem;
  padding: 2rem 0;
  margin-bottom: 0;
}


/* --- Latest Posts --- */
.latest-posts {
  margin-bottom: 2rem;
}

.latest-posts-heading {
  font-size: 1.25rem;
  font-weight: 600;
  color: #00b4d8;
  margin-bottom: 1rem;
}

.latest-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.latest-post-card {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.latest-post-card:hover {
  border-color: rgba(0, 180, 216, 0.3);
  background-color: rgba(0, 180, 216, 0.04);
}

.latest-post-card a {
  display: block;
  padding: 1.25rem;
}

.latest-post-card time {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.latest-post-card h3 {
  font-size: 1rem;
  font-weight: 500;
  color: #f5f5f5;
  margin-bottom: 0.35rem;
  line-height: 1.35;
  transition: color 0.2s ease;
}

.latest-post-card:hover h3 {
  color: #00b4d8;
}

.latest-post-card p {
  font-size: 0.85rem;
  color: #888;
  line-height: 1.45;
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- All Posts Box --- */
.all-posts-box {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 2rem;
}

.all-posts-box .search-box {
  margin-bottom: 1rem;
}

.all-posts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.all-posts-heading {
  font-size: 1.25rem;
  font-weight: 600;
  color: #00b4d8;
  margin-bottom: 0;
}

.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  color: #999;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-btn:hover:not(.disabled):not(.active) {
  background: rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
  border-color: rgba(255, 255, 255, 0.12);
}

.filter-btn.active {
  background: rgba(0, 180, 216, 0.15);
  color: #00b4d8;
  border-color: rgba(0, 180, 216, 0.3);
}

.filter-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* --- Posts List --- */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-card {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.post-card:last-child {
  border-bottom: none;
}

.post-card a {
  display: block;
  padding: 1.75rem 1.25rem;
  border-radius: 6px;
  margin: 0 -1.25rem;
  transition: background-color 0.2s ease, box-shadow 0.3s ease;
}

.post-card a:hover {
  background-color: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(0, 180, 216, 0.08);
}

.post-card .post-date {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.post-card .post-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: #f5f5f5;
  margin-bottom: 0.35rem;
  transition: color 0.2s ease;
}

.post-card a:hover .post-title {
  color: #00b4d8;
}

.post-card .post-excerpt {
  font-size: 0.925rem;
  color: #888;
  line-height: 1.5;
  margin-bottom: 0;
}

/* --- Single Post --- */
.post {
  max-width: 720px;
}

.post-header {
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.post-header .post-date {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.post-header .post-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}

.post-header .post-description {
  font-size: 1.1rem;
  color: #999;
  font-weight: 300;
  line-height: 1.5;
  margin-bottom: 0;
}

/* --- Post Content (Prose) --- */
.post-content {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #ccc;
}

.post-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.post-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.post-content p {
  margin-bottom: 1.35rem;
}

.post-content a {
  color: #00b4d8;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(0, 180, 216, 0.3);
  transition: text-decoration-color 0.2s ease;
}

.post-content a:hover {
  text-decoration-color: #00b4d8;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.35rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.4rem;
}

.post-content blockquote {
  border-left: 3px solid #00b4d8;
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background-color: rgba(0, 180, 216, 0.04);
  border-radius: 0 4px 4px 0;
  color: #bbb;
  font-style: italic;
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

.post-content hr {
  border: none;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 2.5rem 0;
}

/* --- Code --- */
code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
}

:not(pre) > code {
  background-color: rgba(255, 255, 255, 0.07);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: #e0e0e0;
}

pre {
  background-color: #111;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.85rem;
  color: #d4d4d4;
}

/* --- Tables --- */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.post-content th,
.post-content td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.post-content th {
  font-weight: 600;
  color: #f5f5f5;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Table scroll wrapper for narrow viewports */
.post-content .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
}

.post-content .table-wrap table {
  margin-bottom: 0;
  min-width: 480px;
}

/* --- Footer --- */
.site-footer {
  padding: 2.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 2rem;
}

.site-footer p {
  font-size: 0.8rem;
  color: #555;
  margin-bottom: 0;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.01em;
}

/* --- Selection --- */
::selection {
  background-color: rgba(0, 180, 216, 0.25);
  color: #f5f5f5;
}

/* --- Scrollbar (Webkit) --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* --- Responsive --- */

/* Tablet */
@media (max-width: 768px) {
  .hero {
    padding: 3rem 0 2.5rem;
  }

  .hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
  }

  .site-main {
    padding: 2.5rem 0;
  }

  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.625rem; }

  .about-card {
    padding: 2rem;
  }

  .about-body {
    font-size: 1rem;
  }

  .page-nav-title h1 {
    font-size: 1.75rem;
  }

  .post-content {
    font-size: 1rem;
  }

  pre {
    padding: 1rem 1.25rem;
  }

  .latest-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 640px) {
  .site-header .container {
    height: 56px;
  }

  .site-nav {
    gap: 1.25rem;
  }

  .nav-link {
    font-size: 0.8rem;
    padding: 0.25rem 0;
  }

  .site-logo {
    font-size: 1rem;
  }

  .hero {
    padding: 2.5rem 0 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .site-main {
    padding: 2rem 0;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  .about-card {
    padding: 1.5rem;
  }

  .about-heading {
    font-size: 1.3rem;
  }

  .about-body {
    font-size: 0.975rem;
  }

  .about-links {
    flex-direction: column;
    gap: 0.75rem;
  }

  .about-link {
    font-size: 0.875rem;
  }

  .page-nav-bar {
    gap: 0.75rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
  }

  .page-nav-title h1 {
    font-size: 1.5rem;
  }

  .page-nav-title .page-description {
    font-size: 0.875rem;
  }

  .nav-arrow {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .nav-breadcrumb {
    font-size: 0.8rem;
  }

  .latest-posts-grid {
    grid-template-columns: 1fr;
  }

  .latest-post-card a {
    padding: 1rem;
  }

  .latest-posts-heading {
    font-size: 1.1rem;
  }

  .all-posts-box {
    padding: 1.25rem;
  }

  .all-posts-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .all-posts-heading {
    font-size: 1.1rem;
  }

  .filter-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
  }

  .search-box input {
    padding: 0.65rem 0.875rem;
    font-size: 0.875rem;
  }

  .post-card a {
    padding: 1.25rem 1rem;
    margin: 0 -1rem;
  }

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

  .post-card .post-excerpt {
    font-size: 0.875rem;
  }

  .post-header {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .post-header .post-description {
    font-size: 1rem;
  }

  .post-content {
    font-size: 0.975rem;
  }

  .post-content h2 {
    margin-top: 2rem;
    padding-top: 1.25rem;
  }

  .post-content h3 {
    margin-top: 1.5rem;
  }

  .post-content blockquote {
    padding: 0.6rem 1rem;
    margin: 1.25rem 0;
  }

  .post-content ul,
  .post-content ol {
    padding-left: 1.25rem;
  }

  .post-content th,
  .post-content td {
    padding: 0.5rem 0.6rem;
    font-size: 0.875rem;
  }

  pre {
    padding: 1rem;
    border-radius: 4px;
  }

  pre code {
    font-size: 0.8rem;
  }

  .site-footer {
    padding: 2rem 0;
    margin-top: 1.5rem;
  }
}

/* Small phones */
@media (max-width: 400px) {
  .container {
    padding: 0 1rem;
  }

  .site-header .container {
    height: 52px;
  }

  .site-nav {
    gap: 0.875rem;
  }

  .nav-link {
    font-size: 0.75rem;
  }

  .site-logo {
    font-size: 0.9rem;
  }

  .hero {
    padding: 2rem 0 1.5rem;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }

  .about-card {
    padding: 1.25rem;
  }

  .about-heading {
    font-size: 1.2rem;
  }

  .page-nav-title h1 {
    font-size: 1.3rem;
  }

  .nav-arrow {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
  }

  .post-card a {
    padding: 1rem 0.75rem;
    margin: 0 -0.75rem;
  }

  .post-card .post-title {
    font-size: 1rem;
  }

  .site-footer p {
    font-size: 0.75rem;
  }
}
