/* ============================================
   LEONEL R.S. — Portfolio Design System
   Dark, Minimalistic, Corporate, Programmer
   ============================================ */

/* --- Custom Properties --- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161e;
  --bg-card-hover: #1c1c28;
  --bg-nav: rgba(10, 10, 15, 0.85);
  --bg-input: #1a1a24;

  --text-primary: #e4e4e7;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-heading: #f4f4f5;

  --accent: #00ff88;
  --accent-dim: rgba(0, 255, 136, 0.15);
  --accent-hover: #00cc6a;
  --accent-cyan: #22d3ee;
  --accent-blue: #3b82f6;

  --border: #1e1e2a;
  --border-light: #2a2a3a;

  --radius: 8px;
  --radius-lg: 12px;

  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 8px 40px rgba(0, 255, 136, 0.08);

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --max-width: 1120px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

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

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

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

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-mono);
  color: var(--text-heading);
  line-height: 1.3;
}

/* --- Scroll Progress Bar --- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-cyan));
  z-index: 9999;
  width: 0%;
  transition: width 0.05s linear;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: -0.02em;
  position: relative;
  z-index: 2;
}

.nav-logo img {
  height: 32px;
  width: 32px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}

.nav-logo .accent {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  color: var(--text-secondary);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  letter-spacing: 0.02em;
  position: relative;
  display: inline-block;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.nav-links a.active:not(.nav-cta)::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-cta {
  font-family: var(--font-mono) !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  padding: 0.5rem 1.25rem !important;
  background: var(--accent) !important;
  color: var(--bg-primary) !important;
  border-radius: var(--radius) !important;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s !important;
}

.nav-cta:hover {
  background: var(--accent-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 255, 136, 0.3);
}

.nav-cta.active {
  background: var(--accent-hover) !important;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.nav-cta.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: #000;
  border-radius: 1px;
}

/* Mobile nav */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-nav);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 1.5rem;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
}

