/* Medium-Dark Neobrutalism */
:root {
  /* Colors */
  --bg-color: #1f2028; /* Lightened from 121212 to show black shadows clearly */
  --card-bg: #2a2c35; /* Lighter card background */
  --text-main: #f0f0f5; /* Softened off-white to reduce eye strain */
  --text-muted: #b4b8c5; /* Brighter muted text for readability */

  /* Bold accents */
  --accent-primary: #00f0ff; /* Electric Cyan */
  --accent-secondary: #ff003c; /* Neon Red */
  --accent-tertiary: #ffe600; /* Cyber Yellow */

  /* Structural */
  --border-color: #000000;
  --border-width: 3px;

  /* Typography */
  --font-display: "Space Grotesk", sans-serif;
  --font-mono: "Space Mono", monospace;

  /* Shadows - Hard brutalist drops */
  --shadow-sm: 4px 4px 0px var(--border-color);
  --shadow-md: 6px 6px 0px var(--border-color);
  --shadow-lg: 8px 8px 0px var(--border-color);

  /* Transitions */
  --transition-fast: 0.15s ease-out;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-mono);
  line-height: 1.6;
  overflow-x: hidden;
}

@media (pointer: fine) {
  body:not(.modal-open) {
    cursor: none !important;
  }
  body:not(.modal-open) a,
  body:not(.modal-open) button,
  body:not(.modal-open) .card,
  body:not(.modal-open) .profile-card {
    cursor: none !important;
  }
}
body.modal-open .custom-cursor {
  display: none !important;
}

/* --- Native Scrollbar Hide --- */
::-webkit-scrollbar {
  display: none;
}

/* --- Custom DOM Scrollbar --- */
#custom-scrollbar {
  position: fixed;
  top: 0;
  right: 0;
  width: 14px;
  height: 100vh;
  background: var(--bg-color);
  border-left: var(--border-width) solid var(--border-color);
  z-index: 9998; /* Just below custom cursor */
}

#custom-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: -3px; /* Pull left to cover border if needed, or 0 */
  width: 14px;
  min-height: 40px;
  background-color: var(--accent-primary);
  border: 3px solid var(--border-color);
  border-right: none;
  border-left: 3px solid var(--border-color);
  cursor: none; /* Let custom cursor handle it */
  transition: background-color var(--transition-fast);
}

#custom-scrollbar-thumb.hovering {
  background-color: var(--accent-secondary);
}

/* --- Custom Cursor --- */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  background-color: transparent;
  border: 2px solid var(--accent-secondary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%) rotate(0deg);
  transition:
    width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    background-color 0.3s ease,
    border-radius 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.3s ease;
  display: none;
}

@media (pointer: fine) {
  .custom-cursor {
    display: block;
  }
}

.custom-cursor.hovering {
  width: 14px;
  height: 14px;
  background-color: var(--accent-primary);
  border-color: #000;
  border-radius: 0;
  transform: translate(-50%, -50%) rotate(45deg);
}

::selection {
  background: var(--accent-primary);
  color: #fff;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Navbar --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-color);
  border-bottom: var(--border-width) solid var(--border-color);
  padding: 16px 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-size: 1.5rem;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
  background-color: var(--accent-primary);
  background-image: linear-gradient(
    115deg,
    transparent 0%,
    transparent 40%,
    rgba(255, 255, 255, 0.6) 50%,
    transparent 60%,
    transparent 100%
  );
  background-size: 300% 100%;
  background-position: 100% 0;
  color: #000;
  padding: 4px 12px;
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background-position 0s;
  position: relative;
}

.brand:hover {
  transform: translate(-4px, -4px);
  box-shadow: 8px 8px 0px var(--border-color);
  background-position: 0% 0;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background-position 0.6s ease-out;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 1.1rem;
  padding: 8px 16px;
  border: var(--border-width) solid transparent;
  transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  background-color: var(--accent-secondary);
  color: #000;
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
  transform: translate(-2px, -2px);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: var(--card-bg);
  border: var(--border-width) solid var(--border-color);
  padding: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease;
}

.hamburger:active {
  transform: scale(0.9);
}

.hamburger .bar {
  width: 24px;
  height: 3px;
  background-color: var(--text-main);
}

/* --- Hero Section --- */
.hero-section {
  padding: 60px 24px 60px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-text-block {
  margin-bottom: 48px;
}

#hero-name {
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 1.1;
  margin-bottom: 16px;
  text-transform: uppercase;
  text-shadow: 4px 4px 0px var(--accent-primary);
}

.glitch-text {
  font-size: inherit;
  display: inline-block;
  position: relative;
}

.glitch-text:hover::before,
.glitch-text:hover::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-color: var(--bg-color);
}

.brand .glitch-text:hover::before,
.brand .glitch-text:hover::after {
  background-color: var(--accent-primary);
}

