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

html {
  scroll-behavior: smooth;
}

:root {
  /* Dark theme colors from Mira */
  --color-bg-primary: #1a1a1a;
  --color-bg-secondary: #242424;
  --color-bg-tertiary: #2d2d2d;
  --color-bg-card: #1f1f1f;

  /* Text colors */
  --color-text-primary: #f8f9fa;
  --color-text-secondary: #e9ecef;
  --color-text-muted: #adb5bd;
  --color-text-dimmed: #868e96;

  /* Accent colors */
  --color-accent: #4dabf7;
  --color-accent-light: #74c0fc;

  /* System font stack */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;

  /* Card dimensions */
  --card-h: 300px;
  --card-img-h: 140px;
  --hero-card-h: min(calc(100vh - 250px), 700px);
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--color-text-secondary);
  background-color: var(--color-bg-primary);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ========== Navigation ========== */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 1000;
  padding: 0.75rem 0;
}

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

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  margin: 0;
}

.site-title a {
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color 0.3s;
}

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

.site-nav {
  display: flex;
  gap: 2rem;
}

.site-nav a {
  position: relative;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  padding: 0.5rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.3s;
}

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

.site-nav a:hover::after {
  width: 100%;
}

/* ========== Main Content ========== */
main {
  min-height: calc(100vh - 200px);
}

main > .container {
  padding: 70px 2rem 2rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--color-text-primary);
  text-align: center;
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  color: var(--color-text-primary);
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: var(--color-text-primary);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.3s;
}

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

/* ========== Hero Section ========== */
.hero-section {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 100px 2rem 2rem;
  gap: 2rem;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  min-height: calc(100vh - 100px);
}

@media (min-width: 1401px) {
  .hero-section {
    flex-direction: row;
  }
}

.shader-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
}

.shader-credit {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.2s ease;
}

.shader-credit:hover {
  background: rgba(0, 0, 0, 0.7);
  color: var(--color-accent);
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  max-height: none;
  min-height: auto;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  overflow: hidden;
}

@media (min-width: 1401px) {
  .hero-content {
    max-width: 350px;
    min-width: 350px;
    height: var(--hero-card-h);
    max-height: var(--hero-card-h);
    min-height: 600px;
  }
}

.hero-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  justify-content: flex-start;
  min-height: 0;
  overflow: auto;
  padding-bottom: 1.5rem;
}

.hero-contact {
  width: 100%;
  margin-top: auto;
  flex-shrink: 0;
}

.hero-email-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem;
  min-height: 48px;
  background: rgba(74, 171, 247, 0.15);
  border: 1px solid var(--color-accent);
  color: var(--color-text-primary);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hero-email-button:hover {
  background: rgba(74, 171, 247, 0.25);
  border-color: var(--color-accent-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(74, 171, 247, 0.3);
}

.hero-image {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hero-image img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 4px solid #495057;
  object-fit: cover;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.hero-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
  text-align: center;
}

.hero-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: rgba(74, 171, 247, 0.1);
  border: 1px solid rgba(74, 171, 247, 0.3);
  border-radius: 8px;
  color: var(--color-accent);
  transition: all 0.3s ease;
  text-decoration: none;
  margin-top: 0.5rem;
}

.hero-social-link:hover {
  background: rgba(74, 171, 247, 0.2);
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 171, 247, 0.3);
}

.hero-social-link svg {
  width: 20px;
  height: 20px;
}

.hero-text {
  flex: 1;
}

.hero-text h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-top: 0;
  margin-bottom: 0.5rem;
  line-height: 1.2;
  text-align: center;
}

.hero-text p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  text-align: center;
}

.skills-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  justify-content: center;
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: rgba(74, 171, 247, 0.1);
  border: 1px solid var(--color-accent);
  border-radius: 16px;
  font-size: 0.8rem;
  color: var(--color-accent-light);
  text-decoration: none;
  transition: all 0.3s;
}

.badge:hover {
  background: rgba(74, 171, 247, 0.2);
  color: var(--color-accent);
  transform: translateY(-2px);
}

/* ========== Hero Projects Section ========== */
.hero-projects {
  flex: 1;
  display: flex;
  flex-direction: column;
  z-index: 1;
  width: 100%;
  min-width: 0;
  height: auto;
  max-height: none;
  min-height: auto;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

@media (min-width: 1401px) {
  .hero-projects {
    min-width: 350px;
    height: var(--hero-card-h);
    max-height: var(--hero-card-h);
    min-height: 500px;
  }
}

.section-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  text-align: center;
  flex: 1;
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}

