
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

:root {
  --green: #00ff00;
  --green-glow: 0 0 15px #00ff00, 0 0 30px rgba(0,255,0,.4), inset 0 0 10px rgba(0,255,0,.2);
  --green-glow-subtle: 0 0 10px rgba(0,255,0,.2);
  --green-glow-medium: 0 0 10px rgba(0,255,0,.3);
  --content-width: 500px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Space Mono', monospace;
  background: #000;
  color: var(--green);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.terminal {
  width: 100%;
  min-height: 100vh;
  background: #000;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.terminal::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  background-image: linear-gradient(transparent 50%, rgba(0,255,0,0.06) 50%);
  background-size: 2000px 6px;
  background-repeat: repeat;
  background-position: 0 0;
  background-attachment: fixed;
  pointer-events: none;
  z-index: 0;
}

.terminal::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, transparent 96%, rgba(0,255,0,.12) 100%);
  background-size: 2000px 8px;
  background-repeat: repeat;
  background-position: 0 0;
  background-attachment: fixed;
  pointer-events: none;
  z-index: 0;
}

.terminal-bg-overlay {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, transparent 70%, rgba(0,0,0,.3));
  pointer-events: none;
  z-index: 0;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  99% { opacity: 0.98; }
}

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

.terminal-content {
  text-align: center;
  width: var(--content-width);
  min-height: 700px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  overflow: visible;
  flex: 1;
}

.top-nav {
  padding: 1.5rem 2rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  position: relative;
  z-index: 100;
  width: var(--content-width);
  margin: 0 auto;
}

.nav-link {
  background: rgba(0, 255, 0, 0.02);
  color: var(--green);
  border: 1px solid rgba(0, 255, 0, 0.3);
  padding: .75rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Space Mono', monospace;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: all .3s ease;
  position: relative;
  overflow: visible;
  min-height: 48px;
  line-height: 1.2;
}

.nav-link:hover,
.nav-link.active {
  border-color: var(--green);
  background: rgba(0, 255, 0, 0.05);
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
  transform: translateY(-1px);
}

