/* Pixel font (optional but recommended) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=VT323&display=swap');

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #ffe6f0;
  font-family: 'VT323', monospace;
  color: #000;
}

/* Header */
header {
  margin-top: 22px;
  text-align: center;
  position: relative;
}

header h1 {
  font-family: 'VT323', monospace;
  font-size: 50px;
  display: inline-block;
  margin: 0 0px;
  font-weight: normal;
}

.name-wrapper {
  position: relative;
  display: inline-block;
}

.star.left {
  position: relative;
  width: 45px;
  left: 0px;
  bottom: -30px;
  transform: rotate(9deg);
}

.winkstar.right {
  width: 40px;
  position: relative;
  right: 8px;
  top: -13px;
  transform: rotate(-15deg); /* Tilts the star slightly */
}

nav {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 20px 0 20px 0;
}

.nav-button {
  background: #ffc0da;
  border: none;
  padding: 8px 14px;
  font-family: 'VT323', monospace;
  font-size: 18px;
  cursor: pointer;
  
  /* ADD THESE FOUR LINES TO FIX THE LINK LOOK */
  text-decoration: none;    /* Removes the underline */
  color: #000000;             /* Forces the text to stay black */
  display: inline-block;   /* Allows padding and height to work correctly */
  line-height: normal;     /* Centers text vertically */
}

/* Make sure the hover still works */
.nav-button:hover {
  background: hotpink;
  color: #000;             /* Keeps text black even when hovering */
}

/* Left sidebar (used on technical-blog) */
.sidebar {
  position: relative;
  width: 180px;
  background: #ffc0da;
  padding: 16px 12px 24px;
  box-shadow: 4px 0 8px rgba(0, 0, 0, 0.08);
  transition: width 0.25s ease;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.sidebar.is-open {
  width: 180px;
}

.sidebar:not(.is-open) {
  width: 40px;
}

.sidebar-toggle {
  align-self: flex-start;
  width: 32px;
  height: 32px;
  border-radius: 0 8px 8px 0;
  border: none;
  background: #ffc0da;
  cursor: pointer;
  font-family: 'VT323', monospace;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 4px 0 8px rgba(0, 0, 0, 0.08);
}

.sidebar-toggle:hover {
  background: hotpink;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0 0 0;
}

.sidebar .nav-button {
  width: 100%;
  text-align: left;
}

.sidebar:not(.is-open) .blog-nav {
  opacity: 0;
  pointer-events: none;
}

.page-with-sidebar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px 40px 16px;
  column-gap: 32px;
}

.page-main {
  flex: 1;
}

/* Blog article layout */
.blog-article-main {
  display: block;
  max-width: 1120px;
  margin: 40px auto 60px;
  padding: 0 20px;
}

.blog-article-header h2 {
  font-family: 'VT323', monospace;
  font-size: 36px;
  margin-bottom: 8px;
}

.blog-article-kicker {
  font-size: 18px;
  opacity: 0.8;
  margin-bottom: 4px;
}

.blog-article-meta {
  font-size: 18px;
  opacity: 0.8;
}

.blog-article-section {
  margin-top: 32px;
}

.blog-article-section h3,
.blog-article-section h4 {
  font-size: 26px;
  margin-bottom: 8px;
}

.blog-article-section p,
.blog-article-section li {
  font-size: 20px;
  line-height: 1.3;
}

.blog-article-section ul {
  padding-left: 20px;
}

.blog-article-main pre {
  background: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 14px;
}

.blog-article-main code {
  font-family: monospace;
}

.ascii-diagram {
  font-size: 14px;
}

.rag-demo {
  margin-top: 16px;
  padding: 16px 16px 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #eee;
}

.rag-label {
  display: block;
  font-size: 18px;
  margin: 12px 0 4px;
}

.rag-input {
  width: 100%;
  font-family: 'VT323', monospace;
  font-size: 18px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  resize: vertical;
}

.rag-button {
  margin-top: 10px;
  background: #ffc0da;
  border: none;
  padding: 8px 16px;
  font-family: 'VT323', monospace;
  font-size: 18px;
  cursor: pointer;
}

