/* Base Styles & Variables */
:root {
  /* Removed CRT overlay variables */

  /* Neutrals */
  --color-bg-dark: #0D0D0D;     /* Jet Black */
  --color-bg-mid: #1F1F1F;      /* Charcoal Gray */
  --color-text: #F2F1EE;        /* Soft Off-White */

  /* Blues and Purples */
  --color-primary: #4A6CF7;     /* Vibrant blue */
  --color-primary-2: #8A63D2;   /* Soft purple */

  /* Accents */
  --color-purple: #5B2C6F;      /* Digital Purple */
  --color-pink: #FF3CF5;        /* Glitch Pink */
  --color-blue: #00CCFF;        /* Electric Blue */

  /* Overlays */
  --overlay-primary: rgba(74, 108, 247, 0.1);

  /* Derived */
  --text-secondary: #B9B8B5;
  --border-color: #2A2A2A;
  --terminal-bg: rgba(0,0,0,0.85);
  --terminal-border: #2A2A2A;
}

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


/* Custom font for landing page */
@font-face {
  font-family: 'LoveLetter';
  src: url('loveletter.ttf') format('truetype');
}

/* Tier 1: Focus-visible neon glow for accessibility and vibe */
:root {
  --focus-glow: 0 0 0 3px rgba(74, 108, 247, 0.15), 0 0 0 6px rgba(0,204,255,0.12);
}
/* Removed CRT overlay */
:where(a, button, .btn, input, textarea, select):focus-visible {
  outline: none;
  box-shadow: var(--focus-glow);
  border-color: var(--color-primary);
  transition: box-shadow .15s ease, border-color .15s ease;
}

/* Tier 1: Top chroma line (subtle, fixed) */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-blue));
  box-shadow: 0 0 10px rgba(0,255,153,0.35);
  z-index: 1200;
  pointer-events: none;
}

/* Tier 2: Link hover scan underline (cheap transform) */
a {
  position: relative;
}
a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  height: 2px; width: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-blue));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .18s ease-out;
  box-shadow: 0 0 6px rgba(0,255,153,0.25);
}
a:hover::after, a:focus-visible::after {
  transform: scaleX(1);
}

/* Tier 2: Button press depth and refined hover */
.btn {
  transform: translateZ(0); /* GPU hint for crisp edges */
}
.btn:hover {
  box-shadow: 0 6px 22px rgba(0,255,153,0.22);
}
.btn:active {
  transform: translateY(1px);
  box-shadow: 0 4px 16px rgba(0,255,153,0.18) inset, 0 2px 10px rgba(0,255,153,0.25);
}

/* Existing site styles */
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background-color: var(--color-bg-dark);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(0, 255, 153, 0.04) 0%, transparent 30%),
    radial-gradient(circle at 90% 80%, rgba(0, 204, 255, 0.04) 0%, transparent 30%);
  opacity: 0.85;
  user-select: auto;           /* allow text selection */
  -webkit-user-select: auto;
  -ms-user-select: auto;
  pointer-events: auto;        /* enable pointer events for selection */
}

/* Add top padding to non-index pages */
body:not(.home-page) main {
  padding-top: 180px;
}
/* Allow selection in explicit safe zones */
.allow-select, input, textarea, code, pre {
  user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: 1px;
}

/* Apply LoveLetter font to buttons, tagline, and navigation */
.btn, .tagline, .nav-links a, .button-grid a {
  font-family: 'LoveLetter', sans-serif;
  position: relative;
}

/* Mangled text effect for LoveLetter font */
.love-letter-glitch {
  display: inline-block;
}

.love-letter-glitch span {
  position: relative;
  display: inline-block;
  transition: transform 0.3s ease;
  animation: mangle 3s infinite alternate;
}

@keyframes mangle {
  0% {
    transform: translateY(0px);
  }
  25% {
    transform: translateY(-2px);
  }
  50% {
    transform: translateY(3px);
  }
  75% {
    transform: translateY(-1px);
  }
  100% {
    transform: translateY(2px);
  }
}

h1 {
  font-size: 2.5rem;
}

/* Apply glitch effect to all LoveLetter text */
.btn, .tagline, .nav-links a, .button-grid a {
  display: inline-block;
}

.btn span, .tagline span, .nav-links a span, .button-grid a span {
  display: inline-block;
}

