/* =========================================================
   Prasanth Muntha — Portfolio
   Black & White • Circuit Line • Geometric Motion
   ========================================================= */

:root {
  --black: #0a0a0a;
  --white: #f5f5f5;
  --gray: #888;
  --gray-dim: #444;
  --node-size: 14px;
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* =========================================================
   TOP ANNOUNCEMENT BAR (Glacix)
   ========================================================= */

.glacix-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--black);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0 3rem 0 1rem;
  z-index: 99;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.glacix-bar.hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* V2: single link, live dot */
.glacix-bar-v2 .glacix-bar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  animation: glacix-pulse 1.5s ease-in-out infinite;
}

@keyframes glacix-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
  50% { opacity: 0.8; }
  70% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
}

.glacix-bar-link {
  color: var(--gray);
  text-decoration: none;
  transition: color 0.2s ease;
}

.glacix-bar-link:hover {
  color: var(--white);
}

.glacix-bar-link strong {
  color: var(--white);
  font-weight: 600;
}

.glacix-bar-close {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  padding: 0.35rem;
  font-size: 0.7rem;
  transition: color 0.2s ease;
}

.glacix-bar-close:hover {
  color: var(--white);
}

/* When bar is visible, push nav down */
body:not(.glacix-bar-dismissed) nav {
  top: 40px;
}

body:not(.glacix-bar-dismissed) header {
  padding-top: calc(6rem + 40px);
}

body.glacix-bar-dismissed .glacix-bar {
  display: none;
}

/* =========================================================
   GLACIX POPUP
   ========================================================= */

.glacix-popup {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.glacix-popup.active {
  opacity: 1;
  visibility: visible;
}

.glacix-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
}

.glacix-popup-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 2rem;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.glacix-popup.active .glacix-popup-card {
  transform: scale(1) translateY(0);
}

.glacix-popup-glow {
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.4) 100%
  );
  background-size: 200% 100%;
  animation: borderFlow 5s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 2px;
  pointer-events: none;
}

.glacix-popup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--gray);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
  z-index: 2;
}

.glacix-popup-close:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

.glacix-popup-content {
  position: relative;
  z-index: 1;
}

.glacix-popup-badge {
  display: inline-block;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.3rem 0.6rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  margin-bottom: 1rem;
}

.glacix-popup-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.glacix-popup-desc {
  font-size: 0.95rem;
  color: var(--gray);
  line-height: 1.5;
  margin: 0 0 1.5rem;
}

.glacix-popup-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.glacix-popup-dismiss {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--gray);
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s ease;
}

.glacix-popup-dismiss:hover {
  color: var(--white);
}

/* =========================================================
   LOADING SCREEN
   ========================================================= */

.loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  text-align: center;
  width: 90%;
  max-width: 400px;
}

.loader-logo {
  font-family: 'Space Mono', monospace;
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 2rem;
  letter-spacing: 0.02em;
}

.loader-dot {
  display: inline-block;
  animation: loaderPulse 0.8s ease-in-out infinite;
}

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

.loader-terminal {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  text-align: left;
  margin-bottom: 2rem;
  min-height: 100px;
}

.loader-line {
  color: #4ade80;
  margin-bottom: 0.4rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.loader-line.show {
  opacity: 1;
  transform: translateX(0);
}

.loader-line.dim {
  color: var(--gray);
}

.loader-bar {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.loader-progress {
  height: 100%;
  width: 0%;
  background: var(--white);
  transition: width 0.3s ease;
}

/* =========================================================
   SCROLL PROGRESS INDICATOR
   ========================================================= */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--white) 0%, rgba(255,255,255,0.5) 100%);
  z-index: 9999;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* =========================================================
   CUSTOM CURSOR
   ========================================================= */

.custom-cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--white);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, width 0.2s ease, height 0.2s ease, background 0.2s ease;
  mix-blend-mode: difference;
}

.custom-cursor.hover {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--white);
}