/* --- Layout --- */
.main {
  flex: 1;
  padding-top: 64px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-header {
  margin-bottom: 3rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-label::before {
  content: '>';
  opacity: 0.5;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
  color: var(--text-heading);
}

/* Cyberpunk Glitch on Hover */
.section-title::before,
.section-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.section-title:hover {
  animation: glitch-skew 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
  color: var(--bg-primary);
  /* Hide original text visually to emphasize glitch */
  text-shadow: 2px 0 var(--accent-cyan), -2px 0 var(--accent);
}

.section-title:hover::before {
  opacity: 1;
  color: var(--text-heading);
  z-index: -1;
  animation: glitch-anim-1 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite reverse;
}

.section-title:hover::after {
  opacity: 1;
  color: var(--text-heading);
  z-index: -2;
  animation: glitch-anim-2 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

@keyframes glitch-anim-1 {
  0% {
    clip-path: polygon(0 2%, 100% 2%, 100% 5%, 0 5%);
    transform: translate(-2px, 1px);
  }

  20% {
    clip-path: polygon(0 15%, 100% 15%, 100% 15%, 0 15%);
    transform: translate(2px, -1px);
  }

  40% {
    clip-path: polygon(0 10%, 100% 10%, 100% 20%, 0 20%);
    transform: translate(-2px, 2px);
  }

  60% {
    clip-path: polygon(0 1%, 100% 1%, 100% 2%, 0 2%);
    transform: translate(2px, -1px);
  }

  80% {
    clip-path: polygon(0 33%, 100% 33%, 100% 33%, 0 33%);
    transform: translate(-1px, 1px);
  }

  100% {
    clip-path: polygon(0 44%, 100% 44%, 100% 44%, 0 44%);
    transform: translate(2px, -2px);
  }
}

@keyframes glitch-anim-2 {
  0% {
    clip-path: polygon(0 25%, 100% 25%, 100% 30%, 0 30%);
    transform: translate(2px, -1px);
  }

  20% {
    clip-path: polygon(0 3%, 100% 3%, 100% 3%, 0 3%);
    transform: translate(-2px, 1px);
  }

  40% {
    clip-path: polygon(0 5%, 100% 5%, 100% 20%, 0 20%);
    transform: translate(2px, -2px);
  }

  60% {
    clip-path: polygon(0 20%, 100% 20%, 100% 20%, 0 20%);
    transform: translate(-2px, 1px);
  }

  80% {
    clip-path: polygon(0 40%, 100% 40%, 100% 40%, 0 40%);
    transform: translate(1px, -1px);
  }

  100% {
    clip-path: polygon(0 50%, 100% 50%, 100% 50%, 0 50%);
    transform: translate(-2px, 2px);
  }
}

@keyframes glitch-skew {
  0% {
    transform: skew(0deg);
  }

  20% {
    transform: skew(-5deg);
  }

  40% {
    transform: skew(5deg);
  }

  60% {
    transform: skew(-2deg);
  }

  80% {
    transform: skew(2deg);
  }

  100% {
    transform: skew(0deg);
  }
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* --- Hero --- */
.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-greeting::before {
  content: '>';
  opacity: 0.6;
}

.hero-name {
  font-size: 3.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text-heading) 60%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hero-typed-wrap {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent-cyan);
  margin-bottom: 1.5rem;
  min-height: 3.8rem;
  /* Anticipate 2 lines to prevent layout shift */
}

.hero-typed-wrap .typed-cursor {
  color: var(--accent);
}

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

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  animation: float-hero 6s ease-in-out infinite;
  /* Prevent pointer events on the wrapper so corners don't trigger anything */
  pointer-events: none;
}

@keyframes float-hero {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

.hero-image img {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 4px solid var(--border-light);
  object-fit: cover;
  position: relative;
  z-index: 2;
  filter: grayscale(35%) contrast(1.1);
  transition: filter 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
  /* Specifically restore pointer events directly to the circular image so ONLY the image triggers hovers */
  pointer-events: auto;
}

.hero-image img:hover {
  filter: grayscale(0%) contrast(1.1);
  border-color: var(--accent);
  box-shadow: 0 0 35px rgba(0, 255, 136, 0.4);
}

.hero-image-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  /* Matched strictly to the image size */
  border-radius: 50%;
  background-color: rgba(0, 255, 136, 0.05);
  z-index: 1;
  animation: pulse-glow 4s ease-in-out infinite;
  transition: opacity 0.5s ease, background-color 0.5s ease, background 0.5s ease;
  pointer-events: none;
  /* Ignore all interactions for the glow layer */
}

/* Use modern :has selector so the wrapper listens to its child 'img' being hovered to affect the sibling 'glow' */
.hero-image:has(img:hover) .hero-image-glow {
  background: radial-gradient(circle, rgba(0, 255, 136, 0.4) 0%, transparent 80%);
  animation: none;
  /* Pause the breathing effect on hover so the solid glow takes over */
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.1),
      0 0 30px rgba(0, 255, 136, 0.05);
    background-color: rgba(0, 255, 136, 0.05);
  }

  50% {
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3),
      0 0 60px rgba(0, 255, 136, 0.15);
    background-color: rgba(0, 255, 136, 0.15);
    /* Soft, expanding neon light spill */
  }
}

/* Hero stats bar */
.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .hero-image {
    order: -1;
    margin-top: 2.5rem;
  }

  .hero-image img {
    width: 200px;
    height: 200px;
  }

  .hero-image-glow {
    width: 220px;
    height: 220px;
  }

  .hero-name {
    font-size: 2.2rem;
  }

  .hero-greeting {
    justify-content: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-decoration: none;
  background-clip: padding-box, border-box;
  background-origin: padding-box, border-box;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  background-image: linear-gradient(var(--bg-card), var(--bg-card)), linear-gradient(135deg, var(--accent), var(--accent-cyan));
  color: var(--accent);
  box-shadow: 0 4px 15px rgba(0, 255, 136, 0.1);
}

.btn-primary:hover {
  background-image: linear-gradient(var(--accent-hover), var(--accent-hover)), linear-gradient(135deg, var(--accent), var(--accent-cyan));
  color: var(--bg-primary);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 25px rgba(0, 255, 136, 0.35);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background-color: rgba(0, 255, 136, 0.1);
  color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 5px 20px rgba(0, 255, 136, 0.15);
}

