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

:root {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --accent: #00ff41;
  --border: #1a1a1a;
  --accent-blue: #00d4ff;
}

body, html {
  cursor: alias;
}

a, button, .nav-logo, .hacker-text {
  cursor: alias !important; 
}

body {
  font-family: "JetBrains Mono", monospace;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

/* --- BACKGROUND GRID --- */
.grid-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.3;
  z-index: -1;
  pointer-events: none;
}

/* --- CONTAINER & LAYOUT --- */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 3rem 0;
}

.section-title {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
  cursor: default;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 50%;
  height: 2px;
  background: var(--accent);
}

/* --- NAVIGATION --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--accent);
  box-shadow: 0 4px 20px rgba(0, 255, 65, 0.15);
  z-index: 1000;
  height: 60px;
  display: flex;
  align-items: center;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.nav-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  position: relative;
  cursor: pointer;
  white-space: nowrap; 
}

/* NAV GLITCH EFFECT */
.nav-glitch {
  animation: glitch 5s infinite;
}

.nav-glitch::before, .nav-glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9); 
}

.nav-glitch::before {
  left: 2px;
  text-shadow: -1px 0 #ff00c1;
  clip-path: inset(0 0 0 0);
  animation: glitch-1 4s infinite linear alternate-reverse;
}

.nav-glitch::after {
  left: -2px;
  text-shadow: -1px 0 #00fff9;
  clip-path: inset(0 0 0 0);
  animation: glitch-2 4s infinite linear alternate-reverse;
}

.hacker-text {
  font-family: "JetBrains Mono", monospace;
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a:hover {
  color: var(--accent);
}

/* Highlights the current page or active scroll section */
.nav-links a.active {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.4); /* Optional: adds a subtle hacker glow */
}

.back-btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: rgba(0, 255, 65, 0.05); /* Slight green background fill */
  color: var(--accent);
  text-decoration: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4); /* Physical drop shadow */
}

.back-btn:hover {
  background: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.4);
  transform: translateY(-2px); /* Makes it 'pop' up slightly on hover */
}


/* --- HERO SECTION --- */
.hero {
  min-height: 100vh; 
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 2rem;
}

#home {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#webgl-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* --- BOOT SEQUENCE  --- */
/* Force loading state to prevent scrolling behind the overlay */
body.loading {
  overflow: hidden; 
  height: 100vh;
}

/* CRITICAL: Hides everything EXCEPT the Hero section */
body.loading .nav,
body.loading .scroll-indicator,
body.loading section:not(.hero),
body.loading .footer {
  display: none !important;
}

/* --- THE TERMINAL OVERLAY BASE --- */
.terminal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000000;
  z-index: 99999;
}

/* --- THE GLASS TERMINAL WINDOW --- */
.terminal-window {
  position: relative;
  z-index: 2; /* Sits directly above the binary rain */
  display: flex;
  flex-direction: column;
  width: fit-content; 
  min-width: 300px;
  max-width: 90vw;
  height: auto !important;
  max-height: 80vh;
  overflow: hidden;
  
  /* Make it translucent so the rain falls underneath the text */
  background-color: rgba(5, 5, 5, 0.85) !important; 
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  
  border: 1px solid var(--accent); 
  border-radius: 6px; 
  box-shadow: 0 0 40px rgba(0, 255, 65, 0.15); 
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem; 
  margin: 0;
  text-align: left;
  transform: scale(0);
  opacity: 0;
  transition: width 0.2s ease-out, height 0.2s ease-out; 
}

.terminal-header {
  background-color: #161616;
  padding: 12px 15px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.terminal-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  opacity: 0.8;
}

