:root {
  --accent: #39ff14;
  --accent-faded: #39ff1499;
  --bg-dark: #101216;
  --bg-darker: #0a0b0e;
  --fg-bright: #d6f5e3;
}

body {
  margin: 0;
  font-family: 'Fira Code', monospace;
  background: var(--bg-dark);
  color: var(--fg-bright);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1em;
}

.site-title {
  text-decoration: none;
  font-family: 'Fira Code', monospace;
  font-weight: bold;
  font-size: 1.5em;
  color: var(--accent);
  letter-spacing: 0.04em;
  position: relative;
}

.site-title .cursor {
  display: inline-block;
  font-size: 1.2em;
  background: none;
  color: var(--accent);
  animation: blink-cursor 1s steps(2, start) infinite;
}

@keyframes blink-cursor {

  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1em;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--accent);
  padding: 0.2em 0.5em;
  border-radius: 3px;
  transition: background 0.2s, color 0.2s;
}

.nav-links a:hover {
  background: var(--accent-faded);
  color: var(--bg-dark);
}

.container {
  display: flex;
  max-width: 900px;
  margin: 2em auto;
  gap: 2em;
  /* background: var(--bg-dark); */
  border-radius: 12px;
  /* box-shadow: 0 4px 24px #0006; */
}

.sidebar {
  min-width: 180px;
  background: var(--bg-darker);
  border-radius: 8px;
  padding: 1em;
  box-sizing: border-box;
  color: var(--fg-bright);
}

.sidebar-section h3 {
  margin-top: 0;
}

#sidebar-filter {
  transition: max-height 0.3s, opacity 0.3s, margin-bottom 0.3s;
}

/* .toggle-crt, */
.sidebar-collapsible-toggle {
  display: block;
  background: var(--accent-faded);
  color: var(--bg-dark);
  border: none;
  border-radius: 6px;
  font-size: 1em;
  font-family: 'Fira Code', monospace;
  padding: 0.5em 0.7em;
  cursor: pointer;
  margin-bottom: 0.5em;
  width: 100%;
  transition: background 0.2s, color 0.2s;
}

#sidebar-filter.collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-bottom: 0;
  pointer-events: none;
}

.main-content {
  flex: 1;
  background: var(--bg-darker);
  border-radius: 8px;
  padding: 2em;
  box-sizing: border-box;
  box-shadow: 0 2px 8px #0002;
  color: var(--fg-bright);
}

/* Blog */

.blog-header-row {
  display: flex;
  align-items: center;
  gap: 1em;
  flex-wrap: wrap;
  padding-bottom: 1em;
}

.search-bar {
  flex: 1;
  min-width: 180px;
  padding: 0.5em 1em;
  border-radius: 6px;
  border: 1px solid var(--accent-faded);
  background: var(--bg-dark);
  color: #d6f5e3;
  font-family: 'Fira Code', monospace;
}

.unread-notification {
  background: var(--accent);
  color: var(--bg-dark);
  padding: 0.3em 0.7em;
  border-radius: 3px;
  margin-left: 0.5em;
  position: absolute;
  top: 0;
  right: 0;
  transition: opacity 1s;
}

#posts-container {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
  max-height: 500px;
  overflow-y: auto;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
  scrollbar-color: var(--accent-faded) transparent;
  margin-bottom: 1em;
}

#posts-container::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera*/
}

#category-list {
  list-style: none;
  padding: 0;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1em;
  border: 1px solid var(--accent-faded);
  border-radius: 6px;
}

.post-nav span {
  /* Invisible placeholder to keep spacing */
  text-align: center;
  color: var(--accent-faded);
  padding: 0.3em 0.7em;
  margin: 0.2em 0;
  opacity: 0.5;
  /* flex: 1; */
  cursor: not-allowed;
}


#back-to-blog,
.post-nav button,
.toggle-crt,
#category-list button {
  background: none;
  border: none;
  color: var(--accent);
  padding: 0.3em 0.7em;
  margin: 0.2em 0;
  border-radius: 3px;
  cursor: pointer;
  font-size: 1em;
  font-family: 'Fira Code', monospace;
  transition: background 0.2s, color 0.2s;
}