.rag-button:hover {
  background: hotpink;
}

.rag-output {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.rag-retrieved ul {
  padding-left: 20px;
}

.rag-retrieved li {
  font-size: 16px;
  margin-bottom: 8px;
}

.rag-answer p {
  white-space: pre-wrap;
  font-size: 18px;
}

@media (max-width: 900px) {
  .blog-article-main {
    margin: 24px auto 40px;
    padding: 0 15px 40px;
  }

  .rag-output {
    grid-template-columns: 1fr;
  }
}

/* Main layout */
main {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 40px 40px 40px;
}

.image-container {
  position: relative; /* anchor for absolutely-positioned .hover-img */
  width: 100%;
  max-width: 300px; /* match the left grid column */
}

.image-container .main-img {
  margin-top: 77px; 
  display: block; 
  width: 100%;
  max-width: 100%;
  height: auto; 
  image-rendering: pixelated;
}

.hover-img {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
}


.show-piece {
  opacity: 1 !important;
  transform: scale(1.05); /* Optional "pop" effect */
}

/* "Sticky" state */
.is-active {
  opacity: 1 !important;
  visibility: visible !important;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

/* individual image positioning */

/* pixel-art */
.pixel-1 {
  top: 5.9%;  
  right: 50.1%; 
  width: 20.7%; 
}

.pixel-2 {
  top: 21.4%;  
  right: 72.5%; 
  width: 31.5%; 
}

.pixel-3 {
  bottom: 39.8%; 
  right: 79.8%; 
  width: 18.9%; 
}

.pixel-4 {
  bottom: 15.9%; 
  right: 60.8%; 
  width: 18.9%; 
}

/* describe */
.describe-1 {
  top: 1.9%;  
  right: 70.1%; 
  width: 27.7%; 
}

.describe-2 {
  top: 21.4%;  
  right: 98.5%; 
  width: 43.5%; 
}

.describe-3 {
  bottom: 39.8%; 
  right: 99.8%; 
  width: 29%; 
}

.describe-4 {
  bottom: 13.9%; 
  right: 70.8%; 
  width: 38%; 
}

/* nextera */
.nextera-1 {
  top: 0%;  
  right: 40.1%; 
  width: 45.7%; 
}

.nextera-2 {
  top: 13.4%;  
  right: 96.5%; 
  width: 22.5%; 
}

.nextera-3 {
  bottom: 35.8%; 
  right: 90.8%; 
  width: 80.9%; 
}

.nextera-4 {
  bottom: 0%; 
  right: 60.8%; 
  width: 80.9%; 
}

/* scraply */
.scraply-1 {
  bottom: 43.8%; 
  right: 85.8%; 
  width: 90.9%; 
  border-radius: 3px;
}

/* entropy */
.entropy-1 {
  top: 0%;  
  right: 40.1%; 
  width: 26.8%; 
}

.entropy-2 {
  top: 10.4%;  
  right: 83.5%; 
  width: 55.5%; 
}

.entropy-3 {
  bottom: 13.8%; 
  right: 100.8%; 
  width: 35.9%; 
}

.entropy-4 {
  bottom: 0.7%; 
  right: 24.8%; 
  width: 55.9%; 
}

/* touch */
.touch-1 {
  top: 0%;  
  right: 40.1%; 
  width: 30.7%; 
}

.touch-2 {
  top: 13.4%;  
  right: 79.5%; 
  width: 30.5%; 
}

.touch-3 {
  bottom: 35.8%; 
  right: 85.8%; 
  width: 30.9%; 
}

.touch-4 {
  bottom: 10%; 
  right: 62.8%; 
  width: 40.9%; 
}

/* Text */
.text h2 {
  font-family: 'VT323', monospace;
  font-size: 30px;
  margin-top: 20px;
  margin-bottom: 2px;
  font-weight: 500;
}

/* Social links */

.social-links {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-top: 12px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #000;
  font-size: 18px;
  padding: 4px 0;
  transition: background-color 0.2s ease;
  border-radius: 2px;
}

.social-link:hover {
  background-color: rgba(255, 192, 218, 0.5);
}

.social-icon {
  width: 28px;
  height: 28px;
  object-fit: cover;
  object-position: center;
  flex-shrink: 0;
  border-radius: 2px;
}

.text p {
  font-family: 'VT323', monospace;
  font-size: 20px;
  line-height: 1.2;
}

/* Underlined text with pastel green highlight */
u {
  background-color: #ffc0da;
  text-decoration: underline;
}

/* Make trigger elements look like buttons */
u.trigger {
  background-color: #ffc0da;
  padding: 0.1px 3px;
  border-radius: 0.5px;
  cursor: pointer;
  display: inline-block;
  text-decoration: underline;
  transition: background-color 0.2s ease;
  /* border: 1px solid rgba(0, 0, 0, 0.1); */
}

u.trigger:hover {
  background-color: hotpink;
}

/* Darker pastel green when clicked */
u.clicked {
  background-color: hotpink;
  /* color: white; */
}

/* Scroll to top button */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #ffc0da;
  border: none;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background: hotpink;
}

.scroll-to-top img {
  width: 50px;
  height: 50px;
  image-rendering: pixelated;
}

.scroll-to-top span {
  color: #000;
}

/* Mobile Responsive Styles */
@media (max-width: 900px) {
  /* Stack main layout vertically on mobile */
  main {
    grid-template-columns: 1fr;
    padding: 20px 15px 40px 15px;
    gap: 20px;
  }

  /* Center image container on mobile */
  .image-container {
    max-width: 200px;
    margin: 0 auto;
    overflow: visible;
  }

  .image-container .main-img {
    margin-top: 20px;
  }

  /* Scale down all hover images on mobile */
  .hover-img {
    transform: scale(0.7);
    transform-origin: center center;
  }

  /* Adjust show-piece scale to work with base scale */
  .show-piece {
    transform: scale(0.735) !important; /* 0.7 * 1.05 */
  }

  /* Reposition all hover images to be outside main image on mobile */
  /* Images on the RIGHT side */
  .pixel-1 {
    left: calc(100% - 15px) !important;
    top: 25.9% !important;
    width: 60px !important;
  }

  .pixel-3 {
    left: calc(100%) !important;
    bottom: 19.8% !important;
    width: 50px !important;
  }

  .describe-1 {
    left: calc(100% - 15px) !important;
    top: 18.9% !important;
    width: 70px !important;
  }

  .describe-3 {
    left: calc(100%) !important;
    bottom: 19.8% !important;
    width: 75px !important;
  }

  .nextera-1 {
    left: calc(100%) !important;
    top: 20% !important;
    width: 100px !important;
  }

  .nextera-3 {
    left: calc(100%) !important;
    bottom: 15.8% !important;
    width: 150px !important;
  }

  .scraply-1 {
    right: calc(100% - 60px) !important;
    bottom: 33.8% !important;
    width: 160px !important;
  }

  .entropy-1 {
    left: calc(100% - 10px) !important;
    top: 20% !important;
    width: 60px !important;
  }

  .entropy-3 {
    left: calc(100% + 5px) !important;
    bottom: 13.8% !important;
    width: 80px !important;
  }

  .touch-1 {
    left: calc(100% - 25px) !important;
    top: 20% !important;
    width: 80px !important;
  }

  .touch-3 {
    left: calc(100% + 10px) !important;
    bottom: 8% !important;
    width: 80px !important;
  }

  /* Images on the LEFT side */
  .pixel-2 {
    right: calc(100% - 40px) !important;
    top: 19.4% !important;
    width: 80px !important;
  }

  .pixel-4 {
    right: calc(100% - 10px) !important;
    left: auto !important;
    bottom: 15.9% !important;
    width: 50px !important;
  }

  .describe-2 {
    right: calc(100% - 45px) !important;
    top: 15.4% !important;
    width: 120px !important;
  }

  .describe-4 {
    right: calc(100% - 30px) !important;
    bottom: 9.9% !important;
    width: 70px !important;
  }

  .nextera-2 {
    right: calc(100% - 15px) !important;
    top: 20% !important;
    width: 50px !important;
  }

  .nextera-4 {
    right: calc(100% - 30px) !important;
    bottom: 10% !important;
    width: 150px !important;
  }

  .entropy-2 {
    right: calc(100% - 50px) !important;
    top: 3.4% !important;
    width: 120px !important;
  }

  .entropy-4 {
    right: calc(100% - 10px) !important;
    bottom: 0.7% !important;
    width: 120px !important;
  }

  .touch-2 {
    right: calc(100% - 40px) !important;
    top: 20.4% !important;
    width: 80px !important;
  }

  .touch-4 {
    right: calc(100% - 30px) !important;
    bottom: 10% !important;
    width: 100px !important;
  }

  /* Make navigation wrap on smaller screens */
  nav {
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 15px;
  }

  .nav-button {
    font-size: 16px;
    padding: 6px 12px;
  }

  /* Adjust header for mobile */
  header h1 {
    font-size: 36px;
  }

  .star.left {
    width: 35px;
    bottom: -25px;
  }

  .winkstar.right {
    width: 32px;
    top: -10px;
  }

  /* Adjust text sizes for mobile */

  .text h2 {
    font-size: 26px;
    margin-top: 10px;
  }

  .social-icon {
    width: 24px;
    height: 24px;
  }

  .social-link {
    font-size: 16px;
  }

  .text p {
    font-size: 18px;
  }

  /* Adjust scroll-to-top button for mobile */
  .scroll-to-top {
    bottom: 15px;
    right: 15px;
    padding: 10px 12px;
    font-size: 16px;
  }

  .scroll-to-top img {
    width: 40px;
    height: 40px;
  }

  /* Hide scroll-to-top text on very small screens */
  .scroll-to-top span {
    display: none;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  main {
    padding: 15px 10px 30px 10px;
  }

  /* Make images even smaller on very small screens */
  .image-container {
    max-width: 150px;
    overflow: visible;
  }

  .hover-img {
    transform: scale(0.5);
    transform-origin: center center;
  }

  /* Adjust show-piece scale for very small screens */
  .show-piece {
    transform: scale(0.525) !important; /* 0.5 * 1.05 */
  }

  /* Further adjust positioning for very small screens - keep outside main image */
  .pixel-1 {
    width: 45px !important;
  }

  .pixel-2 {
    width: 60px !important;
  }

  .pixel-3 {
    width: 40px !important;
  }

  .pixel-4 {
    width: 40px !important;
  }

  .describe-1 {
    width: 45px !important;
  }

  .describe-2 {
    width: 60px !important;
  }

  .describe-3 {
    width: 45px !important;
  }

  .describe-4 {
    width: 55px !important;
  }

  .nextera-1 {
    width: 75px !important;
  }

  .nextera-2 {
    width: 40px !important;
  }

  .nextera-3 {
    width: 110px !important;
  }

  .nextera-4 {
    width: 110px !important;
  }

  .scraply-1 {
    width: 120px !important;
  }

  .entropy-1 {
    width: 45px !important;
  }

  .entropy-2 {
    width: 90px !important;
  }

  .entropy-3 {
    width: 60px !important;
  }

  .entropy-4 {
    width: 90px !important;
  }

  .touch-1 {
    width: 55px !important;
  }

  .touch-2 {
    width: 55px !important;
  }

  .touch-3 {
    width: 55px !important;
  }

  .touch-4 {
    width: 70px !important;
  }

  header h1 {
    font-size: 28px;
  }

  .star.left {
    width: 28px;
    bottom: -20px;
  }

  .winkstar.right {
    width: 26px;
    top: -8px;
  }

  .text h2 {
    font-size: 22px;
  }

  .social-icon {
    width: 20px;
    height: 20px;
  }

  .social-link {
    font-size: 14px;
  }

  .text p {
    font-size: 16px;
  }

  .nav-button {
    font-size: 14px;
    padding: 5px 10px;
  }

  nav {
    gap: 8px;
  }
}