.btn .love-letter-glitch,
.tagline .love-letter-glitch,
.nav-links a .love-letter-glitch,
.button-grid a .love-letter-glitch {
  display: contents;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
  color: var(--color-primary-2);
  text-shadow: 0 0 6px rgba(138, 99, 210, 0.4);
}

/* Layout */
/* Site-wide container: switch to single centered column */
.container {
  width: 100%;
  max-width: 800px;         /* single-column target */
  margin: 0 auto;
  padding: 0 16px;          /* slight side padding */
}

.section {
  padding: 64px 0;          /* slightly tighter vertical rhythm */
  position: relative;
}

.section-title {
  text-align: left;         /* align with single-column flow */
  margin: 0 0 32px 0;
  position: relative;
  display: block;
  left: 0;
  transform: none;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 160px;  /* shorter underline for column layout */
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-blue));
  box-shadow: 0 0 10px rgba(0,255,153,0.35), 0 0 18px rgba(0,204,255,0.18);
}

/* Header & Navigation */
header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(13, 13, 13, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 20px; /* Added horizontal padding for better spacing */
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  max-width: 1200px; /* Added max-width to center content */
  margin: 0 auto; /* Center the navigation container */
}

.logo h1 {
  font-family: "Space Grotesk", Inter, sans-serif;
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(0,255,153,0.35);
  margin-bottom: 5px;
}

.tagline {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: .15em solid var(--color-blue);
  width: 0;
  animation: 
    typing 3.5s steps(30, end) 1s forwards,
    blink-caret .75s step-end infinite;
}

/* Typewriter animations */
@keyframes typing {
  from { width: 0 }
  to { width: 22ch } /* "Research & Development" is 22 characters */
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--color-blue); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tagline {
    animation: none !important;
    border-right: none !important;
    width: auto !important;
  }
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin-left: 30px;
}

.nav-links a {
  color: var(--text-primary);
  font-size: 0.9rem;
  position: relative;
  cursor: pointer; /* Add pointer cursor */
  transition: transform 0.2s ease, color 0.2s ease; /* Add transitions */
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-blue);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a:hover {
  transform: scale(1.05); /* Slight scale on hover */
  color: var(--color-blue); /* Color change on hover */
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--color-primary);
  margin: 3px 0;
  transition: 0.3s;
}

/* Main Section */
.main {
  min-height: 70vh;         /* not full viewport to avoid oversized hero in column layout */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: left;
  position: relative;
  overflow: hidden;
  font-family: 'LoveLetter', sans-serif;
}

/* Center hero block and headline */
.main .hero-content {
  text-align: center;
  display: grid;
  place-items: center;
  gap: 14px;
}
.hero-content h2 { text-align: center; }

.main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(transparent 50%, rgba(0, 0, 0, 0.8) 100%),
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.04),
      rgba(255,255,255,0.04) 1px,
      transparent 1px,
      transparent 2px
    );
  pointer-events: none;
  z-index: -1;
}

.hero-content h2 {
  font-size: 3rem;          /* scale down for 800px column */
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;         /* hide reveal overflow */
}

/* Simplified SEREXP styling */
.hero-title {
  display: inline-block;
  background: linear-gradient(90deg, var(--color-primary), var(--color-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;                 /* gradient text */
  filter: drop-shadow(0 0 8px rgba(0,255,153,0.25));
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  /* No animations */
}

.subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-family: Inter, system-ui, sans-serif;
}

/* Terminal */
.terminal {
  width: 100%;
  max-width: 100%;
  margin: 24px 0 0;
  background: var(--terminal-bg);
  border: 1px solid var(--terminal-border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.terminal-header {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  background: #222;
  border-bottom: 1px solid var(--terminal-border);
}

.terminal-buttons {
  display: flex;
  margin-right: 10px;
}

.terminal-buttons span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 5px;
}

.close {
  background: #ff5f56;
}

.minimize {
  background: #ffbd2e;
}

.maximize {
  background: #27c93f;
}

.terminal-title {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.terminal-body {
  padding: 20px;
  font-size: 0.9rem;
  text-align: left;
}

.terminal-body p {
  margin-bottom: 10px;
}

.prompt {
  color: var(--accent-green);
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--accent-green);
  animation: blink 1s infinite;
}

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

/* About Section */
.about-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

.profile-image {
  position: relative;
  height: 300px;
  background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple));
  border-radius: 10px;
  overflow: hidden;
}