#back-to-blog:hover,
.post-nav button:hover,
.toggle-crt:hover,
.toggle-crt.active,
#category-list button:hover,
#category-list button.active {
  background: var(--accent-faded);
  color: var(--bg-dark);
  font-weight: bold;
}

.post {
  background: #090e13;
  border-radius: 6px;
  padding: 1em;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.post-preview {
  /* For positioning unread notification on post preview */
  display: inline-block;
  position: relative;
}

.post-title {
  margin: 0 0 0.3em 0;
  font-size: 1.1em;
}

.post-meta {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 0.5em;
}

/* Blog - Post windows */

/* Overall post window */
.post-window {
  background: #0d0d0d;
  /* dark terminal background */
  border: 2px solid var(--accent);
  /* neon cyan border */
  border-radius: 4px;
  margin-bottom: 1.5em;
  font-family: 'Courier New', Courier, monospace;
  box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent-faded);
  /* subtle neon glow */
  overflow: hidden;
}

/* Toolbar at the top */
.post-toolbar {
  background: #111;
  /* slightly lighter than window */
  color: var(--accent);
  /* neon text */
  font-weight: bold;
  padding: 6px 10px;
  font-size: 0.9em;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Title glow effect */
.post-window-title {
  text-shadow: 0 0 4px var(--accent), 0 0 8px var(--accent);
  flex: 1;
}

/* Content area */
.post-window-content {
  padding: 12px;
  color: var(--accent);
  line-height: 1.4em;
  background: #0d0d0d;
  border-top: 1px solid var(--accent);
  /* subtle separator */
}

/* Post metadata */
.post-meta {
  font-size: 0.75em;
  color: var(--accent);
  margin-bottom: 6px;
}

/* Optional hover glow on entire window */
.post-window:hover {
  box-shadow: 0 0 15px var(--accent), 0 0 25px var(--accent-faded);
}


/* End Blog - Post Windows */


/* End Blog */

/* Notification */

.notification {
  background: var(--accent);
  color: var(--bg-dark);
  text-align: center;
  padding: 0.5em 1em;
  border-radius: 6px;
  position: fixed;
  bottom: 1em;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  animation: fade-out 0.2s 1 forwards;
  animation-delay: 4s;
}

@keyframes fade-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* End notification */

/* Footer */

.footer-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7em;
}

.footer-icons {
  display: flex;
  gap: 0.5em;
  margin-bottom: 0.5em;
}

.footer-icon svg {
  display: block;
  width: 24px;
  height: 24px;
  color: var(--accent);
  transition: color 0.2s;
}

.footer-icon:hover svg {
  color: var(--fg-bright);
}

.footer-copyright {
  text-align: center;
  font-size: 1em;
  color: #666;
}

/* End Footer */

@media (max-width: 700px) {
  nav {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5em 0.5em;
  }

  .site-title {
    font-size: 1.2em;
    margin-bottom: 0.5em;
  }

  .nav-links {
    /* flex-direction: column; */
    gap: 0.5em;
    width: 100%;
  }

  .sidebar {
    padding: 0.7em;
  }

  .main-content {
    padding: 0.7em;
    font-size: 1em;
  }

  .projects-grid-inner {
    grid-template-columns: 1fr;
    gap: 1em;
  }

  .footer-content {
    padding: 0.5em;
    font-size: 0.95em;
  }

  .container {
    flex-direction: column;
    gap: 1em;
  }

  .sidebar {
    min-width: 0;
    margin-bottom: 1em;
  }

  .main-content {
    padding: 1em;
  }

  .footer-content {
    padding: 0 1em;
  }

  .post-nav button {
    font-size: smaller;
  }
}


/* Projects grid styles */
.projects-grid {
  width: 100%;
  margin-top: 1em;
}

.projects-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5em;
}

.project-card {
  background: #090e13;
  border-radius: 6px;
  padding: 1em;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
  transition: box-shadow 0.2s;
}

.project-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.project-title {
  margin: 0 0 0.3em 0;
  font-size: 1.1em;
}

.project-meta {
  padding: 0.5em 0.5em 0 0.5em;
  font-size: 0.9em;
  color: #666;
  margin-bottom: 0.5em;
}

.project-desc {
  font-size: 1em;
  color: #222;
}