.custom-cursor.clicking {
  transform: translate(-50%, -50%) scale(0.8);
}

.custom-cursor.hidden {
  opacity: 0;
}

.cursor-trail {
  position: fixed;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99997;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease-out, width 0.3s ease, height 0.3s ease, border-color 0.2s ease;
}

.cursor-trail.hover {
  width: 50px;
  height: 50px;
  border-color: rgba(255, 255, 255, 0.5);
}

.cursor-trail.hidden {
  opacity: 0;
}

/* Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
  .custom-cursor,
  .cursor-trail {
    display: none;
  }
}

/* Custom cursor shelved: show default pointer (cursor: none removed) */
@media (hover: hover) and (pointer: fine) {
  .custom-cursor,
  .cursor-trail {
    display: none;
  }
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--black);
  color: var(--white);
  line-height: 1.65;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.mono {
  font-family: 'Space Mono', monospace;
}

strong {
  font-weight: 600;
}

/* ===== Circuit Canvas ===== */
#circuit-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ===== Navigation ===== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 5%;
  background: transparent;
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

nav.scrolled {
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
}

.logo {
  font-family: 'Space Mono', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 10;
}

.dot {
  display: inline-block;
  animation: pulse 1.5s ease-in-out infinite;
}

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

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-links a {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: opacity 0.2s ease;
  position: relative;
  z-index: 10;
}

.nav-links a:hover {
  opacity: 0.6;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--white);
  border-radius: 50%;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

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

.back-to-top:hover {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.back-to-top i {
  font-size: 1rem;
}

/* ===== Hero ===== */
header {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  padding: 6rem 8% 4rem;
  gap: 4rem;
  position: relative;
  z-index: 1;
}

.hero-left {
  max-width: 600px;
}

.label {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gray);
  margin: 0 0 1rem;
}

h1 {
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 700;
  line-height: 0.95;
  margin: 0 0 1.5rem;
  letter-spacing: -0.03em;
}

.tagline {
  font-size: 1.1rem;
  color: var(--gray);
  margin: 0 0 2.5rem;
  font-family: 'Space Mono', monospace;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.85rem 1.4rem;
  border: 1px solid var(--white);
  background: var(--white);
  color: var(--black);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn:hover {
  background: transparent;
  color: var(--white);
}

.btn.outline {
  background: transparent;
  color: var(--white);
}

.btn.outline:hover {
  background: var(--white);
  color: var(--black);
}

.btn i {
  font-size: 0.85rem;
}

/* ===== Status Panel ===== */
.status-panel {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: 380px;
  font-family: 'Space Mono', monospace;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray);
}

.blink-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--white);
  animation: blink 1.2s ease-in-out infinite;
}

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

.panel-content {
  padding: 1rem;
  min-height: 90px;
}

.typing-line {
  font-size: 0.8rem;
  color: var(--white);
  margin-bottom: 0.4rem;
  min-height: 1.2em;
}

.typing-line::after {
  content: '▋';
  animation: cursorBlink 0.7s step-end infinite;
  opacity: 0;
}

.typing-line.typing::after {
  opacity: 1;
}

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

.panel-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.7rem;
  color: var(--gray);
}

.in-works {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.spinner {
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--gray);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Sections ===== */
section {
  position: relative;
  z-index: 1;
  padding: 5rem 8%;
  padding-left: calc(8% + 60px);
  min-height: 50vh;
}

.section-node {
  position: absolute;
  left: 8%;
  top: 5rem;
  width: var(--node-size);
  height: var(--node-size);
  border: 2px solid var(--white);
  background: var(--black);
  transform: rotate(45deg);
  z-index: 5;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.section-node.active {
  background: var(--white);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.section-content {
  max-width: 900px;
}

.section-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gray);
  display: block;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin: 0 0 1.5rem;
  letter-spacing: -0.02em;
}

section p {
  color: var(--gray);
  font-size: 1.05rem;
  margin: 0 0 1.25rem;
  max-width: 650px;
}

section p strong {
  color: var(--white);
}

/* ===== Tech Stack ===== */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.stack-category h4 {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray);
  margin: 0 0 0.75rem;
  font-weight: 400;
}