.red { background-color: #ff5f56; }
.yellow { background-color: #ffbd2e; }
.green { background-color: #27c93f; }

.terminal-body {
  padding: 20px;
  white-space: nowrap; 
  overflow: hidden;
  flex-grow: 1;
}

/* Command Output Colors */
.cmd-user { color: var(--accent); font-weight: bold; }
.cmd-path { color: var(--accent-blue); }
.cmd-input { color: #ffffff; } 
.cmd-error { color: #ff5f56; }

#terminal-content .login-success {
  color: #00ff41 !important; 
  font-size: 1.4rem !important; 
  font-weight: 800 !important;
  text-shadow: 0 0 15px rgba(0, 255, 65, 0.7);
  display: inline-block;
  margin-top: 15px;
  letter-spacing: 1px;
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}

/* BLINKING CURSOR */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cmd-input:last-child::after {
  content: 'â–‹';
  color: var(--accent);
  margin-left: 5px;
  animation: blink 1s infinite;
  vertical-align: middle;
}

/* --- ABOUT SECTION --- */
#about { padding-top: 6rem; }
.about-content { max-width: 900px; }
.about-text {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* GLITCH ANIMATION KEYFRAMES */
@keyframes glitch {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
}

@keyframes glitch-1 {
  0% { clip-path: inset(40% 0 61% 0); transform: translate(0); }
  20% { clip-path: inset(92% 0 1% 0); transform: translate(-2px); }
  40% { clip-path: inset(43% 0 1% 0); transform: translate(2px); }
  60% { clip-path: inset(25% 0 58% 0); transform: translate(-2px); }
  80% { clip-path: inset(54% 0 7% 0); transform: translate(2px); }
  100% { clip-path: inset(58% 0 43% 0); transform: translate(0); }
}

@keyframes glitch-2 {
  0% { clip-path: inset(25% 0 58% 0); transform: translate(0); }
  20% { clip-path: inset(54% 0 7% 0); transform: translate(2px); }
  40% { clip-path: inset(58% 0 43% 0); transform: translate(-2px); }
  60% { clip-path: inset(40% 0 61% 0); transform: translate(2px); }
  80% { clip-path: inset(92% 0 1% 0); transform: translate(-2px); }
  100% { clip-path: inset(43% 0 1% 0); transform: translate(0); }
}

/* --- EDUCATION --- */
#education { background: var(--bg-primary); }
.education-container { padding-left: 0; }
.uni-header { margin-bottom: 1.5rem; }
.uni-name { font-size: 1.3rem; color: var(--text-primary); }
.uni-location { color: var(--text-secondary); font-size: 0.9rem; }
.degree-timeline { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.degree-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 1.5rem;
  position: relative;
  transition: all 0.3s ease;
  height: 100%;
}
.degree-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent), inset 0 0 10px rgba(0, 255, 65, 0.1);
  transform: translateY(-5px);
}
.degree-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5rem; gap: 1rem; flex-wrap: wrap; }
.degree-title { color: var(--accent); font-size: 1.1rem; font-weight: 700; }
.degree-year { color: var(--text-secondary); font-size: 0.85rem; border: 1px solid var(--border); padding: 0.2rem 0.6rem; border-radius: 4px; white-space: nowrap; }
.minor-text { color: var(--accent-blue); font-style: italic; font-size: 0.9rem; }
.degree-meta { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px dashed var(--border); }
.course-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag { font-size: 0.75rem; color: var(--text-secondary); background: rgba(255, 255, 255, 0.05); padding: 0.3rem 0.6rem; border-radius: 2px; }

/* --- EXPERIENCE --- */
#experience { background: var(--bg-primary); }
.experience-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.timeline-content {
  padding: 1.25rem;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.timeline-content:hover {
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent), inset 0 0 10px rgba(0, 255, 65, 0.1);
  transform: translateY(-5px);
}
.timeline-header { display: flex; align-items: flex-start; gap: 1rem; width: 100%; }
.company-logo { width: 50px; height: 50px; object-fit: contain; flex-shrink: 0; margin-top: 5px; }
.timeline-info { flex: 1; }
.timeline-title { color: var(--text-primary); font-size: 1rem; font-weight: 600; margin-bottom: 0.2rem; line-height: 1.3; }
.timeline-company { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0.4rem; }
.timeline-date { color: var(--accent); font-size: 0.8rem; font-weight: 600; display: block; }

/* --- BLOG SECTION --- */
#blog { background: var(--bg-primary); }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.blog-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  height: 100%;
  position: relative;
  overflow: hidden;
}
.blog-card:hover { border-color: var(--accent); transform: translateY(-5px); box-shadow: 0 0 15px var(--accent), inset 0 0 10px rgba(0, 255, 65, 0.1); }
.blog-card:hover::after {
  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;
}
.blog-header { display: flex; justify-content: space-between; margin-bottom: 1rem; font-size: 0.8rem; border-bottom: 1px dashed var(--border); padding-bottom: 0.5rem; }
.blog-date { color: var(--text-secondary); font-family: "JetBrains Mono", monospace; }
.blog-title { color: var(--text-primary); font-size: 1.1rem; margin-bottom: 0.8rem; font-weight: 700; }
.blog-desc { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1.5rem; flex-grow: 1; }
.read-more { color: var(--accent); text-decoration: none; font-size: 0.9rem; font-weight: 600; align-self: flex-start; transition: color 0.3s ease; }
.read-more:hover { text-decoration: underline; text-underline-offset: 4px; }
.read-more.disabled { color: var(--border); cursor: not-allowed; text-decoration: none; }
.blog-footer { text-align: center; margin-top: 2rem; }
.view-all-btn { color: var(--text-secondary); text-decoration: none; font-size: 1rem; border: 1px solid var(--border); padding: 10px 20px; transition: all 0.3s ease; background: var(--bg-secondary); }
.view-all-btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 15px var(--accent), inset 0 0 10px rgba(0, 255, 65, 0.1); }

/* --- CONTACT SECTION --- */
.contact-content { max-width: 600px; }
.contact-links { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }
.contact-link { padding: 0.75rem 1.5rem; border: 1px solid var(--border); color: var(--text-primary); text-decoration: none; transition: all 0.3s ease; }
.contact-link:hover { border-color: var(--accent); color: var(--accent); background: rgba(0, 255, 65, 0.05); box-shadow: 0 0 15px var(--accent), inset 0 0 10px rgba(0, 255, 65, 0.1); }