.btn-dark {
  background-image: linear-gradient(rgba(20, 20, 30, 0.8), rgba(20, 20, 30, 0.8)), linear-gradient(135deg, var(--border-light), var(--border));
  color: var(--text-primary);
  backdrop-filter: blur(8px);
}

.btn-dark:hover {
  background-image: linear-gradient(rgba(30, 30, 45, 0.95), rgba(30, 30, 45, 0.95)), linear-gradient(135deg, var(--accent-cyan), var(--accent));
  color: var(--accent-cyan);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(34, 211, 238, 0.2);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
}

/* --- Cards --- */
.card {
  background: rgba(22, 22, 30, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.05), transparent);
  transform: skewX(-25deg);
  transition: left 0.7s ease;
  z-index: 1;
}

.card:hover::before {
  left: 200%;
}

.card:hover {
  border-color: rgba(0, 255, 136, 0.4);
  background: rgba(28, 28, 40, 0.85);
  box-shadow: 0 15px 40px rgba(0, 255, 136, 0.12), inset 0 0 20px rgba(0, 255, 136, 0.05);
  transform: translateY(-8px) scale(1.02);
}

.card.card-static:hover {
  background: rgba(22, 22, 30, 0.65);
}

.card-title,
.card-text {
  position: relative;
  z-index: 2;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.card-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* --- Info Grid (Personal Info) --- */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.info-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  white-space: nowrap;
}

.info-label::after {
  content: ':';
}

.info-value {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.info-value a {
  color: var(--accent-cyan);
  transition: color 0.3s;
}

.info-value a:hover {
  color: var(--accent);
  text-decoration: underline;
}

@media (max-width: 600px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 4rem;
  /* Restored proportional spacing */
  padding-left: 1.5rem;
}

.timeline-trigger {
  opacity: 1;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.35rem;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 3px solid var(--bg-primary);
  z-index: 1;
  transition: background 0.5s ease-in-out;
}

.timeline-trigger.active-timeline::before {
  background: var(--accent);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  transition: color 0.5s ease-in-out;
}

.timeline-trigger.active-timeline .timeline-date {
  color: var(--accent);
}

.timeline-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.timeline-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.timeline-body {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.timeline-body li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.35rem;
}

.timeline-body li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-muted);
  transition: color 0.5s ease-in-out;
}

.timeline-trigger.active-timeline .timeline-body li::before {
  color: var(--accent);
}

/* Base transition for inline-styled accent elements in timeline (must apply in both states) */
.timeline-trigger [style*="color: var(--accent)"] {
  transition: color 0.5s ease-in-out;
}

/* Neutralize when not active */
.timeline-trigger:not(.active-timeline) [style*="color: var(--accent)"] {
  color: var(--text-muted) !important;
}

/* Restore accent color when active */
.timeline-trigger.active-timeline [style*="color: var(--accent)"] {
  color: var(--accent) !important;
}

/* --- Journey Timeline Pinned Gallery Layout --- */
.journey-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.journey-image-container {
  position: sticky;
  top: 15vh;
  height: 60vh;
  width: 100%;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.journey-image-container::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150%;
  height: 150%;
  background: radial-gradient(circle closest-side, rgba(0, 255, 136, 0.15) 0%, transparent 100%);
  z-index: -1;
  pointer-events: none;
}

.journey-dynamic-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

