/* Core Theme Variables */
:root {
  --bg-color: #fafafa;
  --text-primary: #171717;
  --text-secondary: #555555;
  --border-color: #e5e5e5;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max-width: 800px;
}

body.dark-mode {
  --bg-color: #0d0d0d;
  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  --border-color: #262626;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.7;
  transition: background-color 0.3s ease, color 0.3s ease;
  font-size: 14px; /* Scaled down base font */
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
  width: 100%;
}

/* Navbar */
.navbar {
  padding: 32px 28px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--text-primary);
}

.webring-section { margin-top: 15px; }

.webring-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 15px;
}

.webring {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.webring img {
  display: block;
  width: 55px;
  height: 9px;
  image-rendering: pixelated;
}

.my-button img {
  display: block;
  width: var(--my-button-width, 90px);
  height: auto;
  border: 1px solid #8b8bff;
  transition: transform 0.2s ease;
}





.nav-links {
  display: flex;
  gap: 20px;
}

.nav-item {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.836rem;
  transition: color 0.2s ease;
}

.nav-item.active, 
.nav-item:hover {
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  gap: 18px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.88rem;
  transition: color 0.2s ease;
}

.icon-btn:hover {
  color: var(--text-primary);
}

/* Banner Styling (slide-from-right slideshow) */
.banner-wrapper {
  position: relative;
  width: 100%;
  height: 160px;
  overflow: hidden;
  border-radius: 12px;
  margin-top: 10px;
  margin-bottom: 24px;
}

.hero-banner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: translateX(100%); /* waiting off-screen on the right */
}

/* Slide currently shown */
.hero-banner.active {
  transform: translateX(0);
}

/* New slide comes in from the right */
.hero-banner.entering {
  animation: bannerSlideIn 0.8s ease-in-out forwards;
}

/* Old slide leaves to the left */
.hero-banner.leaving {
  animation: bannerSlideOut 0.8s ease-in-out forwards;
}

@keyframes bannerSlideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

@keyframes bannerSlideOut {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-banner.entering,
  .hero-banner.leaving {
    animation: none;
  }
  .hero-banner.leaving {
    transform: translateX(100%);
  }
}

/* Hero Section Typography */
.about-hero {
  padding: 0 0 24px;
}

.greeting {
  color: var(--text-secondary);
  font-size: 0.836rem;
  display: block;
  margin-bottom: 6px;
}

.name {
  font-size: 2.288rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 2rem; /* Increased spacing below your name */
  line-height: 1.15;
}

/* Make all links inside paragraphs white */
p a {
  color: #ffffff;
  text-decoration: underline;
}

/* Ensure links stay white even after being clicked */
p a:visited {
  color: #ffffff;
}


.bio-paragraph {
  font-size: 0.924rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1rem; /* Tighter paragraph spacing */
  word-break: break-word;
}

/* Social Links */
.social-links {
  display: flex;
  gap: 20px;
  font-size: 1.1rem;
  margin-top: 24px;
}

.social-links a {
  color: var(--text-secondary);
  transition: color 0.2s ease, transform 0.2s ease;
}

.social-links a:hover {
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* ==========================================
   Projects Card Grid Layout
   ========================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.project-card {
  background-color: transparent;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--text-secondary);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 1.012rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.card-icon {
  font-size: 0.748rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.project-card:hover .card-icon {
  transform: translate(2px, -2px);
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.836rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.card-footer {
  display: flex;
  align-items: center;
}

.card-tag {
  font-size: 0.722rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.project-card:hover .card-tag {
  color: var(--text-primary);
}

/* ==========================================
   Blog Feed List Layout
   ========================================== */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 28px;
}

.blog-item {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
  transition: opacity 0.2s ease;
}

.blog-item:last-child {
  border-bottom: none;
}

.blog-item:hover {
  opacity: 0.8;
}

.blog-title {
  font-size: 1.056rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.blog-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.blog-snippet {
  color: var(--text-secondary);
  font-size: 0.836rem;
  line-height: 1.6;
  margin-top: 6px;
}

.blog-date {
  font-size: 0.704rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 6px;
}

.feed-message {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* ==========================================
   Single Post/Project View & Markdown
   ========================================== */
.single-view {
  padding: 16px 0 32px;
  width: 100%;
}

#back-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-weight: 500;
  transition: color 0.2s ease, transform 0.2s ease;
}

#back-btn:hover {
  color: var(--text-primary);
  transform: translateX(-3px);
}

.markdown-body {
  font-size: 0.862rem; /* Scaled down content text */
  line-height: 1.7;
  color: var(--text-secondary);
}

.markdown-body img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 8px;
  margin: 20px 0;
  display: block;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  color: var(--text-primary);
  font-weight: 600;
  margin: 28px 0 12px;
  letter-spacing: -0.01em;
}

.markdown-body h1 { font-size: 1.32rem; }
.markdown-body h2 { font-size: 1.1rem; }
.markdown-body h3 { font-size: 0.968rem; }

.markdown-body p {
  margin-bottom: 16px;
}

.markdown-body ul, 
.markdown-body ol {
  margin: 0 0 16px 24px;
}

.markdown-body li {
  margin-bottom: 6px;
}

.markdown-body a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.markdown-body blockquote {
  border-left: 2px solid var(--border-color);
  padding-left: 16px;
  margin: 20px 0;
  font-style: italic;
}

.markdown-body code {
  font-family: monospace;
  font-size: 0.88em;
  background-color: var(--border-color);
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--text-primary);
}

.markdown-body pre {
  background-color: var(--border-color);
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 20px 0;
}

.markdown-body pre code {
  background-color: transparent;
  padding: 0;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 32px 0;
  color: var(--text-secondary);
  font-size: 0.748rem;
  border-top: 1px solid var(--border-color);
  margin-top: 48px;
}

/* ==========================================
   Mobile Responsive Adjustments (< 768px)
   ========================================== */
@media (max-width: 768px) {
  body {
    font-size: 13px; /* Compact base font for phone screens */
    line-height: 1.65;
  }

  .container,
  .navbar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .navbar {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .banner-wrapper {
    height: 130px; /* Slimmer height on mobile screens */
    margin-bottom: 18px;
  }

  .about-hero {
    padding-top: 0;
    padding-bottom: 16px;
  }

  .name {
    font-size: 1.628rem;
    margin-bottom: 1.25rem;
  }

  .bio-paragraph {
    font-size: 0.836rem;
    line-height: 1.65;
    margin-bottom: 1rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 20px;
  }

  .project-card {
    padding: 18px;
  }

  .card-title {
    font-size: 0.924rem;
  }

  .card-desc {
    font-size: 0.792rem;
    margin-bottom: 14px;
  }

  .blog-list {
    gap: 20px;
    margin-top: 20px;
  }

  .blog-title {
    font-size: 0.968rem;
  }

  .blog-snippet {
    font-size: 0.792rem;
  }

  .markdown-body {
    font-size: 0.81rem;
    line-height: 1.65;
  }

  .markdown-body h1 { font-size: 1.188rem; }
  .markdown-body h2 { font-size: 1.012rem; }
  .markdown-body h3 { font-size: 0.898rem; }

  .markdown-body pre {
    padding: 12px;
  }
}