.stack-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stack-items span {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.2s ease;
}

.stack-items span:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

/* ===== Projects Grid ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.project-card {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease;
}

.project-card:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

/* Featured project – Glacix (animated border / premium) */
.project-card-featured {
  position: relative;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  overflow: visible;
}

.project-card-featured::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.2) 25%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    rgba(255, 255, 255, 0.9) 100%
  );
  background-size: 200% 100%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: borderFlow 4s linear infinite;
  pointer-events: none;
}

.project-card-featured::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08) 0%,
    transparent 40%,
    transparent 60%,
    rgba(255, 255, 255, 0.06) 100%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card-featured:hover::after {
  opacity: 1;
}

.project-card-featured:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

@keyframes borderFlow {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.project-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  position: relative;
  z-index: 1;
}

.project-card-link:hover {
  color: inherit;
}

.project-badge {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  margin-left: auto;
}

.project-card-featured .project-link {
  color: var(--gray);
  font-size: 0.75rem;
  transition: color 0.2s ease;
}

.project-card-featured:hover .project-link {
  color: var(--white);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-card-featured .project-header {
  gap: 0.5rem;
}

.project-card-featured .project-header .project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.project-num {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--gray);
}

.project-link {
  color: var(--gray);
  transition: color 0.2s ease;
}

.project-link:hover {
  color: var(--white);
}

.project-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.project-sub {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--gray);
  margin: 0 0 0.5rem !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-desc {
  font-size: 0.9rem !important;
  color: var(--gray) !important;
  margin-bottom: 1rem !important;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-stack span {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--gray);
}

/* ===== Contact ===== */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* ===== Footer ===== */
footer {
  position: relative;
  text-align: center;
  padding: 3rem 5%;
  font-size: 0.85rem;
  color: var(--gray);
  z-index: 1;
}

.footer-node {
  position: absolute;
  left: 8%;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: var(--node-size);
  height: var(--node-size);
  border: 2px solid var(--gray-dim);
  background: var(--black);
}

/* ===== Reveal Animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   RESUME MODAL - LaTeX Style
   ========================================================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
}

.modal-container {
  position: relative;
  width: 95%;
  max-width: 1000px;
  height: 92vh;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  transform: scale(0.9) translateY(30px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1),
              opacity 0.4s ease;
}

.modal.active .modal-container {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #111;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: var(--white);
}

.modal-title i {
  color: #ef4444;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
}

.modal-btn {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.6rem 1rem;
  border: 1px solid var(--white);
  background: var(--white);
  color: var(--black);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.modal-btn:hover {
  background: transparent;
  color: var(--white);
}

.modal-btn.outline {
  background: transparent;
  color: var(--white);
}

.modal-btn.outline:hover {
  background: var(--white);
  color: var(--black);
}

.modal-btn.ghost {
  background: transparent;
  color: var(--white);
  border-color: transparent;
}

.modal-btn.ghost:hover {
  border-color: var(--white);
}

.modal-body {
  flex: 1;
  overflow: hidden;
  padding: 0;
  display: flex;
  position: relative;
}

#pdf-viewer {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#pdf-viewer.visible {
  opacity: 1;
}

/* Compile Overlay */
.compile-overlay {
  position: absolute;
  inset: 0;
  background: #0d0d0d;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.compile-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.compile-terminal {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: #4ade80;
  max-width: 500px;
  width: 90%;
}

.terminal-line {
  margin-bottom: 0.5rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
}

.terminal-line.show {
  opacity: 1;
  transform: translateX(0);
}

.terminal-line.active::after {
  content: '▋';
  animation: terminalBlink 0.6s step-end infinite;
}

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

.terminal-line .success {
  color: #4ade80;
}