/* --- Grid Layouts --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 768px) {

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .journey-wrapper {
    display: grid;
    grid-template-columns: 1fr;
  }

  .timeline {
    grid-column: 1;
    grid-row: 1;
    z-index: 2;
    padding-top: 35vh;
    /* Push the text down on mobile, matching the new GSAP pin height */
    /* Push the text way down on mobile */
    padding-bottom: 20vh;
  }

  /* Dark gradient scrim behind each text block so it stays readable against the image */
  .timeline-trigger {
    position: relative;
    border-radius: 12px;
    padding: 1rem 1rem 1rem 1rem;
    background: linear-gradient(135deg,
        rgba(10, 10, 18, 0.88) 0%,
        rgba(10, 10, 18, 0.70) 100%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  .journey-image-container {
    display: flex;
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 10vh;
    /* Pin the image higher up near the navbar */
    height: 35vh;
    /* Make the image box slightly shorter */
    z-index: 1;
    opacity: 0.85;
    /* Increase visibility since text isn't directly on top anymore */
    pointer-events: none;
  }

  /* Prevent the 150% radial gradient from causing horizontal stretch on mobile */
  .journey-image-container::before {
    width: 100%;
    height: 100%;
  }
}

/* --- Skills --- */
.skills-group {
  margin-bottom: 1.5rem;
}

.skills-group-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(0, 255, 136, 0.15);
  border-radius: 4px;
  transition: background-color 0.3s, border-color 0.3s;
  /* No transform/scale transition initially */
}

.skill-tag:hover {
  background: rgba(0, 255, 136, 0.25);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* --- Tags / Chips --- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.03);
  letter-spacing: 0.03em;
  transition: all 0.3s ease;
}

.tag-blue {
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
}

.tag-blue:hover {
  background: rgba(59, 130, 246, 0.2);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.tag-green {
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.tag-green:hover {
  background: rgba(16, 185, 129, 0.2);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
}

.tag-amber {
  background: rgba(245, 158, 11, 0.1);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.tag-amber:hover {
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
}

.tag-purple {
  background: rgba(139, 92, 246, 0.1);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.tag-purple:hover {
  background: rgba(139, 92, 246, 0.2);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
  transform: translateY(-2px);
}

.tag-cyan {
  background: rgba(34, 211, 238, 0.1);
  color: #67e8f9;
  border: 1px solid rgba(34, 211, 238, 0.4);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.15);
}

.tag-cyan:hover {
  background: rgba(34, 211, 238, 0.2);
  box-shadow: 0 4px 15px rgba(34, 211, 238, 0.4);
  transform: translateY(-2px);
}

/* --- Project Cards (Background Hover Redesign) --- */
.project-card {
  background: rgba(22, 22, 30, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.8s ease 0.25s, box-shadow 0.8s ease 0.25s, background 0.8s ease 0.25s;
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
  position: relative;
  display: block;
}

.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  pointer-events: none;
  border: 2px solid transparent;
  transition: border-color 0.8s ease 0.25s;
  z-index: 20;
}

.project-card:hover::after {
  border-color: rgba(0, 255, 136, 0.3);
}

.project-card:hover {
  border-color: rgba(0, 255, 136, 0.4);
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 25px 50px rgba(0, 255, 136, 0.15), inset 0 0 0 1px rgba(0, 255, 136, 0.1);
}

/* Make the slider container fill the card as a background */
.project-card .custom-cursor-target.slider-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
}

.project-card .slider-image {
  object-fit: contain;
}

/* Card overlay for text and details */
.project-card-body {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 3rem 2.5rem;
  background: linear-gradient(to top, rgba(10, 10, 15, 0.95) 0%, rgba(10, 10, 15, 0.6) 50%, transparent 100%);
  opacity: 0;
  pointer-events: none;
  /* Let clicks pass through the gradient to slider buttons below */
  transition: opacity 0.8s ease 0.25s;
}

.project-card:hover .project-card-body {
  opacity: 1;
}

/* Internal content structure for slide-up animation */
.project-card-content-inner {
  pointer-events: none;
  /* Disable clicks on the text block itself so it passes through to image clicks */
  transform: translateY(20px);
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.25s;
}

.project-card .project-card-links a {
  pointer-events: none;
  /* Only clickable when overlay is active */
}

.project-card:hover .project-card-content-inner {
  transform: translateY(0);
}

.project-card .tag {
  pointer-events: none;
}

.project-card:hover .tag {
  pointer-events: auto;
}

.project-card:hover .project-card-links a {
  pointer-events: auto;
}

/* --- GSAP Pinned Carousel Specifics --- */
.gsap-pinned-carousel {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 4rem;
  overflow: hidden;
  position: relative;
}

.gsap-logo-track {
  display: flex;
  gap: 3rem;
  padding: 0 calc(50vw - min(40vw, 500px));
  width: max-content;
  align-items: center;
}

.logo-item {
  height: 48px;
  width: auto;
  opacity: 0.5;
  filter: grayscale(100%);
  transition: opacity 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo-item:hover {
  opacity: 1;
  filter: grayscale(0%);
  transform: scale(1.15);
}

.gsap-carousel-track {
  display: flex;
  gap: 3rem;
  padding: 0 calc(50vw - min(40vw, 500px));
  width: max-content;
  align-items: center;
}

.gsap-carousel-card {
  width: 80vw;
  max-width: 1000px;
  height: 60vh;
  min-height: 400px;
  flex-shrink: 0;
}

/* Internal Image Slider */
.slider-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.slider-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.slider-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(10, 10, 15, 0.4);
  flex-shrink: 0;
}

.slider-nav {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 30;
}

.slider-dot {
  width: 24px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  cursor: none;
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.slider-dot.active {
  background: var(--accent);
  width: 36px;
}

/* Navigation Click Zones for Hover Text Cursors */
.slider-click-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 25%;
  z-index: 10;
  cursor: none;
  /* Hide default, show custom */
}

.slider-click-zone.left {
  left: 0;
}

.slider-click-zone.right {
  right: 0;
}

/* --- Giant Asymmetrical Projects (project.html) --- */
.giant-project {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  min-height: 80vh;
  margin-bottom: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.giant-project-bg {
  position: absolute;
  top: -20%;
  /* Extra height for parallax */
  left: 0;
  width: 100%;
  height: 140%;
  background-size: cover;
  background-position: center;
  z-index: 0;
  opacity: 0.15;
  filter: blur(8px);
}

.giant-project-content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1400px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
}

.giant-project:nth-child(even) .giant-project-content {
  flex-direction: row-reverse;
}

.giant-project-slider-wrapper {
  flex: 1.2;
  height: 60vh;
  min-height: 400px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  background: rgba(15, 15, 20, 0.4);
}

.giant-project-text {
  flex: 1;
  background: rgba(15, 15, 20, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  padding: 3rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.giant-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 40%, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.project-card-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.project-card:hover .project-card-image {
  transform: scale(1.06);
}

/* Apply a glowing overlay on the image matching the brand */
.project-card .slider-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(22, 22, 30, 0.8) 0%, transparent 50%);
  pointer-events: none;
  z-index: 5;
}

.project-card-body {
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: center;
}

.project-card-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.project-card-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
  flex-grow: 1;
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.project-card-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: auto;
}

/* --- Contact Form --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  cursor: none;
}

.form-label .required {
  color: #ef4444;
  margin-left: 0.25rem;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-submit {
  width: 100%;
  padding: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.form-submit:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3);
}

.form-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-message {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  display: none;
}

.form-message.success {
  display: block;
  background: rgba(0, 255, 136, 0.1);
  color: var(--accent);
  border: 1px solid rgba(0, 255, 136, 0.2);
}

.form-message.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* --- Contact Info --- */
.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-info-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: var(--radius);
  font-size: 1rem;
  flex-shrink: 0;
}

