/* ═══════════════════════════════════════════════════════
   AGUSTÍN MANRIQUE — PORTFOLIO
   Modern dark theme with glassmorphism & gradient accents
   ═══════════════════════════════════════════════════════ */

:root {
  --bg: #050505;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --text: #f5f5f5;
  --text-secondary: #a0a0a0;
  --text-muted: #666;
  --accent: #818cf8;
  --accent-2: #c084fc;
  --accent-3: #22d3ee;
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
  scroll-behavior: auto; /* Lenis handles smooth scroll */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul { list-style: none; }

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

/* ═══════════════════════════════
   NAVBAR
   ═══════════════════════════════ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.navbar.scrolled {
  padding: 12px 0;
  background: rgba(5, 5, 5, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

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

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

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

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

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(5, 5, 5, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.mobile-menu.active {
  opacity: 1;
  pointer-events: all;
}

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

.mobile-menu a {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

/* ═══════════════════════════════
   HERO
   ═══════════════════════════════ */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 120px 24px 80px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  will-change: transform;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: var(--accent);
  top: -10%;
  right: -10%;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-2);
  bottom: -15%;
  left: -10%;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: var(--accent-3);
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 32px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: #34d399;
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero-title {
  margin-bottom: 24px;
}

.hero-line {
  display: block;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.hero-name {
  display: block;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--text);
}

.hero-name .split-char {
  display: inline-block;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 50%, var(--accent-2) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.hero-description {
  font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
}

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

.btn-primary:hover {
  background: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(129, 140, 248, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--bg-card);
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.mouse {
  width: 26px;
  height: 40px;
  border: 2px solid var(--text-muted);
  border-radius: 13px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.mouse-wheel {
  width: 3px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 2px;
  animation: scroll-down 2s ease-in-out infinite;
}

@keyframes scroll-down {
  0% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(6px); opacity: 0.3; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ═══════════════════════════════
   SECTIONS BASE
   ═══════════════════════════════ */

.section {
  padding: 120px 0;
  position: relative;
}

.section-header {
  margin-bottom: 64px;
}

.section-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

/* ═══════════════════════════════
   ABOUT
   ═══════════════════════════════ */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.about-text p {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.8;
}

.about-text strong {
  color: var(--text);
  font-weight: 600;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline;
}

.stat-plus {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Code Window */
.code-window {
  background: rgba(15, 15, 20, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

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

.window-dot.red { background: #ff5f57; }
.window-dot.yellow { background: #ffbd2e; }
.window-dot.green { background: #28c840; }

.window-filename {
  margin-left: 12px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.code-content {
  padding: 20px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.9;
  overflow-x: auto;
}

.code-keyword { color: #c084fc; }
.code-var { color: #818cf8; }
.code-prop { color: #22d3ee; }
.code-string { color: #34d399; }

/* ═══════════════════════════════
   PROJECTS
   ═══════════════════════════════ */

.projects { background: var(--bg); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
}

.project-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
}

.project-image {
  position: relative;
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  overflow: hidden;
}

.project-gradient {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  transition: opacity 0.4s;
}

.project-card:hover .project-gradient {
  opacity: 0.25;
}

.grad-1 { background: linear-gradient(135deg, #818cf8, #c084fc, #f472b6); }
.grad-2 { background: linear-gradient(135deg, #22d3ee, #818cf8); }
.grad-3 { background: linear-gradient(135deg, #34d399, #22d3ee); }
.grad-4 { background: linear-gradient(135deg, #f97316, #ef4444); }
.grad-5 { background: linear-gradient(135deg, #eab308, #f97316); }

.project-icon {
  position: relative;
  z-index: 1;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.project-card:hover .project-icon {
  color: var(--text);
}

.project-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 1;
}

.project-badge.live {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.project-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.project-role {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.project-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.project-tags span {
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  font-family: var(--mono);
}

.project-links {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.3s;
}

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

/* ═══════════════════════════════
   SKILLS
   ═══════════════════════════════ */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.skill-group:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
}

.skill-group-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 24px;
}

.skill-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.skill-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.skill-group:hover .skill-name {
  color: var(--text);
}

/* ═══════════════════════════════
   CONTACT
   ═══════════════════════════════ */

.contact {
  padding-bottom: 80px;
}

.contact-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.available-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(52, 211, 153, 0.06);
  border: 1px solid rgba(52, 211, 153, 0.15);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #34d399;
  margin-top: 20px;
}

.contact-text {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 48px;
  line-height: 1.7;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 420px;
  margin: 0 auto;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-secondary);
}

.contact-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  color: var(--text);
}

.contact-card div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.contact-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.contact-value {
  font-size: 0.9375rem;
  font-weight: 500;
}

.whatsapp-card:hover {
  border-color: rgba(37, 211, 102, 0.3);
  background: rgba(37, 211, 102, 0.06);
}

.whatsapp-card svg {
  color: #25d366;
}

/* ═══════════════════════════════
   FOOTER
   ═══════════════════════════════ */

.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

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

/* ═══════════════════════════════
   REVEAL ANIMATION (GSAP-driven)
   ═══════════════════════════════ */

.reveal {
  opacity: 0;
  transform: translateY(40px);
}

/* ═══════════════════════════════
   SPLIT TEXT (ReactBits-style)
   ═══════════════════════════════ */

.split-char {
  display: inline-block;
  will-change: transform, opacity;
}

/* ═══════════════════════════════
   SPOTLIGHT CURSOR (ReactBits-style)
   ═══════════════════════════════ */

.spotlight-cursor {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
}

/* ═══════════════════════════════
   CARD SPOTLIGHT GLOW
   ═══════════════════════════════ */

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(129, 140, 248, 0.08),
    transparent 40%
  );
  z-index: 0;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.project-card {
  position: relative;
}

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

.skill-group::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: radial-gradient(
    400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(129, 140, 248, 0.06),
    transparent 40%
  );
  z-index: 0;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.skill-group {
  position: relative;
}

.skill-group:hover::before {
  opacity: 1;
}

/* ═══════════════════════════════
   MARQUEE TICKER (ReactBits-style)
   ═══════════════════════════════ */

.marquee {
  overflow: hidden;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.01);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 0;
  width: max-content;
  will-change: transform;
}

.marquee-item {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: rgba(255, 255, 255, 0.07);
  white-space: nowrap;
  padding: 0 16px;
  transition: color 0.3s;
}

.marquee-item:hover {
  color: var(--accent);
}

.marquee-separator {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.04);
  padding: 0 8px;
}

/* ═══════════════════════════════
   RESPONSIVE
   ═══════════════════════════════ */

@media (max-width: 1024px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .mobile-menu { display: flex; }

  .hero { padding: 100px 24px 60px; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-stats {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .project-card.featured {
    grid-column: 1;
    grid-template-columns: 1fr;
  }

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

  .section {
    padding: 80px 0;
  }
}

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

  .about-stats {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stat {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

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