/* === Hacker Typewriter Banner – Responsive Terminal Style === */
.hacker-typewriter-container {
  width: 100%;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  border: 1px solid #00ff00;
  border-radius: 8px;
}

.hacker-typewriter-bg {
  display: inline-block;
  color: #00ff00;
  font-family: 'Press Start 2P', monospace;
  font-size: 1.8rem;
  padding: 0.5em;
  line-height: 1.33;
  min-height: 2.65rem;
  position: relative;
  overflow: hidden;
}

.terminal-prompt {
  font-family: 'Press Start 2P', monospace;
  color: #00ff00;
  font-size: 2rem;
  font-weight: bold;
  margin-right: 1rem;
  letter-spacing: -0.05em;
  text-shadow: 0 0 5px #00ff00;
  display: inline-block;
}

.hacker-typewriter-text {
  font-family: 'Press Start 2P', monospace;
  color: #00ff00;
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  line-height: 1.5;
  text-shadow: 0 0 5px #00ff0080;
  display: inline-block;
  position: relative;
  z-index: 2;
}

.avatar-container {
  width: 150px;
  height: 150px;
  border: 2px solid #00ff00;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.typewriter-text {
  font-family: 'Space Mono', monospace;
  font-size: 1.4rem;
  line-height: 1.6;
  color: #b3ffb3;
  margin: 0;
}

/* Terminal scan lines effect */
.hacker-typewriter-bg::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(32, 128, 32, 0.2) 50%,
    transparent 100%
  );
  background-size: 100% 3px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.3;
  animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
  0% { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

/* Cursor blink animation */
@keyframes cursor-blink {
  0%, 45% { opacity: 1; }
  50%, 85% { opacity: 0; }
  90%, 100% { opacity: 1; }
}

.cursor {
  display: inline-block;
  width: 0.8em;
  height: 1.2em;
  background: #00ff00;
  margin-left: 2px;
  animation: cursor-blink 1.2s infinite;
  vertical-align: middle;
}

/* Cards Grid Layout */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  width: 100%;
}

/* Smaller, More Elegant Cards */
.card {
  height: 200px;
  background: repeating-linear-gradient(
    to bottom,
    #111 0px, #111 2px, #222 2px, #222 4px
  ),
  repeating-linear-gradient(
    to right,
    #111 0px, #111 2px, #222 2px, #222 4px
  );
  backdrop-filter: blur(5px);
  border: 2px solid #00ff00;
  position: relative;
  transition: box-shadow 0.2s, border 0.2s, filter 0.2s;
  box-shadow: 0 0 0 2px #00ff00, 0 0 0 4px #000, 0 0 0 8px #00ff00;
  overflow: visible;
}

.card:hover {
  box-shadow: 0 0 0 4px #fff, 0 0 0 8px #00ff00, 0 0 24px 0 #00ff00;
  border: 4px solid #fff;
  filter: brightness(1.2) contrast(1.2);
}

.card::after {
  content: "";
  display: block;
  pointer-events: none;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  opacity: 0;
  z-index: 3;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,255,0,0.08) 0px,
    rgba(0,255,0,0.08) 2px,
    transparent 2px,
    transparent 4px
  );
  transition: opacity 0.15s;
}

.card:hover::after {
  opacity: 1;
  animation: card-scanline-flash 0.22s linear 1;
}

@keyframes card-scanline-flash {
  0% { opacity: 0.2; }
  50% { opacity: 0.7; }
  100% { opacity: 0.2; }
}

.card-inner {
  height: 100%;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.card-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 1rem;
  color: #00ff00;
}

.card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.card p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .hacker-typewriter-container {
    padding: 1rem;
  }
  
  .content-overlay {
    padding: 1rem;
  }
}

/* Terminal static/noise effect */
.hacker-typewriter-bg::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 255, 0, 0.1),
    rgba(0, 255, 0, 0.05)
  );
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  animation: static-noise 0.5s steps(1) infinite;
}