.view-all-link {
  font-size: 0.95rem;
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  white-space: nowrap;
  padding: 0.75rem 1.25rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  background: rgba(74, 171, 247, 0.15);
  border: 1px solid var(--color-accent);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  margin-left: auto;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .section-header {
    justify-content: center;
    flex-direction: column;
  }

  .section-title {
    position: static;
    flex: 0 0 100%;
    width: 100%;
  }

  .view-all-link {
    margin-left: 0;
    margin-right: 0;
  }
}

.view-all-link:hover {
  background: rgba(74, 171, 247, 0.25);
  border-color: var(--color-accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 171, 247, 0.3);
  color: var(--color-text-primary);
}

/* ========== Posts Grid (Homepage) ========== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr;
  gap: 1.25rem;
  flex: 1;
  min-height: 0;
}

@media (max-width: 968px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== Carousel (DISABLED - using static grid) ========== */
.hero-projects {
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
  gap: 2rem;
  cursor: grab;
  user-select: none;
}

.carousel-track:active {
  cursor: grabbing;
}

.carousel-track .post-card {
  flex: 0 0 calc((100% - 4rem) / 3);
  min-width: 0;
}

.carousel-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.carousel-button {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: var(--color-bg-card);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.carousel-button:hover:not(:disabled) {
  background: var(--color-accent);
  border-color: var(--color-accent);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(74, 171, 247, 0.3);
}

.carousel-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.carousel-button svg {
  width: 24px;
  height: 24px;
}

.carousel-dots {
  display: flex;
  gap: 1rem;
}

.carousel-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
  flex-shrink: 0;
}

.carousel-dot:hover {
  border-color: var(--color-accent);
  transform: scale(1.2);
}

.carousel-dot.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

@media (max-width: 968px) {
  .carousel-track .post-card {
    flex: 0 0 calc((100% - 2rem) / 2);
  }
}

@media (max-width: 640px) {
  .carousel-wrapper {
    padding: 3rem 1.5rem;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
  }

  .carousel-track {
    gap: 1.5rem;
  }

  .carousel-track .post-card {
    flex: 0 0 100%;
  }
}

.post-card {
  height: 100%;
  min-height: var(--card-h);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: var(--color-bg-card);
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  overflow: hidden;
  transition: transform 0.1s ease-out, box-shadow 0.3s;
  position: relative;
  transform-style: preserve-3d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  will-change: transform;
}

.post-card:hover {
  box-shadow: 0 15px 50px rgba(74, 171, 247, 0.3);
}

.post-card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
  text-decoration: none;
  position: relative;
  min-height: 0;
  background: var(--color-bg-card);
}

.post-card-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  background-color: var(--color-bg-card);
}

.post-card-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom,
    rgba(0,0,0,0.6) 0%,
    rgba(0,0,0,0.3) 40%,
    rgba(0,0,0,0.5) 70%,
    rgba(0,0,0,0.8) 100%);
  transition: opacity 0.3s ease;
}

.post-card:hover .post-card-image::after {
  opacity: 0.3;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.1s ease-out;
  will-change: transform;
}

.post-card-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.5rem;
  justify-content: space-between;
  transition: opacity 0.3s ease;
}

.post-card:hover .post-card-content {
  opacity: 0;
}

.post-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-card-content h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  word-wrap: break-word;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  transition: color 0.3s;
}

.post-card-link:hover h3 {
  color: var(--color-accent-light);
}