.terminal-line .info {
  color: #888;
}

.terminal-line .file {
  color: #60a5fa;
}


/* ===== Responsive ===== */
@media (max-width: 900px) {
  header {
    grid-template-columns: 1fr;
    padding: 8rem 5% 4rem;
  }

  .status-panel {
    max-width: 100%;
  }

  section {
    padding: 4rem 5%;
    padding-left: calc(5% + 40px);
  }

  .section-node {
    left: 5%;
    top: 4rem;
    width: 12px;
    height: 12px;
  }

  .footer-node {
    left: 5%;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}

@media (max-width: 600px) {
  h1 {
    font-size: 3rem;
  }

  .nav-links {
    gap: 1.25rem;
  }

  .nav-links a {
    font-size: 0.7rem;
  }

  section {
    padding-left: 5%;
  }

  .section-node,
  .footer-node {
    display: none;
  }

  .stack-grid {
    grid-template-columns: 1fr;
  }

}

/* ===== Selection ===== */
::selection {
  background: var(--white);
  color: var(--black);
}

/* =========================================================
   PARALLAX EFFECTS
   ========================================================= */

.parallax-slow {
  will-change: transform;
  transition: transform 0.1s ease-out;
}

.parallax-medium {
  will-change: transform;
  transition: transform 0.1s ease-out;
}

.parallax-fast {
  will-change: transform;
  transition: transform 0.1s ease-out;
}

/* Parallax elements float slightly */
.hero-left {
  will-change: transform;
}

.status-panel {
  will-change: transform;
}

.section-node {
  will-change: transform;
}

.project-card {
  will-change: transform;
}

/* ===== Data Pulse Animation ===== */
@keyframes dataPulse {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

/* =========================================================
   EASTER EGGS
   ========================================================= */

/* Toast Notification */
.easter-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--white);
  color: var(--black);
  padding: 1rem 1.5rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.easter-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  font-size: 1.2rem;
}

/* Hyper Mode */
.hyper-mode {
  animation: hyperPulse 0.5s ease-in-out infinite;
}

@keyframes hyperPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.1); }
}

.hyper-mode .section-node {
  animation: hyperNode 0.3s ease-in-out infinite;
}

@keyframes hyperNode {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.5); }
  50% { box-shadow: 0 0 40px rgba(255, 255, 255, 0.9); }
}

/* Glitch Mode */
.glitch-mode h1 {
  animation: glitchText 0.3s ease-in-out infinite;
}