.profile-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.15),
      rgba(0, 0, 0, 0.15) 1px,
      transparent 1px,
      transparent 2px
    );
}

  .glitch-image {
    width: 100%;
    height: 100%;
    background: url('../images/serexps.jpg') center/cover;
    position: relative;
  }

.skills ul {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  list-style: none;
  margin-top: 20px;
}

.skills li {
  padding: 8px 15px;
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  font-size: 0.9rem;
}

.skills li:hover {
  background: rgba(189, 0, 255, 0.2);
  transform: translateY(-2px);
  transition: all 0.3s ease;
}

/* Research & Projects */
/* Lists/cards stack vertically in single column */
.research-grid, .projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.research-card, .project-card {
  background: var(--color-bg-mid);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 30px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Ensure all dynamically injected project cards match research card styling */
.projects-grid.uniform-projects .project-card,
#projects-list.uniform-projects .project-card,
#projects-list .project-card {
  background: var(--color-bg-mid) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  color: var(--color-text);
}
#projects-list .project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.6), 0 0 12px rgba(0,255,153,0.2);
  border-color: var(--color-primary);
}
/* Title/accent colors inside project cards for consistency */
#projects-list .project-card h3,
#projects-list .project-card .project-title {
  color: var(--color-blue);
}
#projects-list .project-card .project-year {
  color: var(--accent-green);
  font-size: 0.9rem;
  margin: 10px 0;
}
#projects-list .project-card .project-tags .tag {
  background: var(--overlay-green);
  border: 1px solid var(--border-color);
}

.research-card:hover, .project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.6), 0 0 12px rgba(0,255,153,0.2);
  border-color: var(--color-primary);
}

.research-card::before, .project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-blue), var(--color-pink));
}

.research-year {
  color: var(--accent-green);
  font-size: 0.9rem;
  margin: 10px 0;
}

.research-title, .project-tech {
  color: var(--color-blue);
  margin-bottom: 15px;
}

.research-desc, .project-desc {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 0.95rem;
  flex: 1 1 auto;
  text-align: justify;
  text-justify: inter-word;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto; /* push tags to bottom of project card */
}

.tag {
  padding: 5px 10px;
  background: var(--overlay-green);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  font-size: 0.8rem;
}

/* Improved tag styling for better contrast */
.blog-square-back .tag {
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-blue));
  border: none;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-bg-dark);
  box-shadow: 0 2px 4px rgba(0, 204, 255, 0.3);
}

/* Markdown/Post content polish */
.post-content {
  line-height: 1.7;
}
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  /* Use a variable so we can adapt to header height; default ~88px */
  scroll-margin-top: var(--header-offset, 88px);
}
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
  margin: 18px auto;
}
.post-content blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--color-primary);
  background: rgba(0,0,0,0.25);
  color: var(--text-secondary);
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  overflow: auto;
  display: block;
}
.post-content th, .post-content td {
  border: 1px solid var(--border-color);
  padding: 10px 12px;
}
.post-content tr:nth-child(even) {
  background: rgba(255,255,255,0.02);
}
.post-content code:not(pre code) {
  background: rgba(0,0,0,0.35);
  padding: 2px 6px;
  border-radius: 4px;
}
.post-content pre {
  position: relative;
  overflow: auto;
}
.post-content .code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.8rem;
  padding: 6px 10px;
  background: transparent;
  color: var(--color-blue);
  border: 1px solid var(--color-blue);
  border-radius: 4px;
  cursor: pointer;
}
.post-content .code-copy:hover {
  background: var(--color-blue);
  color: var(--color-bg-mid);
}

/* Blog Section */
.blog-intro {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 40px;
  color: var(--text-secondary);
}

.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.blog-card {
  background: var(--color-bg-mid);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 30px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none; /* when rendered as anchor */
  color: inherit;        /* keep text color */
  overflow: hidden;
}

.blog-card:hover,
.blog-card:focus,
.blog-card:focus-within {
  transform: translateY(-5px);
  box-shadow: 0 8px 26px rgba(0,204,255,0.18), 0 0 14px rgba(0,204,255,0.18);
  border-color: var(--color-blue);
  outline: none;
}

.blog-meta {
  color: var(--accent-green);
  font-size: 0.9rem;
  margin: 10px 0;
}