.glitch-text:hover::before {
  left: 3px;
  text-shadow: -2px 0 var(--accent-secondary);
  animation: glitch-anim-1 1s infinite steps(2, end) alternate-reverse;
}

.glitch-text:hover::after {
  left: -3px;
  text-shadow: -2px 0 var(--accent-primary);
  animation: glitch-anim-2 1.5s infinite steps(2, end) alternate-reverse;
}

@keyframes glitch-anim-1 {
  0% {
    clip-path: inset(20% 0 75% 0);
    transform: translate(2px, 0);
  }
  20% {
    clip-path: inset(60% 0 30% 0);
    transform: translate(-2px, 0);
  }
  40% {
    clip-path: inset(40% 0 55% 0);
    transform: translate(2px, 0);
  }
  60% {
    clip-path: inset(80% 0 15% 0);
    transform: translate(-2px, 0);
  }
  80% {
    clip-path: inset(10% 0 85% 0);
    transform: translate(2px, 0);
  }
  100% {
    clip-path: inset(30% 0 60% 0);
    transform: translate(-2px, 0);
  }
}

@keyframes glitch-anim-2 {
  0% {
    clip-path: inset(10% 0 80% 0);
    transform: translate(-2px, 0);
  }
  20% {
    clip-path: inset(80% 0 10% 0);
    transform: translate(2px, 0);
  }
  40% {
    clip-path: inset(30% 0 65% 0);
    transform: translate(-2px, 0);
  }
  60% {
    clip-path: inset(5% 0 90% 0);
    transform: translate(2px, 0);
  }
  80% {
    clip-path: inset(50% 0 40% 0);
    transform: translate(-2px, 0);
  }
  100% {
    clip-path: inset(70% 0 25% 0);
    transform: translate(2px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .glitch-text:hover::before,
  .glitch-text:hover::after {
    display: none;
    animation: none;
  }
}

.accent-role {
  font-size: clamp(1.2rem, 3vw, 2rem);
  color: var(--accent-tertiary);
  margin-bottom: 24px;
  background: var(--border-color);
  display: inline-block;
  padding: 4px 16px;
  border: 2px solid var(--accent-tertiary);
  position: relative;
  overflow: hidden;
}

.accent-role::after {
  content: "";
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
}

.accent-role:hover::after {
  animation: cartoon-shine 0.6s ease-out;
}

@keyframes cartoon-shine {
  0% {
    left: -100%;
  }
  100% {
    left: 200%;
  }
}

.role-link {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.role-link:hover {
  color: var(--accent-primary);
}

.hero-paragraph {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 800px;
}

.hero-actions {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: #000;
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-md);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
  text-transform: uppercase;
  cursor: pointer;
}

.btn:hover {
  transform: translate(4px, 4px);
  box-shadow: 2px 2px 0px var(--border-color);
}

.primary-btn {
  background-color: var(--accent-primary);
}

.secondary-btn {
  background-color: var(--accent-secondary);
}

/* --- Profile Card --- */
.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--card-bg);
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 48px 32px;
  text-decoration: none;
  color: var(--text-main);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
  max-width: 360px;
  width: 100%;
  justify-self: center;
}

.profile-card:hover {
  transform: translate(4px, 4px);
  box-shadow: 4px 4px 0px var(--border-color);
}

.profile-avatar {
  width: 120px;
  height: 120px;
  background-color: var(--bg-color);
  border: var(--border-width) solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--accent-primary);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-card:hover .profile-avatar {
  border-radius: 16px;
}

.profile-avatar svg {
  width: 60px;
  height: 60px;
}

.profile-meta {
  text-align: center;
}