.contact-info-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.contact-info-value {
  color: var(--text-primary);
  font-size: 0.95rem;
}

/* Social links row */
.social-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 1rem;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.3s;
}

.social-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-2px);
}

/* --- Interest Tags --- */
.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.interest-tag {
  font-size: 0.85rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  transition: border-color 0.3s, color 0.3s;
}

.interest-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Footer --- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-copy a {
  color: var(--accent);
  transition: var(--transition);
}

.footer-copy a:hover {
  text-decoration: underline;
}

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

.footer-nav a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: var(--transition);
}

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

.footer-socials {
  display: flex;
  gap: 0.5rem;
}

.footer-social {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: var(--transition);
  font-size: 0.9rem;
}

.footer-social:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

@media (max-width: 768px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-nav {
    order: -1;
  }

  /* --- Responsive Giant Projects --- */
  .giant-project-content {
    flex-direction: column;
    gap: 2rem;
    padding: 2rem 1rem;
  }

  .giant-project:nth-child(even) .giant-project-content {
    flex-direction: column;
  }

  .giant-project-slider-wrapper {
    width: 100%;
    height: 45vh;
    min-height: 300px;
    border-radius: var(--radius);
  }

  .giant-project-text {
    width: 100%;
    padding: 2rem;
  }

  /* Vertically center images in the slider on mobile */
  .giant-project .slider-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
  }

  .giant-project .slider-track {
    height: auto;
    flex: 1;
    align-items: center;
  }

  .giant-project .slider-image {
    height: auto;
    max-height: 45vh;
    object-fit: contain;
    background: rgba(10, 10, 15, 0.3);
  }

  .project-card .slider-image {
    object-fit: contain;
    background: transparent;
  }

  /* Make sure the click zones don't cover the slider dots area on small screens where thumbs might hit */
  .slider-click-zone {
    bottom: 3rem;
  }

  .giant-title {
    font-size: 2.5rem;
  }

  /* --- Mobile Project Dashboard Text Overlay Toggle --- */
  /* Disable sticky standard hover effects on touch */
  .project-card:hover .project-card-body {
    opacity: 0;
  }

  .project-card:hover .project-card-content-inner {
    transform: translateY(20px);
  }

  .project-card:hover .project-card-links a {
    pointer-events: none;
  }

  .project-card:hover .tag {
    pointer-events: none;
  }

  /* Use explicit JS-toggled class instead */
  .project-card.mobile-overlay-active .project-card-body {
    opacity: 1;
  }

  .project-card.mobile-overlay-active .project-card-content-inner {
    transform: translateY(0);
  }

  .project-card.mobile-overlay-active .project-card-links a {
    pointer-events: auto;
  }

  .project-card.mobile-overlay-active .tag {
    pointer-events: auto;
  }
}