@keyframes static-noise {
  0% { opacity: 0.05; filter: brightness(1); }
  10% { opacity: 0.08; filter: brightness(1.1); }
  20% { opacity: 0.05; filter: brightness(1); }
  30% { opacity: 0.1; filter: brightness(1.1); }
  40% { opacity: 0.08; filter: brightness(1); }
  50% { opacity: 0.05; filter: brightness(1.1); }
  60% { opacity: 0.1; filter: brightness(1); }
  70% { opacity: 0.05; filter: brightness(1.1); }
  80% { opacity: 0.08; filter: brightness(1); }
  90% { opacity: 0.1; filter: brightness(1.1); }
  100% { opacity: 0.05; filter: brightness(1); }
}

.huge-prompt {
  font-size: 2.8rem;
  display:inline-block;
  line-height: 1.25;
}

.type-bar-bg {
  display: inline-block;
  background: #000;
  color: #00ff00;
  border-radius: 0.28rem 2rem 2rem 0;
  font-family: 'Press Start 2P', monospace;
  font-size: 2.1rem;
  padding: 0.02em 0.22em 0.02em 0.27em;
  margin-left: 0.08em;
  box-shadow: 0 2px 24px rgba(0,255,0,0.07);
  line-height: 1.3;
  min-height: 2.6rem;
  min-width: 1.24rem;
  transition: width 0.1s, min-width 0.1s;
  vertical-align: text-bottom;
}

.type-bar-text {
  letter-spacing: 0.02em;
  font-family: inherit;
  font-size: inherit;
}

.cursor-blink {
  display: inline-block;
  animation: cursor-blink 0.62s steps(1, end) infinite;
  color: #00ff00;
  margin-left: 0.13em;
  font-weight: bold;
  background: #007700;
  padding: 0 .11em;
  border-radius: 2px;
  font-size: 1.05em;
  box-shadow: 0 0 2px #00ff0080;
}

/* Occasional random flicker effect */
@keyframes text-flicker {
  0%, 100% { opacity: 1; text-shadow: 0 0 2px #00ff00, 0 0 5px #00ff0080; }
  92%, 94% { opacity: 0.85; text-shadow: 0 0 3px #00ff00, 0 0 7px #00ff00; }
  96% { opacity: 0.92; text-shadow: 0 0 5px #00ff00, 0 0 10px #00ff00; }
}

/* Blinking cursor style */
@keyframes cursor-blink {
  0%, 45% { opacity: 1; filter: brightness(1); }
  50%, 85% { opacity: 0; }
  90%, 91% { opacity: 0.8; filter: brightness(1.2); }
  92%, 100% { opacity: 1; filter: brightness(1); }
}

.cursor-blink {
  display: inline-block;
  animation: cursor-blink 0.95s infinite;
  color: #00ff00;
  font-weight: bold;
  margin-left: 0.1em;
  text-shadow: 0 0 5px #00ff00, 0 0 10px #00ff0070;
  position: relative;
  z-index: 2;
  /* Block cursor style */
  background-color: #00ff00;
  color: #000;
  padding: 0 0.15em;
}

/* CRT power-on glow effect */
@keyframes crt-on {
  0% { opacity: 0; filter: brightness(2) blur(3px); }
  3% { opacity: 0; filter: brightness(0) blur(5px); }
  5% { opacity: 0.3; filter: brightness(4) blur(3px); }
  8% { opacity: 0.1; filter: brightness(1) blur(4px); }
  10% { opacity: 0.6; filter: brightness(1.1); }
}

/* Match visually to .projects-container h2 for spacing */
.hacker-typewriter-container,
.hacker-typewriter-bg {
  min-height: 5.2rem;
}

@media (max-width: 600px) {
  .hacker-typewriter-bg {
    padding: 0.8rem 1.2rem 0.8rem 1rem;
    border-radius: 0.4rem;
    max-width: 99vw;
  }
  .hacker-typewriter-text {
    font-size: 1.3rem;
  }
  .terminal-prompt {
    font-size: 1.45rem;
    margin-right: 0.7rem;
  }
  .cursor-blink {
    font-size: 1.3rem;
  }
}

.container {
}

h1, h2, h3, h4 {
  font-family: 'Urbanist', var(--bs-font-sans-serif);
}

#contents .row.g-4 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

@media (max-width: 991px) {
  #contents .row.g-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  #contents .row.g-4 {
    grid-template-columns: 1fr;
  }
}

.content-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 0.75rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  padding: 2rem 1.5rem;
  margin: 0 auto;
  transition: transform 0.2s, box-shadow 0.2s;
}

.content-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 8px 24px rgba(0,0,0,0.13);
}