.profile-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.profile-role {
  display: block;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.profile-link-text {
  font-weight: 700;
  color: var(--accent-secondary);
  text-transform: uppercase;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.profile-card:hover .profile-link-text {
  color: var(--accent-primary);
}

/* --- Sections & Grid --- */
.portfolio-section {
  padding: 60px 24px 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Scroll Reveal */
.reveal-up {
  opacity: 0;
}
.reveal-up.visible {
  opacity: 1;
  animation: reveal-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes reveal-in {
  0% {
    opacity: 0;
    transform: translateY(60px) rotate(var(--card-rot, 0deg));
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(var(--card-rot, 0deg));
  }
}

.section-header h2 {
  font-size: 2.5rem;
  text-transform: uppercase;
  margin-bottom: 48px;
  display: inline-block;
  background-color: var(--text-main);
  color: var(--bg-color);
  padding: 8px 24px;
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transform: rotate(-2deg);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.section-header h2:hover {
  transform: translate(-4px, -4px) rotate(0deg);
  box-shadow: 8px 8px 0px var(--accent-secondary);
  background-color: var(--accent-primary);
  color: #000;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}

.see-more-container {
  display: none; /* Hidden on desktop */
}

/* --- Cards --- */
.card {
  background-color: var(--card-bg);
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  transform: rotate(var(--card-rot, 0deg));
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.card:hover {
  transform: translate(4px, 4px) rotate(0deg);
  box-shadow: 4px 4px 0px var(--border-color);
}

.card h3 {
  font-size: 1.4rem;
  color: var(--text-main);
  margin-bottom: 8px;
  transition: color var(--transition-fast);
}

.card:hover h3 {
  color: var(--accent-primary);
}

.card-meta {
  font-size: 0.9rem;
  color: var(--accent-tertiary);
  margin-bottom: 16px;
  font-weight: 700;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
  flex-grow: 1;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tag {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-size: 0.8rem;
  padding: 4px 10px;
  border: 2px solid var(--border-color);
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.tag:hover {
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0px var(--border-color);
  background-color: var(--accent-secondary);
  color: #fff;
}

.card-link {
  display: inline-block;
  background-color: var(--text-main);
  color: var(--bg-color);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  padding: 8px 16px;
  border: 2px solid var(--border-color);
  box-shadow: 3px 3px 0px var(--border-color);
  transition: all var(--transition-fast);
  align-self: flex-start;
}

.card-link:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px var(--border-color);
  background-color: var(--accent-primary);
  color: #000;
}

/* --- Footer --- */
.footer-section {
  background-color: var(--card-bg);
  border-top: var(--border-width) solid var(--border-color);
  padding: 60px 24px;
  margin-top: 80px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 32px;
}

.footer-info h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.footer-info p {
  color: var(--text-muted);
}

.footer-socials {
  display: flex;
  gap: 16px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background-color: var(--accent-tertiary);
  color: #000;
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.social-link:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px var(--border-color);
  background-color: var(--accent-primary);
}

.social-link svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* --- Mobile Menu --- */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-color);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}

.mobile-menu.active {
  transform: translateX(0);
}

.close-menu {
  position: absolute;
  top: 24px;
  right: 24px;
  background: var(--accent-secondary);
  border: var(--border-width) solid var(--border-color);
  color: #000;
  font-size: 2rem;
  width: 48px;
  height: 48px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease;
}

.close-menu:active {
  transform: scale(0.9);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 32px;
  text-align: center;
}

.mobile-link {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    color var(--transition-fast);
}

.mobile-menu.active .mobile-link {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu.active .mobile-link:nth-child(1) {
  transition-delay: 0.2s;
}
.mobile-menu.active .mobile-link:nth-child(2) {
  transition-delay: 0.3s;
}
.mobile-menu.active .mobile-link:nth-child(3) {
  transition-delay: 0.4s;
}

.mobile-link:hover {
  color: var(--accent-primary);
}

.mobile-link:active {
  color: var(--accent-secondary);
  transform: translateX(15px);
  transition: transform 0.1s ease, color 0.1s ease;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

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

.modal-content {
  background-color: var(--card-bg);
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 800px;
  height: 80vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background-color: var(--accent-primary);
  border-bottom: var(--border-width) solid var(--border-color);
  color: #000;
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
  font-size: 1.5rem;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 2rem;
  font-weight: 700;
  cursor: pointer;
  color: #000;
  line-height: 1;
}

.modal-body {
  flex-grow: 1;
  padding: 0;
  background: #fff;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .hamburger {
    display: flex;
  }
  .hero-section {
    padding: 64px 24px 48px 24px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-actions {
    flex-direction: column;
  }
  .btn {
    width: 100%;
  }
  .footer-container {
    flex-direction: column;
    text-align: center;
  }
  .profile-card {
    padding: 32px 24px;
    max-width: 320px;
  }

  /* Mobile 'See More' logic */
  .grid-container:not(.expanded) > .card:nth-child(n + 4) {
    display: none;
  }
  .see-more-container {
    display: flex;
    justify-content: center;
    margin-top: 48px;
  }
}

/* --- System Boot Loader --- */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-color);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.6s cubic-bezier(0.85, 0, 0.15, 1), opacity 0.6s ease;
}

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

.loader-box {
  border: 4px solid var(--border-color);
  background-color: var(--card-bg);
  box-shadow: 12px 12px 0px var(--border-color);
  padding: 40px;
  text-align: center;
  width: 90%;
  max-width: 400px;
}

.loader-box h2 {
  font-size: 2rem;
  color: var(--text-main);
  margin-bottom: 24px;
}

.loader-bar {
  width: 100%;
  height: 24px;
  background-color: var(--bg-color);
  border: 2px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.loader-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background-color: var(--accent-primary);
  border-right: 2px solid var(--border-color);
  animation: boot-load 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes boot-load {
  0% { width: 0%; }
  30% { width: 25%; }
  60% { width: 60%; }
  80% { width: 75%; }
  100% { width: 100%; }
}