/* --- Utility --- */
.hidden {
  display: none !important;
}

.text-accent {
  color: var(--accent);
}

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

.text-secondary {
  color: var(--text-secondary);
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mt-4 {
  margin-top: 2rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

.mb-4 {
  margin-bottom: 2rem;
}

.no-scroll {
  overflow: hidden !important;
  height: 100vh !important;
}

.gap-1 {
  gap: 0.5rem;
}

.gap-2 {
  gap: 1rem;
}

.flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

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

/* GSAP animation initial states */
/* GSAP animation initial states (Prevent FOUC) */
.gs-hidden,
.gs-hidden-left,
.gs-hidden-right,
.gs-hidden-scale,
.stagger-item,
.hero-image,
.hero-greeting,
.hero-name,
.hero-title,
.hero-typed-wrap,
.hero-actions .btn,
.hero-stat,
.skill-tag,
.nav,
.footer {
  opacity: 0;
  visibility: hidden;
}

/* Print styles */
@media print {

  .nav,
  .footer,
  #scroll-progress {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .card {
    border: 1px solid #ccc;
  }
}

/* Hide the default mouse cursor globally for desktop */
@media (pointer: fine) {

  body,
  a,
  button,
  .custom-cursor-target {
    cursor: none !important;
  }
}

/* Custom Cursor Dot */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease-out, opacity 0.2s ease;
  mix-blend-mode: difference;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Custom Cursor Outline */
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(0, 255, 136, 0.6);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease-out, height 0.2s ease-out, background-color 0.2s ease-out, border-color 0.2s ease-out, opacity 0.2s ease;
  /* Smooth trailing is handled in JS via lerp */
}

/* Active states (hovering over links/buttons) */
.cursor-dot.active {
  transform: translate(-50%, -50%) scale(1.5);
}

.cursor-outline.active {
  width: 60px;
  height: 60px;
  background-color: rgba(0, 255, 136, 0.15);
  border-color: var(--accent);
  backdrop-filter: invert(10%);
}

.cursor-dot.has-text {
  width: auto;
  height: auto;
  background-color: transparent;
  transform: translate(-50%, -50%) scale(1);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.5rem;
  text-transform: uppercase;
}

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

/* Custom Cursor Emoji Animation */
.wave-emoji {
  display: inline-block;
  animation: wave-animation 2.5s infinite;
  transform-origin: 70% 70%;
  /* Pivot point near the wrist of the emoji */
}