@keyframes glitchText {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

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

.glitch-mode h1::before {
  animation: glitchBefore 0.3s ease-in-out infinite;
  color: #0ff;
  z-index: -1;
}

.glitch-mode h1::after {
  animation: glitchAfter 0.3s ease-in-out infinite;
  color: #f0f;
  z-index: -2;
}

@keyframes glitchBefore {
  0% { clip-path: inset(0 0 90% 0); transform: translate(-3px); }
  50% { clip-path: inset(50% 0 30% 0); transform: translate(3px); }
  100% { clip-path: inset(80% 0 0 0); transform: translate(-3px); }
}

@keyframes glitchAfter {
  0% { clip-path: inset(80% 0 0 0); transform: translate(3px); }
  50% { clip-path: inset(10% 0 70% 0); transform: translate(-3px); }
  100% { clip-path: inset(0 0 90% 0); transform: translate(3px); }
}

/* Matrix Mode */
.matrix-mode {
  background: #000 !important;
}

.matrix-rain {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  overflow: hidden;
}

.matrix-drop {
  position: absolute;
  top: -50px;
  color: #0f0;
  font-family: 'Space Mono', monospace;
  font-size: 1.5rem;
  text-shadow: 0 0 10px #0f0;
  animation: matrixFall linear infinite;
  opacity: 0.8;
}

@keyframes matrixFall {
  0% { transform: translateY(-50px); opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}

/* Name Bounce */
.name-bounce {
  animation: nameBounce 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes nameBounce {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.05); }
  50% { transform: scale(0.95); }
  70% { transform: scale(1.02); }
}

/* Secret panel styles */
.status-panel .typing-line.show {
  opacity: 1;
  transform: translateX(0);
}

/* =========================================================
   FLOATING EASTER EGG HINTS
   ========================================================= */

.hint-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.floating-hint {
  position: absolute;
  font-family: 'Space Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  white-space: nowrap;
  transform: rotate(var(--rotation, 0deg));
  user-select: none;
  opacity: 0;
}

.floating-hint.animate {
  animation: hintFloat 5s ease-in-out forwards;
}

@keyframes hintFloat {
  0% {
    opacity: 0;
    transform: rotate(var(--rotation, 0deg)) translate(0, 0) scale(0.9);
  }
  15% {
    opacity: 0.6;
    transform: rotate(var(--rotation, 0deg)) translate(calc(var(--drift-x, 0) * 0.15), calc(var(--drift-y, 0) * 0.15)) scale(1.05);
  }
  30% {
    opacity: 0.5;
    transform: rotate(var(--rotation, 0deg)) translate(calc(var(--drift-x, 0) * 0.3), calc(var(--drift-y, 0) * 0.3)) scale(1);
  }
  70% {
    opacity: 0.4;
    transform: rotate(var(--rotation, 0deg)) translate(calc(var(--drift-x, 0) * 0.7), calc(var(--drift-y, 0) * 0.7)) scale(1);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--rotation, 0deg)) translate(var(--drift-x, 0), var(--drift-y, 0)) scale(0.95);
  }
}

/* Glow effect */
.floating-hint {
  text-shadow: 
    0 0 10px rgba(255, 255, 255, 0.6),
    0 0 20px rgba(255, 255, 255, 0.3);
}

/* Hide hints in hyper/matrix mode */
.hyper-mode .hint-container,
.matrix-mode .hint-container {
  display: none;
}

/* =========================================================
   TERMINAL MODE
   ========================================================= */

.terminal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.terminal-window {
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  background: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

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

.terminal-header {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #1a1a1a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px 8px 0 0;
}

.terminal-buttons {
  display: flex;
  gap: 8px;
}

.term-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #333;
}

.term-btn.close { background: #ff5f56; }
.term-btn.minimize { background: #ffbd2e; }
.term-btn.maximize { background: #27ca40; }

.terminal-title {
  flex: 1;
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: var(--gray);
}

.terminal-hint {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: #555;
}

.terminal-body {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  min-height: 300px;
  max-height: 60vh;
}

.terminal-output {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--white);
}

.terminal-output .line {
  margin-bottom: 0.25rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-output .prompt {
  color: #4ade80;
}

.terminal-output .command {
  color: var(--white);
}

.terminal-output .response {
  color: var(--gray);
}

.terminal-output .success {
  color: #4ade80;
}

.terminal-output .error {
  color: #ef4444;
}

.terminal-output .info {
  color: #60a5fa;
}

.terminal-output .highlight {
  color: #fbbf24;
}

.terminal-input-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.terminal-prompt {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: #4ade80;
  white-space: nowrap;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: var(--white);
  caret-color: #4ade80;
}

.terminal-input::placeholder {
  color: #444;
}

/* ASCII art styling */
.terminal-output .ascii {
  color: #4ade80;
  line-height: 1.2;
}

/* Terminal scrollbar */
.terminal-body::-webkit-scrollbar {
  width: 6px;
}

.terminal-body::-webkit-scrollbar-track {
  background: transparent;
}

.terminal-body::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
  background: #444;
}

/* Terminal button */
.terminal-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--gray);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  background: rgba(20, 20, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.2s ease;
}

.terminal-btn:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(30, 30, 30, 0.95);
}

.terminal-btn i {
  font-size: 0.9rem;
}

.terminal-btn kbd {
  background: #0a0a0a;
  border: 1px solid #333;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  color: #666;
}
