:root {
  --bg: #f8f8f8;
  --h1-color: #000000;
  --code-box-border: #21a5e3;
  --code-box-bg: rgba(243, 243, 243, 0.5);
  --text: #1c1c1c;
  --link: #1c1c1c;
  --link-hover: #21a5e3;
  --selection-bg: #1c1c1c;
  --selection-text: #FFFFFF;
  --terminal-accent: #607D8B;
  --border-color: #d0d0d0;
  --audio-icon-on-color: #A9A9A9;
  --audio-icon-off-color: #1c1c1c;
  --divider-color: rgba(28, 28, 28, 0.3);
}

[data-theme="dark"] {
  --bg: #000000;
  --h1-color: #00FF00;
  --code-box-border: #008000;
  --code-box-bg: rgba(0, 50, 0, 0.6);
  --text: #00FF00;
  --link: #00FF00;
  --link-hover: #39FF14;
  --selection-bg: #008000;
  --selection-text: #000000;
  --terminal-accent: #00FF00;
  --border-color: #008000;
  --audio-icon-on-color: #004000;
  --audio-icon-off-color: #39FF14;
  --divider-color: rgba(0, 255, 0, 0.3);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Courier New', monospace;
  line-height: 1.5;
  padding: 2rem;
  padding-top: 6rem;
  overflow-x: hidden;
  transition: all 0.3s ease;
  max-width: 95%;
  margin-left: 20px;
  margin-right: 20px;
}