@keyframes wave-animation {
  0% {
    transform: rotate(0.0deg)
  }

  10% {
    transform: rotate(14.0deg)
  }

  20% {
    transform: rotate(-8.0deg)
  }

  30% {
    transform: rotate(14.0deg)
  }

  40% {
    transform: rotate(-4.0deg)
  }

  50% {
    transform: rotate(10.0deg)
  }

  60% {
    transform: rotate(0.0deg)
  }

  /* Pauses waving for the remaining 40% of standard interval */
  100% {
    transform: rotate(0.0deg)
  }
}

@media (max-width: 768px) {

  .cursor-dot,
  .cursor-outline,
  .cursor-spotlight {
    display: none !important;
  }

  body,
  a,
  button,
  .custom-cursor-target {
    cursor: auto !important;
  }
}

/* Inline Page Transition */
main {
  transition: opacity 0.5s ease;
  opacity: 1;
}

main.fade-out {
  opacity: 0;
}

/* Static Card style without translate for contact page */
.card-static:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--bg-card-hover);
  transform: none;
  filter: brightness(1.2);
  box-shadow: 0 10px 40px rgba(0, 255, 136, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
  .project-card {
    flex-direction: column;
  }

  .project-card .custom-cursor-target {
    margin: 1.25rem 1.25rem 0 1.25rem;
    width: auto;
  }
}

/* Terminal Splash Loader */
.terminal-splash {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #000;
  color: var(--accent);
  font-family: var(--font-mono);
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.terminal-splash.glitch-out {
  animation: splashGlitchOutFade 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.terminal-splash.glitch-out .terminal-text-container {
  animation: glitch-skew 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
  text-shadow: 3px 0 var(--accent-cyan), -3px 0 var(--accent);
  position: relative;
}

.terminal-splash.glitch-out .terminal-text-container::before,
.terminal-splash.glitch-out .terminal-text-container::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: transparent;
}

.terminal-splash.glitch-out .terminal-text {
  animation: glitch-anim-1 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite reverse;
  display: inline-block;
}

@keyframes splashGlitchOutFade {
  0% {
    opacity: 1;
    background-color: #000;
    transform: scale(1);
  }

  15% {
    opacity: 0.95;
    background-color: #000;
    transform: scale(1.01);
  }

  30% {
    opacity: 0.85;
    background-color: #0a0a0f;
    transform: scale(0.99);
  }

  50% {
    opacity: 0.6;
    background-color: #000;
    transform: scale(1.02);
  }

  70% {
    opacity: 0.3;
    background-color: #0f0505;
    transform: scale(0.98);
  }

  100% {
    opacity: 0;
    transform: scale(1.05);
    background-color: #000;
  }
}

.terminal-text-container {
  width: 80%;
  max-width: 600px;
}

.terminal-text {
  font-size: 1.2rem;
  white-space: pre-wrap;
  text-align: left;
}

.terminal-cursor {
  display: inline-block;
  width: 10px;
  height: 1.2rem;
  background-color: var(--accent);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Cursor Spotlight */
.cursor-spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 255, 136, 0.08) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 900;
  /* Just below nav */
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
  transition: transform 0.4s ease-out;
}

/* ============================================
   AI Chat Console — Terminal Theme
   ============================================ */

.ai-console {
  background: rgba(8, 8, 14, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 255, 136, 0.2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow:
    0 4px 30px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(0, 255, 136, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Scanline overlay */
.ai-console::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(0, 255, 136, 0.015) 2px,
      rgba(0, 255, 136, 0.015) 4px);
  pointer-events: none;
  z-index: 5;
}

/* --- Title bar --- */
.ai-console-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: rgba(20, 20, 28, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 6;
}

.ai-console-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.ai-console-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.ai-console-dot--red {
  background: #ff5f57;
}

.ai-console-dot--yellow {
  background: #febc2e;
}

.ai-console-dot--green {
  background: #28c840;
}

.ai-console-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  user-select: none;
}

.ai-console-clear {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s;
  flex-shrink: 0;
}

.ai-console-clear:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