.post-card-content time {
  display: block;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.post-card-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.post-card-content p {
  color: rgba(255,255,255,0.95);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
  word-wrap: break-word;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.post-card .post-tags {
  position: relative;
  z-index: 10;
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: var(--color-bg-card);
  overflow: hidden;
  justify-content: center;
  align-items: flex-start;
  min-height: 70px;
}

.post-card .post-tags .tag {
  /* Inherit from base .tag styles but override for card context */
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: rgba(74, 171, 247, 0.1);
  border: 1px solid var(--color-accent);
  border-radius: 16px;
  font-size: 0.8rem;
  color: var(--color-accent-light);
  text-decoration: none;
  transition: all 0.3s;
  flex-shrink: 0;
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-card .post-tags .tag:hover {
  background: rgba(74, 171, 247, 0.2);
  color: var(--color-accent);
  transform: translateY(-2px);
}

/* ========== Posts List (All Posts Page) ========== */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.posts-list .post-item {
  will-change: opacity, transform, max-height;
  contain: layout;
  transition: opacity 0.25s ease-out,
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              margin 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              padding 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-item {
  display: block;
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  opacity: 1;
  margin-bottom: 2rem;
  max-height: 2000px;
  transform: scale(1);
  transform-origin: top center;
  backface-visibility: hidden;
  -webkit-font-smoothing: subpixel-antialiased;
}

.post-item.hiding {
  opacity: 0 !important;
  pointer-events: none;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  max-height: 0;
  overflow: hidden;
  transform: scale(0.98);
  transition: opacity 0.2s ease-in,
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              margin 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              padding 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-item.showing {
  transition: opacity 0.35s ease-out 0.2s,
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              margin 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              padding 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-item.animate-ready {
  opacity: 0;
  transform: translateY(-15px);
}

@keyframes fadeInSlideDown {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInPlace {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.post-item:hover:not(.hiding) {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(74, 171, 247, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.post-item-link {
  display: flex !important;
  flex-direction: row !important;
  padding: 0;
  color: inherit;
  text-decoration: none;
  width: 100%;
  align-items: flex-start;
  flex-wrap: nowrap;
  height: 150px;
}

@media (min-width: 601px) {
  .post-item-link {
    flex-direction: row !important;
  }
}

.post-item-content {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.25rem;
  flex: 1;
  min-width: 0;
  justify-content: space-between;
  height: 100%;
}

.post-item-image {
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  height: 150px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(74, 171, 247, 0.15), rgba(74, 171, 247, 0.05));
  flex-shrink: 0;
}

.post-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.post-item:hover .post-item-image img {
  transform: scale(1.08);
}

.post-item-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.post-item-content h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text-primary);
  transition: color 0.2s ease;
}

.post-item-link:hover h2 {
  color: var(--color-accent);
}

.post-item-content time {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  opacity: 0.8;
  flex-shrink: 0;
  font-weight: 500;
}

.post-item-header .post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}

.post-item-content p {
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
  word-wrap: break-word;
  font-size: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-item .post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.post-item .post-tags .tag {
  pointer-events: auto;
  cursor: pointer;
}

/* ========== Single Post ========== */
.post {
  max-width: 800px;
  margin: 0 auto;
  padding: 120px 2rem 2rem;
}

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

.post-header h1 {
  margin-bottom: 1rem;
  color: var(--color-text-primary);
}

.post-meta {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.post-meta time {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* ========== Post Carousel ========== */
.post-carousel {
  position: relative;
  width: 100%;
  margin: 2rem 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 1rem;
}

.carousel-slide img {
  max-width: 100%;
  max-height: calc(100% - 60px);
  object-fit: contain;
  border-radius: 8px;
}

.carousel-caption {
  margin-top: 1rem;
  color: var(--color-text-secondary);
  text-align: center;
  font-size: 0.9rem;
  padding: 0 1rem;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--color-text-primary);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.carousel-btn:hover {
  background: rgba(74, 171, 247, 0.3);
  border-color: var(--color-accent);
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.carousel-btn-prev {
  left: 1rem;
}

.carousel-btn-next {
  right: 1rem;
}

.carousel-btn svg {
  width: 24px;
  height: 24px;
}

.carousel-indicators {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.carousel-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.carousel-indicator:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.2);
}

.carousel-indicator.active {
  background: var(--color-accent);
  width: 24px;
  border-radius: 5px;
}

@media (max-width: 768px) {
  .carousel-container {
    height: 400px;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
  }

  .carousel-btn svg {
    width: 20px;
    height: 20px;
  }

  .carousel-btn-prev {
    left: 0.5rem;
  }

  .carousel-btn-next {
    right: 0.5rem;
  }
}

.post-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 2rem 0;
}

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

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

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

.post-content code {
  background-color: var(--color-bg-secondary);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'Courier New', monospace;
  color: var(--color-accent-light);
}

.post-content pre {
  background-color: var(--color-bg-secondary);
  padding: 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.post-content pre code {
  background-color: transparent;
  padding: 0;
}

.post-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.post-footer a {
  color: var(--color-text-muted);
  transition: color 0.3s;
}

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

/* ========== Tags ========== */
.post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: rgba(74, 171, 247, 0.1);
  border: 1px solid var(--color-accent);
  border-radius: 16px;
  font-size: 0.8rem;
  color: var(--color-accent-light);
  text-decoration: none;
  transition: all 0.3s;
}

.tag:hover {
  background: rgba(74, 171, 247, 0.2);
  color: var(--color-accent);
  transform: translateY(-2px);
}

.tag-active {
  background: var(--color-accent);
  color: #000;
  border-color: var(--color-accent);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(74, 171, 247, 0.6);
}

.tag-filter {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: var(--color-bg-secondary);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  row-gap: 1rem;
}

.tag-filter strong {
  display: inline-block;
  color: var(--color-text-primary);
}

.tag-cloud {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.tag-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0) 24%),
              var(--color-bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  text-decoration: none;
  color: var(--color-text-primary);
  transition: all 0.3s;
}

.tag-link:hover {
  background: var(--color-bg-tertiary);
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(74, 171, 247, 0.15);
}

.tag-count {
  font-size: 0.875rem;
  opacity: 0.7;
  color: var(--color-text-muted);
}

/* ========== Utilities ========== */
.view-all {
  text-align: center;
  margin-top: 2rem;
}

.view-all a {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-accent);
}

.view-all a:hover {
  color: var(--color-accent-light);
}

.back-link {
  text-align: center;
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.back-link a {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  min-height: 44px;
}

.back-link a:hover {
  color: var(--color-accent-light);
}

.back-to-top {
  text-align: center;
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.back-to-top a {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.3s, transform 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  min-height: 44px;
}

.back-to-top a:hover {
  color: var(--color-accent-light);
  transform: translateY(-3px);
}

/* ========== Contact Section ========== */
.contact-section {
  background-color: var(--color-bg-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 4rem;
  margin-bottom: 0;
  padding: 4rem 2rem;
  scroll-margin-top: 80px;
}

.contact-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.contact-description {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.contact-content {
  display: flex;
  justify-content: center;
  align-items: center;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  min-height: 48px;
  font-size: 1.125rem;
  color: var(--color-text-primary);
  background: var(--color-bg-card);
  border: 1px solid rgba(74, 171, 247, 0.3);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.contact-email svg {
  color: var(--color-accent);
  flex-shrink: 0;
}

.contact-email:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent);
  box-shadow: 0 6px 20px rgba(74, 171, 247, 0.2);
}

.contact-email:hover svg {
  color: var(--color-accent-light);
}

/* ========== Footer ========== */
.site-footer {
  background-color: var(--color-bg-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 0;
  margin-top: auto;
  text-align: center;
  color: var(--color-text-dimmed);
  flex-shrink: 0;
}

/* ========== Responsive ========== */
@media (max-width: 1400px) {
  .hero-section {
    flex-direction: column;
    align-items: center;
    padding: 90px 2rem 2rem;
    min-height: auto;
  }

  .hero-content {
    width: 100%;
    max-width: 500px;
    min-width: 0;
    height: auto;
    max-height: none;
    min-height: auto;
  }

  .hero-projects {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    min-height: auto;
    min-width: 0;
  }
}

@media (max-width: 1024px) {
  :root {
    --card-h: 440px;
  }
}

@media (max-width: 768px) {
  :root {
    --card-h: 420px;
  }

  /* Hide shader canvas on mobile for better performance */
  .shader-canvas {
    display: none;
  }

  .site-header .container {
    flex-direction: column;
    gap: 1rem;
  }

  .site-nav {
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
  }

  .site-nav a {
    padding: 0.75rem 1rem;
  }

  .hero-section {
    flex-direction: column !important;
    padding-top: 140px;
    gap: 1.5rem;
  }

  .hero-content {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    min-width: 0 !important;
    max-width: 100%;
    width: 100%;
  }

  .hero-projects {
    min-width: 0 !important;
    width: 100%;
    padding: 1.5rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .hero-image img {
    width: 150px;
    height: 150px;
  }

  .hero-text h2 {
    font-size: 1.75rem;
  }

  .hero-text p {
    font-size: 1rem;
  }

  .skills-badges {
    justify-content: center;
  }

  h1 {
    font-size: 2rem;
  }

  .section-title {
    font-size: 2rem;
  }

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

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

@media (max-width: 600px) {
  .post-item-link {
    flex-direction: column !important;
    height: auto;
  }

  .post-item-image {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 180px;
  }

  .post-item-content {
    width: 100%;
    padding: 1.25rem;
  }

  .post-item-content h2 {
    font-size: 1.2rem;
  }

  .post-item-content p {
    font-size: 0.9rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

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

@media (max-width: 480px) {
  :root {
    --card-h: auto;
  }

  .container {
    padding: 0 1rem;
  }

  .site-nav {
    gap: 0.25rem;
  }

  .site-nav a {
    font-size: 0.9rem;
    padding: 0.75rem 0.75rem;
  }

  .site-title {
    font-size: 1.25rem;
  }

  .hero-section {
    padding: 120px 0.75rem 1.5rem;
    gap: 1rem;
  }

  .hero-content {
    padding: 1.25rem;
    text-align: center;
    gap: 1rem;
  }

  .hero-projects {
    padding: 1.25rem;
  }

  .hero-image img {
    width: 120px;
    height: 120px;
  }

  .hero-text h2 {
    font-size: 1.5rem;
  }

  .hero-text p {
    font-size: 0.85rem;
  }

  .post-item-image {
    height: 160px;
  }

  .post-item-content {
    padding: 1rem;
  }

  .post-item-content h2 {
    font-size: 1.1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .section-title {
    font-size: 1.3rem;
  }

  .badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
  }

  .post-card-content h3 {
    font-size: 1.25rem;
  }
}

/* ========== About Page ========== */

/* Retro GIF positioning - kept for nostalgic charm */
.retro-gif {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  image-rendering: pixelated;
  opacity: 0.6;
}

.retro-gif-1 {
  top: 150px;
  left: 20px;
  width: 40px;
  animation: float 3s ease-in-out infinite;
}

.retro-gif-2 {
  top: 150px;
  right: 20px;
  width: 40px;
  animation: float 3.5s ease-in-out infinite;
}

.retro-gif-3 {
  bottom: 100px;
  left: 50px;
  width: 100px;
  animation: blink-slow 2s infinite;
}

.retro-gif-4 {
  top: 200px;
  right: 80px;
  width: 60px;
  animation: spin 10s linear infinite;
}

.retro-gif-5 {
  top: 120px;
  left: 45%;
  width: 30px;
  animation: flicker 1.5s infinite;
}

.retro-gif-6 {
  top: 120px;
  right: 45%;
  width: 30px;
  animation: flicker 1.8s infinite;
}

.retro-gif-7 {
  bottom: 80px;
  right: 100px;
  width: 50px;
  animation: bounce 2s infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
}

@keyframes blink-slow {
  0%, 49% { opacity: 0.6; }
  50%, 100% { opacity: 0.3; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes flicker {
  0%, 50%, 100% { opacity: 0.6; }
  25%, 75% { opacity: 0.4; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.about-container {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  min-height: calc(100vh - 200px);
}

/* Modern minimalist background - keep shader canvas visible */
body:has(.about-container) {
  background: var(--color-bg-primary);
}

/* Add subtle gradient overlay on top of shader */
.hero-section:has(.about-container)::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(74, 171, 247, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(74, 171, 247, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.about-card {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
}

.about-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.about-image {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 4px solid rgba(74, 171, 247, 0.3);
  object-fit: cover;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s, box-shadow 0.3s;
}

.about-image:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 48px rgba(74, 171, 247, 0.3);
}

.about-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  letter-spacing: -0.5px;
}

.about-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  font-weight: 500;
  margin: 0;
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.about-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(74, 171, 247, 0.3);
}

.about-content p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
  margin: 0;
}

.about-content .skills-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.about-content .skills-badges .badge {
  background: rgba(74, 171, 247, 0.15);
  border: 1px solid var(--color-accent);
  color: var(--color-accent-light);
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  transition: all 0.3s;
  font-size: 0.95rem;
}

.about-content .skills-badges .badge:hover {
  background: rgba(74, 171, 247, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 171, 247, 0.3);
}

.about-card .contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: rgba(74, 171, 247, 0.15);
  border: 1px solid var(--color-accent);
  color: var(--color-text-primary);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  font-size: 1rem;
  margin-top: 1rem;
}

.about-card .contact-button:hover {
  background: rgba(74, 171, 247, 0.25);
  border-color: var(--color-accent-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 171, 247, 0.4);
  color: var(--color-text-primary);
}

.about-card .contact-button svg {
  flex-shrink: 0;
  color: var(--color-accent);
  transition: color 0.3s;
}

.about-card .contact-button:hover svg {
  color: var(--color-accent-light);
}

.contact-button svg {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .about-card {
    padding: 2rem;
  }

  .about-header h1 {
    font-size: 2rem;
  }

  .about-subtitle {
    font-size: 1.125rem;
  }

  .about-image {
    width: 150px;
    height: 150px;
  }

  .about-content h2 {
    font-size: 1.25rem;
  }

  .about-content p {
    font-size: 1rem;
  }

  .retro-gif {
    display: none;
  }
}

@media (max-width: 480px) {
  .about-card {
    padding: 1.5rem;
  }

  .about-image {
    width: 120px;
    height: 120px;
  }

  .about-header h1 {
    font-size: 1.75rem;
  }
}