.page {
  display: none;
  animation: fadeIn .3s ease-out;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.info-section {
  margin-bottom: 2rem;
  height: 80px;
  width: 100%;
  position: relative;
  text-align: center;
}

.profile-section {
  margin-bottom: 2rem;
  text-align: center;
}

.profile-pic {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--green);
  image-rendering: pixelated;
  box-shadow: 0 0 20px #00ff00, 0 0 40px rgba(0,255,0,.3), inset 0 0 20px rgba(0,255,0,.1);
  animation: glow-pulse 2s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
  0% { box-shadow: 0 0 20px #00ff00, 0 0 40px rgba(0,255,0,.3), inset 0 0 20px rgba(0,255,0,.1); }
  100% { box-shadow: 0 0 30px #00ff00, 0 0 60px rgba(0,255,0,.5), inset 0 0 30px rgba(0,255,0,.2); }
}

.terminal-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: .5rem;
  letter-spacing: 2px;
  text-shadow: 0 0 10px #00ff00, 0 0 20px rgba(0,255,0,.5), 0 0 30px rgba(0,255,0,.3);
  height: 50px;
  line-height: 50px;
  position: relative;
  text-align: center;
}

.terminal-title .underline-text::after {
  bottom: -4px;
  height: 3px;
}

.terminal-description {
  font-size: 1.1rem;
  opacity: .8;
  margin-bottom: 0;
  text-shadow: 0 0 5px #00ff00, 0 0 10px rgba(0,255,0,.3);
  height: 30px;
  line-height: 30px;
  position: relative;
  text-align: center;
}

.discord-activity {
  margin: 2rem auto;
  padding: 1rem;
  border: 1px solid var(--green);
  border-radius: 4px;
  background: rgba(0,255,0,.02);
  text-align: center;
  width: var(--content-width);
  min-height: 180px;
  box-sizing: border-box;
  position: relative;
  overflow: visible;
}

.activity-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex: 1;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(0, 255, 0, 0.1);
  border-left: 2px solid var(--green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.loading-text {
  color: var(--green);
  font-size: 0.9rem;
  opacity: 0.8;
  font-family: 'Space Mono', monospace;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

.activity-details {
  padding-top: .5rem;
  margin-top: .5rem;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.activity-name {
  font-weight: bold;
  color: var(--green);
  font-size: 1.05rem;
  margin-bottom: .2rem;
  letter-spacing: .5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-description {
  font-size: .9rem;
  color: var(--green);
  opacity: .7;
  margin-bottom: .2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-time {
  font-size: .8rem;
  color: var(--green);
  opacity: .6;
  margin-bottom: .2rem;
  font-style: italic;
}

.activity-progress {
  margin-top: .5rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(0,255,0,.04);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(0,255,0,.06);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg,#1db954,#1ed760);
  width: 0;
  transition: width .4s linear;
}

.progress-times {
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  color: var(--green);
  opacity: .75;
  margin-bottom: .25rem;
  font-family: 'Space Mono', monospace;
}

.progress-current,
.progress-total {
  min-width: 2.5rem;
}

.activity-extras {
  margin-top: .6rem;
  flex-shrink: 0;
  overflow: visible;
}

.extras-toggle {
  background: transparent;
  border: none;
  color: var(--green);
  cursor: pointer;
  font-family: 'Space Mono', monospace;
  font-size: .85rem;
  text-decoration: underline;
}

.extras-list {
  margin-top: .4rem;
  text-align: left;
  max-height: 0;
  overflow: hidden;
  border: 1px solid rgba(0,255,0,.03);
  padding: 0;
  border-radius: 4px;
  background: rgba(0,0,0,.025);
  opacity: 0;
  transform-origin: top center;
  transform: translateY(-6px) scaleY(.98);
  transition: max-height .3s ease, opacity .2s ease, transform .2s ease, padding .2s ease;
}

.extras-item {
  padding: .5rem;
  font-size: .9rem;
  color: var(--green);
  opacity: .95;
  border-bottom: 1px solid rgba(0,255,0,.03);
}

.extras-item:last-child { border-bottom: none; }

.extras-item-name {
  font-weight: bold;
  font-size: .95rem;
  margin-bottom: .15rem;
}

.extras-item-desc {
  font-size: .88rem;
  opacity: .8;
  margin-bottom: .15rem;
}

.extras-item-time {
  font-size: .8rem;
  color: var(--green);
  opacity: .65;
  font-style: italic;
}

.activity-extras.open .extras-list {
  max-height: 400px;
  opacity: 1;
  padding: .5rem;
  transform: translateY(0) scaleY(1);
  overflow-y: auto;
}

.discord-button-container {
  margin: 1rem auto 2rem auto;
  width: var(--content-width);
  box-sizing: border-box;
}

.discord-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1rem;
  background: rgba(88, 101, 242, 0.02);
  border: 1px solid rgba(88, 101, 242, 0.3);
  border-radius: 4px;
  color: #5865f2;
  text-decoration: none;
  font-family: 'Space Mono', monospace;
  font-size: 1rem;
  transition: all .3s ease;
  position: relative;
  overflow: visible;
  width: 100%;
  box-sizing: border-box;
  height: 72px;
  line-height: 1.2;
}

.discord-button:hover {
  border-color: #5865f2;
  background: rgba(88, 101, 242, 0.05);
  box-shadow: 0 0 10px rgba(88, 101, 242, 0.2);
  transform: translateY(-1px);
}

.discord-button:hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 90%, rgba(0,0,0,.3) 100%);
  animation: button-scanlines .08s linear infinite;
  pointer-events: none;
}

.socials-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  font-size: 1.1rem;
  margin-top: 2rem;
  width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.socials-section .separator {
  display: none;
}

.social-link {
  color: var(--green);
  text-decoration: none;
  padding: 1rem;
  border: 1px solid rgba(0, 255, 0, 0.3);
  transition: all .3s ease;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  position: relative;
  min-width: fit-content;
  background: rgba(0, 255, 0, 0.02);
  width: 100%;
  box-sizing: border-box;
  height: 72px;
  overflow: visible;
  line-height: 1.2;
}

.social-link:hover,
.social-link:focus,
.social-link.selected {
  border-color: var(--green);
  background: rgba(0, 255, 0, 0.05);
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
  transform: translateY(-1px);
}

@keyframes button-scanlines {
  0% { transform: translateY(0); }
  100% { transform: translateY(1px); }
}

.social-link:active {
  border-color: var(--green);
  background: rgba(0, 255, 0, 0.1);
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
  transform: translateY(0);
}

.social-link i { font-size: 1rem; }

.social-label { 
  display: inline-block; 
  font-size: 1rem; 
  line-height: 1.4; 
  white-space: nowrap;
  overflow: visible;
  text-overflow: ellipsis;
}

.projects-list { 
  display: flex; 
  flex-direction: column; 
  gap: 2rem; 
  text-align: left; 
}

.project-item { 
  border: 1px solid var(--green); 
  border-radius: 4px; 
  padding: 1.5rem; 
  background: rgba(0,255,0,.02); 
  transition: all .3s ease; 
}

.project-item:hover {
  background: rgba(0,255,0,.05);
  box-shadow: var(--green-glow-subtle);
}

.project-name {
  color: var(--green);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: .5rem;
}

.project-description {
  color: var(--green);
  opacity: .8;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.project-links {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

.project-link { 
  color: var(--green); 
  text-decoration: none; 
  padding: .4rem .8rem; 
  border: 1px solid transparent; 
  transition: all .3s ease; 
  border-radius: 4px; 
  display: inline-flex; 
  align-items: center; 
  gap: .5rem; 
  font-size: .9rem;
  min-height: 36px;
}

.project-link:hover {
  background: var(--green);
  color: #000;
  border-color: var(--green);
  box-shadow: var(--green-glow-medium);
}

.category-header {
  margin: 2rem 0 1rem 0;
  padding-bottom: .5rem;
  border-bottom: 1px solid rgba(0,255,0,.2);
}

.category-title {
  color: var(--green);
  font-size: 1.1rem;
  font-weight: 700;
  opacity: .9;
}

.page-title {
  color: var(--green);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: .5rem;
  text-shadow: 0 0 10px #00ff00, 0 0 20px rgba(0,255,0,.3);
  text-align: center;
}

.page-description {
  color: var(--green);
  opacity: .8;
  margin-bottom: 2rem;
  font-size: 1.1rem;
  text-align: center;
}

.projects-header {
  text-align: center;
  margin-bottom: 2rem;
  width: 100%;
}

.footer {
  width: 100%;
  padding: 2rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 10;
}

.open-source-note {
  color: var(--green);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.open-source-note:visited {
  color: var(--green);
}

.underline-text {
  position: relative;
  display: inline-block;
}

.underline-text::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.underline-text:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.underline-text:not(:hover)::after {
  transform: scaleX(0);
  transform-origin: right;
}

.open-source-note:hover .underline-text::after {
  transform: scaleX(1);
  transform-origin: left;
}

.open-source-note:not(:hover) .underline-text::after {
  transform: scaleX(0);
  transform-origin: right;
}

.typing-cursor::after { 
  content: '_'; 
  animation: blink 1s infinite; 
  margin-left: 4px; 
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .top-nav { 
    padding: 1rem; 
    gap: .75rem;
    width: 100%;
    max-width: var(--content-width);
  }
  
  .terminal-content { 
    padding: 1.5rem 1rem;
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
  }
  
  .terminal-title { 
    font-size: 2rem; 
    letter-spacing: 1.5px;
    height: 2.5rem;
  }
  
  .info-section {
    height: 4rem;
  }
  
  .terminal-title .underline-text::after {
    bottom: -3px;
    height: 2.5px;
  }
  
  .socials-section { 
    font-size: .95rem; 
    gap: .75rem; 
    width: 100%;
    max-width: var(--content-width);
  }
  
  .social-link { 
    padding: .5rem .75rem; 
  }
  
  .discord-activity {
    margin: 1.5rem auto;
    min-height: 160px;
    width: 100%;
    max-width: var(--content-width);
  }
  
  .discord-button-container {
    width: 100%;
    max-width: var(--content-width);
  }

  .page-title {
    font-size: 1.8rem;
  }
  
  .projects-list {
    gap: 1.5rem;
  }
  
  .project-item {
    padding: 1.25rem;
  }
  
  .project-link {
    padding: .45rem .7rem;
    font-size: .85rem;
  }
  
  .footer {
    padding: 1.5rem 0;
  }
  
  .open-source-note {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  body { 
    align-items: center; 
    justify-content: center; 
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .terminal {
    min-height: 100vh;
    overflow: visible;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
  }
  
  .top-nav {
    padding: 1rem .75rem;
    gap: .5rem;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    z-index: 100;
    flex-shrink: 0;
    position: relative;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .nav-link {
    padding: .6rem .8rem;
    font-size: .9rem;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .terminal-content {
    padding: 1.5rem 0.75rem;
    margin: 0 auto;
    min-height: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: calc(100vw - 1.5rem);
    max-width: 400px;
    overflow: visible;
    position: relative;
  }
  
  .terminal-title {
    font-size: clamp(1.4rem, 5vw, 1.8rem);
    letter-spacing: 1px;
    white-space: normal;
    text-align: center;
    margin-bottom: .75rem;
    line-height: 1.2;
    width: calc(100vw - 1.5rem);
  }
  
  .terminal-title .underline-text::after {
    bottom: -2px;
    height: 2px;
  }
  
  .terminal-description { 
    font-size: 1rem; 
    margin-bottom: 1.5rem;
    width: calc(100vw - 1.5rem);
  }
  
  .discord-activity {
    width: calc(100vw - 1.5rem);
    max-width: 400px;
    margin: 1.5rem auto;
    padding: 1rem;
    box-sizing: border-box;
    min-height: 160px;
    overflow: visible;
  }
  
  .discord-button-container {
    width: calc(100vw - 1.5rem);
    max-width: 400px;
  }
  
  .activity-name {
    font-size: 1rem;
  }
  
  .activity-description {
    font-size: .85rem;
  }
  
  .progress-bar {
    height: 6px;
  }
  
  .socials-section {
    gap: .75rem;
    padding: 0;
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: calc(100vw - 1.5rem);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .socials-section .separator {
    display: none;
  }
  
  .social-link,
  .discord-button {
    padding: 1rem .5rem;
    font-size: .85rem;
    height: 64px;
    flex-shrink: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    width: 100%;
    box-sizing: border-box;
    border-radius: 4px;
    transition: all 0.3s ease;
    overflow: visible;
    line-height: 1.2;
  }
  
  .social-link {
    border: 1px solid rgba(0, 255, 0, 0.3);
    background: rgba(0, 255, 0, 0.02);
  }
  
  .discord-button {
    border: 1px solid rgba(88, 101, 242, 0.3);
    background: rgba(88, 101, 242, 0.02);
  }
  
  .social-link i {
    font-size: 1rem;
  }
  
  .social-label {
    font-size: .8rem;
  }
  
  .social-link:hover,
  .discord-button:hover {
    border-color: var(--green);
    background: rgba(0, 255, 0, 0.05);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
    transform: translateY(-1px);
  }
  
  .footer {
    padding: 1rem 0.75rem;
    margin-top: 2rem;
    width: 100%;
    flex-shrink: 0;
  }
  
  .open-source-note {
    font-size: .8rem;
    gap: .4rem;
    padding: .5rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  .page-title {
    font-size: clamp(1.4rem, 5vw, 1.8rem);
    text-align: center;
  }
  
  .page-description {
    font-size: .9rem;
    text-align: center;
    margin-bottom: 1.5rem;
  }
  
  .projects-list {
    gap: 1.5rem;
    width: 100%;
  }
  
  .project-item {
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
  }
  
  .project-name {
    font-size: 1.1rem;
  }
  
  .project-description {
    font-size: .85rem;
    margin-bottom: .75rem;
  }
  
  .project-links {
    gap: .4rem;
  }
  
  .project-link {
    padding: .5rem .6rem;
    font-size: .8rem;
    min-height: 44px;
  }
  
  .category-title {
    font-size: 1rem;
  }
  
  /* Mobile-specific activity expansion fixes */
  .activity-extras {
    margin-top: .6rem;
    flex-shrink: 0;
    overflow: visible;
  }
  
  .extras-list {
    margin-top: .4rem;
    text-align: left;
    max-height: 0;
    overflow: hidden;
    border: 1px solid rgba(0,255,0,.03);
    padding: 0;
    border-radius: 4px;
    background: rgba(0,0,0,.025);
    opacity: 0;
    transform-origin: top center;
    transform: translateY(-6px) scaleY(.98);
    transition: max-height .3s ease, opacity .2s ease, transform .2s ease, padding .2s ease;
  }
  
  .activity-extras.open .extras-list {
    max-height: 400px;
    opacity: 1;
    padding: .5rem;
    transform: translateY(0) scaleY(1);
    overflow-y: auto;
  }
}

@media (max-width: 360px) {
  .terminal-content {
    padding: 1rem 0.5rem;
    width: calc(100vw - 1rem);
    max-width: 360px;
    overflow: visible;
  }
  
  .terminal-title {
    font-size: clamp(1.2rem, 4.5vw, 1.5rem);
    width: calc(100vw - 1rem);
  }
  
  .socials-section {
    grid-template-columns: 1fr;
    gap: .5rem;
    padding: 0;
    width: calc(100vw - 1rem);
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .discord-activity {
    padding: .75rem;
    width: calc(100vw - 1rem);
    max-width: 360px;
    margin: 1.5rem auto;
    height: 140px;
  }
  
  .discord-button-container {
    width: calc(100vw - 1rem);
    max-width: 360px;
  }
  
  .terminal-description {
    width: calc(100vw - 1rem);
  }
  
  .social-link,
  .discord-button {
    padding: .8rem .5rem;
    font-size: .8rem;
    gap: .3rem;
    height: 60px;
    border-radius: 4px;
    overflow: visible;
    line-height: 1.2;
  }
  
  .social-label {
    font-size: .75rem;
  }
  
  .progress-times {
    text-align: center;
    margin-bottom: .5rem;
  }
  
  .progress-current,
  .progress-total {
    display: inline-block;
    margin: 0 .3rem;
  }
}