.ascii-announcement-flex {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start !important;
  justify-content: center;
  gap: 2.5rem;
  width: 100%;
  max-width: none !important;
  margin-left: auto;
  margin-right: auto;
  margin-top: 1.2rem;
  margin-bottom: 2.5rem;
}

.ascii-art-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.ascii-art-container pre {
  overflow: hidden !important;
  margin: 0;
  padding: 0;
  background: none;
  box-shadow: none;
  border: none;
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE 10+ */
}
.ascii-art-container pre::-webkit-scrollbar {
  display: none !important;
}

.announcement-box {
  border: 3px solid #000;
  background: #fffbe6;
  color: #222;
  border-radius: 1rem;
  padding: 4rem 5rem;
  min-width: 440px;
  max-width: 680px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  font-size: 2.2rem;
  flex: 1 1 440px;
}

/* Accordion Mac/modal style */
.custom-accordion {
  border: 4px solid #000;
  background: #b6ff7c;
  border-radius: 0;
  box-shadow: 0 4px 0 #c4c4c4, 0 0 0 8px #fff;
  margin: 32px auto;
  max-width: 600px;
}
.custom-accordion-item {
  border-bottom: 2px solid #000;
}
.custom-accordion-item:last-child {
  border-bottom: none;
}
.custom-accordion-header-bar {
  display: flex;
  align-items: center;
  background: #fffbe6;
  border-bottom: 2px solid #000;
  padding: 0 16px;
  height: 48px;
  position: relative;
}
.custom-accordion-title {
  font-family: 'Chicago', 'Geneva', 'Arial', sans-serif;
  font-size: 1.1rem;
  color: #222;
  margin-left: 12px;
  letter-spacing: 0.5px;
}
.custom-accordion-toggle {
  background: #c4c4c4;
  border: 2px solid #000;
  border-radius: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.4s cubic-bezier(.68,-0.55,.27,1.55);
  position: relative;
  outline: none;
}
.custom-accordion-toggle[aria-expanded="true"] {
  background: #ffb6b6;
  border-color: #d00;
  /* hint of red for error prompt */
}
.custom-accordion-toggle:active {
  transform: rotate(360deg);
}
.toggle-icon {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  color: #000;
  transition: transform 0.4s cubic-bezier(.68,-0.55,.27,1.55);
}
.custom-accordion-toggle[aria-expanded="true"] .toggle-icon {
  transform: rotate(0deg);
  content: '×';
}
.custom-accordion-toggle[aria-expanded="false"] .toggle-icon {
  transform: rotate(0deg);
  content: '+';
}
.custom-accordion-body {
  background: #b6ff7c;
  padding: 24px 24px 24px 48px;
  border-top: none;
  font-family: 'Geneva', 'Arial', sans-serif;
  font-size: 1rem;
  color: #222;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.55s cubic-bezier(.77,0,.18,1), opacity 0.35s cubic-bezier(.77,0,.18,1);
  display: block;
}
.custom-accordion-item.open .custom-accordion-body {
  max-height: 400px;
  opacity: 1;
  transition: max-height 0.7s cubic-bezier(.77,0,.18,1), opacity 0.45s cubic-bezier(.77,0,.18,1);
}

/* Elegant spinner animation for toggle button */
.custom-accordion-toggle.spinning {
  animation: none !important;
}

/* Remove old spinner styles */
.spinner { display: none !important; }