.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; will-change: opacity, transform; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* Footer */
.footer { padding: 2rem 0; border-top: 1px solid var(--border); text-align: center; color: var(--text-secondary); font-size: 0.8rem; margin-top: 2rem; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .degree-timeline { grid-template-columns: 1fr; }
  .experience-grid { grid-template-columns: 1fr; }
  .timeline-header { flex-direction: row; }
}

/* --- INACTIVITY MALWARE OVERLAY --- */
.malware-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 100000;
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", monospace;
}

.malware-overlay.active {
  display: flex;
  /* Slowly creeps a dark red vignette inward over 8 seconds */
  animation: creepIn 8s forwards;
}

@keyframes creepIn {
  0% { 
    background: radial-gradient(circle at center, transparent 100%, rgba(255, 0, 0, 0.8) 100%); 
    backdrop-filter: blur(0px) contrast(1); 
  }
  100% { 
    background: radial-gradient(circle at center, transparent 0%, rgba(20, 0, 0, 0.95) 100%); 
    backdrop-filter: blur(8px) contrast(1.5); 
  }
}

.malware-corruption {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 10px, rgba(255, 0, 0, 0.05) 10px, rgba(255, 0, 0, 0.05) 20px);
  opacity: 0;
  pointer-events: none;
}

.malware-overlay.active .malware-corruption {
  animation: flashCorruption 2s infinite;
}

@keyframes flashCorruption {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.4; }
}

.malware-modal {
  position: relative;
  background: #050000;
  border: 1px solid #ff003c;
  padding: 3rem;
  color: #ff003c;
  text-align: center;
  box-shadow: 0 0 40px rgba(255, 0, 60, 0.5);
  max-width: 600px;
  z-index: 2;
  opacity: 0;
  transform: scale(0.9);
  /* Pops the modal in AFTER the screen has been corrupting for 3 seconds */
  animation: modalPop 0.5s 3s forwards ease-out; 
}

@keyframes modalPop {
  to { opacity: 1; transform: scale(1); }
}

.malware-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  text-shadow: 2px 0px 10px rgba(255,0,0,0.8);
}

.malware-modal p {
  margin-bottom: 1rem;
  color: #e0e0e0;
}

.countdown-container {
  font-size: 2.5rem;
  font-weight: bold;
  color: #ff003c;
  margin: 2rem 0;
  text-shadow: 0 0 15px rgba(255,0,60,0.8);
}

.malware-btn {
  background: transparent;
  color: #00ff41; /* Hacker green to contrast the red */
  border: 1px solid #00ff41;
  padding: 12px 30px;
  font-family: inherit;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.malware-btn:hover {
  background: #00ff41;
  color: #000;
  box-shadow: 0 0 20px #00ff41;
}

/* --- WORK IN PROGRESS CAUTION TAPE --- */
.caution-tape-container {
  position: absolute;
  top: 50%; 
  left: -15vw;
  width: 130vw; /* Wider to cover the screen diagonally from corner to corner */
  z-index: 10;
  pointer-events: none; 
  filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.6));
}

/* Pivot the first tape down */
.tape-1 {
  transform: translateY(-50%) rotate(-22deg);
}

/* Pivot the second tape up */
.tape-2 {
  transform: translateY(-50%) rotate(22deg);
}

.caution-tape {
  width: 100%;
  height: 50px;
  /* Authentic diagonal yellow and black caution stripes */
  background: repeating-linear-gradient(
    -45deg,
    #ffd700,
    #ffd700 20px,
    #111111 20px,
    #111111 40px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* The solid yellow band in the middle so the text is highly readable */
.caution-text-band {
  width: 100%;
  height: 32px;
  background-color: #ffd700;
  border-top: 2px solid #111;
  border-bottom: 2px solid #111;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* The scrolling text */
.caution-marquee {
  display: inline-block;
  white-space: nowrap;
  font-family: "JetBrains Mono", monospace;
  font-weight: 900;
  font-size: 1.1rem;
  color: #111;
  letter-spacing: 2px;
  /* Scrolls the text continuously to the left */
  animation: tapeScroll 15s linear infinite;
}

.reverse-scroll {
  animation-direction: reverse;
}

@keyframes tapeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); } /* Scrolls half the width to create a seamless loop */
}

/* --- SCROLL INDICATOR --- */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-secondary);
  text-decoration: none;
  z-index: 20; /* Keep it above the 3D canvas */
  transition: color 0.3s ease;
  animation: bounce 2s infinite;
}

.scroll-indicator:hover {
  color: var(--accent); /* Turns hacker green on hover */
}

.scroll-text {
  font-size: 0.8rem;
  letter-spacing: 2px;
  margin-bottom: 5px;
  font-family: var(--font-mono);
}

.scroll-arrow {
  width: 24px;
  height: 24px;
}

/* Smooth bouncing animation */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translate(-50%, 0);
  }
  40% {
    transform: translate(-50%, -10px);
  }
  60% {
    transform: translate(-50%, -5px);
  }
}