.blog-excerpt {
  color: var(--text-secondary);
  margin-bottom: 20px;
  flex: 1 1 auto;
  text-align: justify;
  text-justify: inter-word;
}

.read-more {
  color: var(--accent-blue);
  font-size: 0.9rem;
  position: relative;
  align-self: flex-end; /* align read button consistently to the bottom-right */
  text-decoration: none;
}

/* Specific styling for blog square read-more */
.blog-square .read-more {
  display: inline-block;
  margin-top: 15px;
  background: var(--color-primary);
  padding: 8px 15px;
  border-radius: 4px;
  text-align: center;
  color: var(--color-bg-dark) !important;
  font-weight: 600;
  z-index: 10;
  position: relative;
}

/* Ensure Read More is visible only on front */
.blog-square-front .read-more {
  display: inline-block !important;
}

.blog-square-back .read-more {
  display: none !important;
}

/* Additional specificity to ensure Read More is hidden on back */
div.blog-square-back a.read-more {
  display: none !important;
}

/* Contrast fix: ensure green buttons/links have dark label text (e.g., READ PDF)
   IMPORTANT: scope ONLY to buttons, not to cards or other anchors */
a.btn, .btn { color: #0d0d0d; }
a.btn:hover, .btn:hover { color: #0d0d0d; }
/* Keep PDF action buttons readable, but DO NOT affect project/blog cards */
a.btn[href*="paper.pdf"], .btn[href*="paper.pdf"] { color: #0d0d0d !important; }

.read-more::after {
  content: '→';
  margin-left: 5px;
  transition: all 0.3s ease;
}

.read-more:hover::after {
  transform: translateX(5px);
}

/* Playground Section */
.playground-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.feature {
  background: rgba(30, 30, 30, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 30px;
  text-align: center;
  transition: all 0.3s ease;
}

.feature:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  border-color: var(--accent-green);
}

.feature h3 {
  color: var(--color-purple);
  margin-bottom: 15px;
}

/* Contact Section */
.contact-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

.contact-info p {
  margin-bottom: 30px;
  color: var(--text-secondary);
}

.contact-methods {
  display: grid;
  gap: 20px;
}

.contact-item h3 {
  color: var(--accent-blue);
  margin-bottom: 5px;
}

.glitch-box {
  height: 200px;
  background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.glitch-box p {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  animation: glitch 2s infinite;
}

/* Blog flip card styles */
.blog-square {
  height: 380px;
  background: rgba(18, 25, 35, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0;
  perspective: 1000px;
  position: relative;
  overflow: hidden;
}

.blog-square-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.blog-square:hover .blog-square-inner {
  transform: rotateY(180deg);
}

/* Prevent hover effect when disabled */
.blog-square.no-hover:hover .blog-square-inner {
  transform: rotateY(0deg) !important;
}

.blog-square-front, .blog-square-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.blog-square-back {
  transform: rotateY(180deg);
  background: rgba(12, 18, 28, 0.9);
  overflow-y: visible;
}

.blog-square-back .post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 10px;
}

/* Footer */
footer {
  background: var(--color-bg-mid);
  border-top: 1px solid var(--border-color);
  padding: 40px 0;
  text-align: center;
}

.footer-note {
  margin-top: 10px;
  color: var(--text-secondary);
}

.heart {
  color: #ff5252;
  animation: pulse 1.5s infinite;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 25px;
  background: var(--color-primary);
  border: 1px solid var(--color-primary);
  color: var(--color-bg-mid);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn:hover {
  background: var(--color-primary-2);
  border-color: var(--color-primary-2);
  box-shadow: 0 0 14px rgba(138, 99, 210, 0.35);
  transform: translateY(-2px);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.btn:hover::before {
  left: 100%;
}

/* Glitch Effects */
.glitch {
  position: relative;
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(0,255,153,0.35);
}

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

.glitch::before {
  left: 2px;
  text-shadow: -2px 0 var(--color-blue);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: -2px 0 var(--color-pink);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim2 5s infinite linear alternate-reverse;
}

/* Removed unused CRT effects */

/* Sidebar removed */

/* Hidden Terminal */
.terminal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.terminal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.terminal-window {
  width: 90%;
  max-width: 800px;
  background: var(--terminal-bg);
  border: 1px solid var(--terminal-border);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.terminal-overlay.active .terminal-window {
  transform: scale(1);
}

/* Animations */
@keyframes glitch-anim {
  0% {
    clip: rect(42px, 9999px, 44px, 0);
  }
  5% {
    clip: rect(12px, 9999px, 59px, 0);
  }
  10% {
    clip: rect(48px, 9999px, 29px, 0);
  }
  15% {
    clip: rect(42px, 9999px, 73px, 0);
  }
  20% {
    clip: rect(63px, 9999px, 27px, 0);
  }
  25% {
    clip: rect(34px, 9999px, 55px, 0);
  }
  30% {
    clip: rect(86px, 9999px, 73px, 0);
  }
  35% {
    clip: rect(20px, 9999px, 20px, 0);
  }
  40% {
    clip: rect(26px, 9999px, 60px, 0);
  }
  45% {
    clip: rect(25px, 9999px, 66px, 0);
  }
  50% {
    clip: rect(57px, 9999px, 98px, 0);
  }
  55% {
    clip: rect(5px, 9999px, 46px, 0);
  }
  60% {
    clip: rect(82px, 9999px, 31px, 0);
  }
  65% {
    clip: rect(54px, 9999px, 27px, 0);
  }
  70% {
    clip: rect(28px, 9999px, 99px, 0);
  }
  75% {
    clip: rect(45px, 9999px, 69px, 0);
  }
  80% {
    clip: rect(23px, 9999px, 85px, 0);
  }
  85% {
    clip: rect(1px, 9999px, 83px, 0);
  }
  90% {
    clip: rect(71px, 9999px, 14px, 0);
  }
  95% {
    clip: rect(60px, 9999px, 80px, 0);
  }
  100% {
    clip: rect(68px, 9999px, 63px, 0);
  }
}

@keyframes glitch-anim2 {
  0% {
    clip: rect(65px, 9999px, 100px, 0);
  }
  5% {
    clip: rect(52px, 9999px, 74px, 0);
  }
  10% {
    clip: rect(79px, 9999px, 85px, 0);
  }
  15% {
    clip: rect(75px, 9999px, 5px, 0);
  }
  20% {
    clip: rect(67px, 9999px, 61px, 0);
  }
  25% {
    clip: rect(14px, 9999px, 79px, 0);
  }
  30% {
    clip: rect(1px, 9999px, 66px, 0);
  }
  35% {
    clip: rect(86px, 9999px, 30px, 0);
  }
  40% {
    clip: rect(23px, 9999px, 98px, 0);
  }
  45% {
    clip: rect(85px, 9999px, 72px, 0);
  }
  50% {
    clip: rect(71px, 9999px, 75px, 0);
  }
  55% {
    clip: rect(2px, 9999px, 48px, 0);
  }
  60% {
    clip: rect(30px, 9999px, 16px, 0);
  }
  65% {
    clip: rect(59px, 9999px, 50px, 0);
  }
  70% {
    clip: rect(41px, 9999px, 62px, 0);
  }
  75% {
    clip: rect(2px, 9999px, 82px, 0);
  }
  80% {
    clip: rect(47px, 9999px, 73px, 0);
  }
  85% {
    clip: rect(3px, 9999px, 27px, 0);
  }
  90% {
    clip: rect(26px, 9999px, 55px, 0);
  }
  95% {
    clip: rect(42px, 9999px, 97px, 0);
  }
  100% {
    clip: rect(38px, 9999px, 49px, 0);
  }
}

@keyframes glitch {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(-3px, 3px);
  }
  40% {
    transform: translate(-3px, -3px);
  }
  60% {
    transform: translate(3px, 3px);
  }
  80% {
    transform: translate(3px, -3px);
  }
  to {
    transform: translate(0);
  }
}

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

/* Responsive Design */
@media (max-width: 992px) {
  .about-content,
  .contact-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .profile-image {
    height: 250px;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  
  .nav-links {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: var(--secondary-dark);
    flex-direction: column;
    align-items: center;
    padding: 40px 0;
    transition: 0.3s;
  }
  
  .nav-links.active {
    left: 0;
  }
  
  .nav-links li {
    margin: 15px 0;
  }
  
  .hero-content h2 {
    font-size: 3rem;
  }
  
  .skills ul {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .hero-content h2 {
    font-size: 2.5rem;
  }
  
  .section {
    padding: 60px 0;
  }
  
  .terminal {
    max-width: 100%;
  }
}