/* --- Message body --- */
.ai-console-body {
  padding: 1.25rem 1.25rem 0.5rem;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  position: relative;
  z-index: 6;
  scroll-behavior: smooth;
}

.ai-console-body::-webkit-scrollbar {
  width: 5px;
}

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

.ai-console-body::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 136, 0.2);
  border-radius: 3px;
}

.ai-console-body::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* --- Console lines --- */
.ai-console-line {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.65;
  word-break: break-word;
}

.ai-console-prompt {
  flex-shrink: 0;
  white-space: nowrap;
  margin-right: 0;
}

.ai-prompt-user {
  color: var(--accent-cyan);
  font-weight: 600;
}

.ai-prompt-at {
  color: var(--text-muted);
}

.ai-prompt-host {
  color: var(--accent);
  font-weight: 600;
}

.ai-prompt-sep {
  color: var(--text-muted);
}

.ai-prompt-ai {
  color: #c084fc;
  font-weight: 600;
}

.ai-prompt-sys {
  color: var(--accent);
  font-weight: 700;
}

.ai-console-content {
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

.ai-console-line--system .ai-console-content {
  color: var(--text-muted);
  font-style: italic;
}

/* Markdown rendering inside AI responses */
.ai-console-line--assistant .ai-console-content p {
  margin: 0 0 0.4rem;
}

.ai-console-line--assistant .ai-console-content p:last-child {
  margin-bottom: 0;
}

.ai-console-line--assistant .ai-console-content strong {
  color: var(--accent);
  font-weight: 600;
}

.ai-console-line--assistant .ai-console-content a {
  color: var(--accent-cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ai-console-line--assistant .ai-console-content a:hover {
  color: var(--accent);
}

.ai-console-line--assistant .ai-console-content ul,
.ai-console-line--assistant .ai-console-content ol {
  padding-left: 1.2rem;
  margin: 0.3rem 0;
}

.ai-console-line--assistant .ai-console-content li {
  list-style: disc;
  margin-bottom: 0.15rem;
}

.ai-console-line--assistant .ai-console-content code {
  background: rgba(0, 255, 136, 0.1);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.82rem;
  color: var(--accent);
}

.ai-console-line--assistant .ai-console-content pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  margin: 0.4rem 0;
  overflow-x: auto;
}

.ai-console-line--assistant .ai-console-content pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

/* --- Typing indicator --- */
.ai-console-typing-dots {
  display: inline-flex;
  gap: 3px;
}

.ai-console-typing-dots span {
  color: #c084fc;
  font-weight: 700;
  animation: ai-dots-bounce 1.4s ease-in-out infinite;
}

.ai-console-typing-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.ai-console-typing-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes ai-dots-bounce {

  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* --- Input row --- */
.ai-console-input-row {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(12, 12, 18, 0.6);
  position: relative;
  z-index: 6;
}

.ai-console-input-prefix {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  white-space: nowrap;
  margin-right: 0.4rem;
  flex-shrink: 0;
  user-select: none;
}

.ai-console-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  caret-color: var(--accent);
  padding: 0;
}

.ai-console-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.ai-console-input:disabled {
  opacity: 0.4;
}

.ai-console-send {
  background: none;
  border: 1px solid rgba(0, 255, 136, 0.2);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.ai-console-send:hover {
  background: rgba(0, 255, 136, 0.15);
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.15);
}

/* --- Blinking cursor after input --- */
.ai-console-blink {
  display: inline-block;
  width: 8px;
  height: 1rem;
  background: var(--accent);
  margin-left: 2px;
  animation: ai-cursor-blink 1s step-end infinite;
  vertical-align: text-bottom;
  flex-shrink: 0;
}

.ai-console-input:focus~.ai-console-blink {
  animation: ai-cursor-blink 0.6s step-end infinite;
}

@keyframes ai-cursor-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .ai-console-body {
    max-height: 300px;
    padding: 1rem 0.75rem 0.5rem;
  }

  .ai-console-line {
    font-size: 0.78rem;
  }

  .ai-console-input-row {
    padding: 0.65rem 0.75rem;
  }

  .ai-console-input {
    font-size: 0.78rem;
  }
}