.project-full {
  border-radius: 8px;
  padding: 2em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.back-to-projects {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1em;
  cursor: pointer;
  margin-bottom: 1em;
}

/* End projects */















/* CRT */
@keyframes flicker {
  0% {
    opacity: 0.27861;
  }

  5% {
    opacity: 0.34769;
  }

  10% {
    opacity: 0.23604;
  }

  15% {
    opacity: 0.90626;
  }

  20% {
    opacity: 0.18128;
  }

  25% {
    opacity: 0.83891;
  }

  30% {
    opacity: 0.65583;
  }

  35% {
    opacity: 0.67807;
  }

  40% {
    opacity: 0.26559;
  }

  45% {
    opacity: 0.84693;
  }

  50% {
    opacity: 0.96019;
  }

  55% {
    opacity: 0.08594;
  }

  60% {
    opacity: 0.20313;
  }

  65% {
    opacity: 0.71988;
  }

  70% {
    opacity: 0.53455;
  }

  75% {
    opacity: 0.37288;
  }

  80% {
    opacity: 0.71428;
  }

  85% {
    opacity: 0.70419;
  }

  90% {
    opacity: 0.7003;
  }

  95% {
    opacity: 0.36108;
  }

  100% {
    opacity: 0.24387;
  }
}

@keyframes textShadow {
  0% {
    text-shadow: 0.4389924193300864px 0 1px rgba(0, 30, 255, 0.5), -0.4389924193300864px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  5% {
    text-shadow: 2.7928974010788217px 0 1px rgba(0, 30, 255, 0.5), -2.7928974010788217px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  10% {
    text-shadow: 0.02956275843481219px 0 1px rgba(0, 30, 255, 0.5), -0.02956275843481219px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  15% {
    text-shadow: 0.40218538552878136px 0 1px rgba(0, 30, 255, 0.5), -0.40218538552878136px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  20% {
    text-shadow: 3.4794037899852017px 0 1px rgba(0, 30, 255, 0.5), -3.4794037899852017px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  25% {
    text-shadow: 1.6125630401149584px 0 1px rgba(0, 30, 255, 0.5), -1.6125630401149584px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  30% {
    text-shadow: 0.7015590085143956px 0 1px rgba(0, 30, 255, 0.5), -0.7015590085143956px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  35% {
    text-shadow: 3.896914047650351px 0 1px rgba(0, 30, 255, 0.5), -3.896914047650351px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  40% {
    text-shadow: 3.870905614848819px 0 1px rgba(0, 30, 255, 0.5), -3.870905614848819px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  45% {
    text-shadow: 2.231056963361899px 0 1px rgba(0, 30, 255, 0.5), -2.231056963361899px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  50% {
    text-shadow: 0.08084290417898504px 0 1px rgba(0, 30, 255, 0.5), -0.08084290417898504px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  55% {
    text-shadow: 2.3758461067427543px 0 1px rgba(0, 30, 255, 0.5), -2.3758461067427543px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  60% {
    text-shadow: 2.202193051050636px 0 1px rgba(0, 30, 255, 0.5), -2.202193051050636px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  65% {
    text-shadow: 2.8638780614874975px 0 1px rgba(0, 30, 255, 0.5), -2.8638780614874975px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  70% {
    text-shadow: 0.48874025155497314px 0 1px rgba(0, 30, 255, 0.5), -0.48874025155497314px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  75% {
    text-shadow: 1.8948491305757957px 0 1px rgba(0, 30, 255, 0.5), -1.8948491305757957px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  80% {
    text-shadow: 0.0833037308038857px 0 1px rgba(0, 30, 255, 0.5), -0.0833037308038857px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  85% {
    text-shadow: 0.09769827255241735px 0 1px rgba(0, 30, 255, 0.5), -0.09769827255241735px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  90% {
    text-shadow: 3.443339761481782px 0 1px rgba(0, 30, 255, 0.5), -3.443339761481782px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  95% {
    text-shadow: 2.1841838852799786px 0 1px rgba(0, 30, 255, 0.5), -2.1841838852799786px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }

  100% {
    text-shadow: 2.6208764473832513px 0 1px rgba(0, 30, 255, 0.5), -2.6208764473832513px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
  }
}

.crt::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: rgba(18, 16, 16, 0.1);
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  animation: flicker 0.15s infinite;
}

.crt::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  z-index: 2;
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
}

.crt {
  animation: textShadow 1.6s infinite;
}

/* End CRT */