body:not([data-theme="dark"]) {
  background:
    linear-gradient(rgba(248, 248, 248, 0.9), rgba(248, 248, 248, 0.9)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' %3E%3Cpath d='M0 0h60v60H0z' fill='%23f0f0f0'/%3E%3Cpath d='M0 0L60 60M60 0L0 60' stroke='%23e0e0e0' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 60px 60px;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--code-box-bg);
  border: none;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.navbar-left {
  display: flex;
  align-items: center;
}

.navbar-ascii {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--h1-color);
  line-height: 1;
  letter-spacing: -0.5px;
  white-space: pre;
  margin: 0;
  padding: 0;
}

.navbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.controls-container {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 2rem;
  align-items: center;
}

h1 {
  color: var(--h1-color);
}

h2 {
  color: var(--h1-color);
  font-size: 1.5em;
}

em {
  font-style: normal;
  color: var(--link-hover);
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px dashed;
  background: linear-gradient(0deg, var(--link), var(--link)) no-repeat right bottom / 0 1px;
  transition: background-size 0.5s, border-color 0.5s, color 0.5s;
}

a:hover {
  border-bottom: 1px solid var(--link-hover);
  background: linear-gradient(0deg, var(--link-hover), var(--link-hover)) no-repeat left bottom / 100% 1px;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

mark {
  background: var(--selection-bg);
  color: var(--selection-text);
}

pre {
  margin: 0;
}

ul {
  list-style-type: "> ";
  padding-left: 1rem;
}

li {
  margin-bottom: 0.5rem;
  transition: transform 0.1s ease-out;
}

li:hover {
  transform: translateY(-2px);
}

.video-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: -1;
  display: none;
}

.background-video {
  position: fixed;
  width: auto;
  height: auto;
  min-width: 100%;
  min-height: 100%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  filter: blur(1px) grayscale(20%);
}

.video-overlay {
  background: rgba(0, 0, 0, 0.5);
}

.theme-toggle {
  cursor: pointer;
  font-size: 1.8rem;
  padding: 10px;
  display: inline-block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
  transform: scale(1.2) rotate(3deg);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.audio-toggle {
  cursor: pointer;
  font-size: 1.8rem;
  padding: 10px;
  display: inline-block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.audio-toggle svg {
  fill: var(--audio-icon-on-color);
  width: 1.8rem;
  height: 1.8rem;
  vertical-align: middle;
}

.audio-toggle.audio-off-state svg {
  fill: var(--audio-icon-off-color);
}

.audio-toggle:hover {
  transform: scale(1.2) rotate(3deg);
}

.audio-toggle:active {
  transform: scale(0.95);
}

.audio-toggle.pulsing {
  animation: pulse 1s infinite alternate;
}

.rss-toggle {
  cursor: pointer;
  font-size: 1.8rem;
  padding: 10px;
  display: inline-block;
  text-decoration: none;
  border-bottom: none;
  background: none;
  color: var(--text);
}

.rss-toggle:hover {
  text-decoration: none;
  border-bottom: none;
  background: none;
}

.rss-toggle svg {
  fill: var(--text);
  width: 1.3rem;
  height: 1.3rem;
  vertical-align: middle;
}

.logo-container {
  text-align: right;
  margin: 2rem 0;
  max-width: 100%;
  padding-right: 20px;
}

.glitch-logo {
  max-width: 100%;
  height: auto;
  display: inline-block;
  width: 120px;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.ascii-container {
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  overflow-x: auto;
  margin: 0 auto;
  text-align: start;
}

.ascii-art {
  display: inline-block;
  font-family: 'Courier New', monospace;
  font-size: clamp(0.5rem, 2.5vw, 0.8rem);
  color: var(--h1-color);
  line-height: 1;
  letter-spacing: -0.5px;
  white-space: pre;
  margin: 0;
  padding: 0.5rem 0;
}

.timestamp {
  font-family: monospace;
  color: #808080;
  font-size: 0.7rem;
}

.whoami {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.image-box {
  flex-shrink: 0;
  width: 216px;
  height: 216px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.image-box img {
  width: 100%;
  height: 100%;
  border-radius: 100%;
  object-fit: cover;
}

.text-box {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.code-box {
  background-color: var(--code-box-bg);
  border: 0.5px solid var(--code-box-border);
  font-size: 0.84rem;
  padding: 7px;
  margin: 5px;
  font-family: monospace;
  display: inline-block;
  box-shadow: none;
}

.small-text {
  color: #808080;
  font-size: 0.7rem;
}

.footer {
  bottom: 0;
  width: 100%;
  padding: 10px 20px;
  color: #666;
  font-size: 0.7rem;
  z-index: 100;
  text-align: center;
}

.signature::after {
  content: "_";
  animation: blink 1s step-end infinite;
  color: var(--cursor);
  text-shadow: 0 0 8px var(--cursor), 0 0 12px var(--cursor);
}

.accordion-header {
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.accordion-arrow {
  transition: transform 0.3s ease;
}

.accordion-header:hover .accordion-arrow {
  transform: scale(1.2);
}

.accordion-header.active .accordion-arrow {
  transform: rotate(90deg);
}

.accordion-body {
  display: none;
  color: var(--text);
  margin: 0;
  padding-top: 0.2em;
  padding-left: 1.5em;
  opacity: 0;
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
  transform: translateY(-5px);
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

.accordion-body.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.accordion-body.tree pre {
  font-family: monospace;
  font-size: 0.8rem;
  background-color: var(--code-box-bg, #f9f9f9);
  border: 1px solid var(--code-box-border, #ccc);
  padding: 1em;
  margin: 0;
  white-space: pre;
  overflow-x: auto;
}

.accordion-body.tree pre::-webkit-scrollbar {
  height: 8px;
}

.accordion-body.tree pre::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 4px;
}

.arrow-space {
  width: 0.5em;
}

.featured-projects {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1rem;
}

.project-box {
  background-color: var(--bg);
  border: none;
  padding: 5px;
  font-family: monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease, outline 0.3s ease;
  width: 216px;
  height: 270px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 4px;
}

.project-box:hover {
  transform: translateY(-5px);
  box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.3);
  outline: 1px solid var(--link-hover);
  outline-offset: 2px;
}

.project-box img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  margin-bottom: 5px;
  border-radius: 4px;
}

.project-box p {
  font-size: 0.8rem;
  color: var(--text);
  margin: 0;
  padding-bottom: 10px;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: text-shadow 0.3s ease;
}

.project-box:hover p {
  text-shadow: 0 0 5px var(--link-hover);
}

.project-box a {
  text-decoration: none;
  border-bottom: none;
  background: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  gap: 5px;
  padding: 5px;
  box-sizing: border-box;
}

.project-box a:hover {
  border-bottom: none;
  background: none;
}

.fading-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--divider-color), transparent);
  margin: 2rem 0;
}

.hidden-on-load {
  opacity: 0;
  transition: opacity 0.5s ease;
  visibility: hidden;
  height: 0;
  overflow: hidden;
}

.visible-on-scroll {
  visibility: visible;
  opacity: 1;
  height: auto;
  overflow: visible;
}

.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  background: var(--code-box-bg);
  border: 0.5px solid var(--code-box-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  background: var(--link-hover);
  border-color: var(--link-hover);
}

.scroll-to-top:hover svg {
  fill: var(--bg);
}

.scroll-to-top:active {
  transform: translateY(-2px) scale(0.95);
}

.scroll-to-top svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: var(--text);
  transition: fill 0.3s ease;
}

.hidden-flag::before {
  content: "46 4c 41 47 7b 53 54 59 4c 33 5f 53 48 33 33 54 5f 48 34 43 4b 33 52 5f 32 30 32 7d";
  position: absolute;
  left: -9999px;
  top: -9999px;
  visibility: hidden;
  opacity: 0;
  font-size: 0;
  color: transparent;
  z-index: -1;
}

@media (min-width: 601px) {
  .featured-projects {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .project-box {
    margin-right: 8px;
    margin-bottom: 8px;
  }
}

@media (min-width: 769px) {
  body {
    max-width: 60%;
    margin: 0 auto;
    padding-top: 6rem;
  }

  .navbar {
    padding: 1rem calc((100% - 60%) / 2);
  }
}

@media (max-width: 768px) {
  .video-background {
    position: fixed;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    z-index: -999;
    pointer-events: none;
  }

  .background-video {
    position: fixed;
    width: auto;
    height: auto;
    min-width: 100%;
    min-height: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: cover;
  }

  .video-overlay {
  background: rgba(0, 0, 0, 0.5);
  }

  body > *:not(.video-background):not(.video-overlay) {
    position: relative;
    z-index: 1;
  }
}

@media (max-width: 600px) {
  body {
    padding: 1rem;
    padding-top: 5rem;
    font-size: 0.9rem;
  }

  .navbar {
    padding: 0.8rem 1rem;
    width: 100%;
    left: 0;
    right: 0;
  }

  .scroll-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
  }

  .scroll-to-top svg {
    width: 1rem;
    height: 1rem;
  }

  .navbar-ascii {
    font-size: 0.6rem;
  }

  pre {
    font-size: 0.7rem;
    white-space: pre-wrap;
  }

  ul {
    padding-left: 1.2rem;
  }

  .project-box {
    width: 100%;
    height: auto;
  }

  .project-box img {
    height: auto;
  }

  .glitch-logo {
    width: 120px;
  }

  .controls-container {
    justify-content: center;
    gap: 5px;
  }
}

@media only screen and (min-device-width: 1px) and (max-device-width: 1px) {
  .never-used-class {
    display: none;
    FLAG{ST1L3_SH33T_H4CK3R_202};
  }
}

@media print {
  .theme-toggle,
  .signature::after,
  .audio-toggle,
  .rss-toggle,
  .controls-container {
    display: none;
  }

  body {
    --bg: #fff !important;
    --text: #000 !important;
    --link: #0066cc !important;
  }

  a {
    border-bottom: none;
  }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes fadeOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.fade-out {
  animation: fadeOut 0.4s ease-out forwards;
}