@media (max-width: 900px) {
  .ascii-announcement-flex {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  .ascii-art-container, .custom-accordion {
    max-width: 100vw;
    width: 100%;
    flex-basis: 100%;
  }
  .custom-accordion {
    max-width: 100vw;
    width: 100%;
    flex-basis: 100%;
  }
}

@media (max-width: 600px) {
  .ascii-art-flipped {
    font-size: 1rem;
    line-height: 1;
  }
  .announcement-box {
    font-size: 1rem;
    min-width: 0;
    max-width: 100vw;
  }
}

.ascii-art-flipped {
  font-family: 'Fira Mono', 'Space Mono', 'Consolas', monospace;
  font-size: 1.4rem;
  line-height: 1;
  text-align: left;
  background: none;
  border: none;
  margin: 0;
  padding: 0;
  user-select: none;
  letter-spacing: 0;
  white-space: pre;
  word-break: normal;
}

.ascii-yellow { color: #bfa100; }
.ascii-black { color: #222; }
.ascii-white { color: #fff; text-shadow: 0 0 2px #bbb; }
.ascii-grey { color: #bbb; }

iframe {
  width: 100%;
  border: none;
  overflow: hidden !important;
  display: block;
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE and Edge */
  position: relative;
  mask-image: linear-gradient(to left, transparent 0, black 20px, black calc(100% - 20px), transparent 100%);
  -webkit-mask-image: linear-gradient(to left, transparent 0, black 20px, black calc(100% - 20px), transparent 100%);
}
iframe::-webkit-scrollbar {
  display: none !important;
}
iframe::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; width: 20px;
  background: #fff;
  pointer-events: none;
  z-index: 10;
}

@media (max-width: 991px) {
  .ascii-announcement-flex {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  .ascii-art-container, .custom-accordion {
    max-width: 100vw;
    min-width: 0;
    width: 100%;
    font-size: 1.1rem;
  }
  .custom-accordion {
    font-size: 1.1rem;
    max-width: 420px;
    width: 100%;
  }
}

@media (max-width: 600px) {
  .ascii-art-flipped {
    font-size: 1rem;
    line-height: 1;
  }
  .custom-accordion {
    font-size: 1rem;
    min-width: 0;
    max-width: 100vw;
    width: 100%;
  }
}

.ascii-art-svg-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.ascii-art-svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
}

.content-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.terminal-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin-bottom: 3rem;
}

.glitch {
  animation: glitch-flicker 2.2s infinite steps(2, end);
  filter: contrast(1.08) brightness(1.08) drop-shadow(0 0 8px #b6ff7c);
  position: relative;
  will-change: filter, opacity;
}

@keyframes glitch-flicker {
  0%, 100% { opacity: 1; filter: none; }
  8% { opacity: 0.93; filter: hue-rotate(8deg) brightness(1.1) saturate(1.1); }
  12% { opacity: 0.98; filter: hue-rotate(-8deg) brightness(1.05) saturate(1.2); }
  20% { opacity: 0.96; filter: brightness(1.12) saturate(1.1); }
  30% { opacity: 1; filter: none; }
  40% { opacity: 0.92; filter: brightness(1.15) hue-rotate(12deg); }
  50% { opacity: 1; filter: none; }
  60% { opacity: 0.97; filter: hue-rotate(-12deg) brightness(1.08); }
  70% { opacity: 0.95; filter: brightness(1.13) saturate(1.15); }
  80% { opacity: 1; filter: none; }
  90% { opacity: 0.94; filter: hue-rotate(6deg) brightness(1.1); }
}

.ascii-accordion-container {
  flex: 1 1 440px;
  min-width: 340px;
  max-width: 680px;
  display: flex;
  flex-direction: column;
}

.space-invader-sprite {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%) scale(1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 4;
}
.card:hover .space-invader-sprite {
  opacity: 1;
  transform: translateX(-50%) scale(1.18);
  animation: invader-bounce 0.32s cubic-bezier(.68,-0.55,.27,1.55) 1;
}
@keyframes invader-bounce {
  0% { transform: translateX(-50%) scale(0.7); }
  60% { transform: translateX(-50%) scale(1.25); }
  80% { transform: translateX(-50%) scale(0.95); }
  100% { transform: translateX(-50%) scale(1.18); }
}

.space-invader-sprite svg {
  transition: filter 0.1s, opacity 0.2s;
}
.card:hover .space-invader-sprite svg {
  filter: drop-shadow(0 0 8px #fff) brightness(2) contrast(2);
  animation: invader-shot 0.5s cubic-bezier(.68,-0.55,.27,1.55) 1;
  opacity: 0.2;
}
@keyframes invader-shot {
  0% { opacity: 1; filter: none; }
  30% { opacity: 1; filter: drop-shadow(0 0 16px #fff) brightness(2.5); }
  60% { opacity: 0.7; filter: drop-shadow(0 0 32px #fff) brightness(3); }
  100% { opacity: 0.2; filter: none; }
}