/* ==========================================================================
   Manuel Angeles — Portfolio · Premium Style
   Dark mode · Glassmorphism · Smooth animations
   ========================================================================== */

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

:root {
  --bg-0: #050810;
  --bg-1: #0a0e1a;
  --bg-card: rgba(15, 20, 35, 0.55);
  --bg-card-solid: #0f1523;
  --border-card: rgba(120, 130, 200, 0.18);
  --border-glow: rgba(99, 102, 241, 0.4);

  --text-0: #f4f6ff;
  --text-1: #cbd0e6;
  --text-2: #8a92ad;
  --text-3: #565d7a;

  --accent: #6366f1;
  --accent-2: #22d3ee;
  --accent-3: #a855f7;
  --accent-soft: rgba(99, 102, 241, 0.15);
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #22d3ee 50%, #a855f7 100%);
  --accent-grad-soft: linear-gradient(135deg, rgba(99,102,241,0.18) 0%, rgba(34,211,238,0.18) 50%, rgba(168,85,247,0.18) 100%);

  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;

  --shadow-sm: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-md: 0 10px 40px rgba(0,0,0,0.55);
  --shadow-lg: 0 25px 70px rgba(0,0,0,0.7);
  --shadow-glow: 0 0 40px rgba(99,102,241,0.25);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --container: 1180px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  background: var(--bg-0);
  color: var(--text-1);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Animated background ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(99,102,241,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 80%);
}
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.bg-orbs::before, .bg-orbs::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}
.bg-orbs::before {
  width: 600px; height: 600px;
  background: #6366f1;
  top: -200px; left: -100px;
}
.bg-orbs::after {
  width: 500px; height: 500px;
  background: #22d3ee;
  top: 40%; right: -150px;
  animation-delay: -10s;
  opacity: 0.3;
}
.bg-orbs .orb-3 {
  position: absolute;
  width: 400px; height: 400px;
  background: #a855f7;
  bottom: -100px; left: 30%;
  filter: blur(120px);
  opacity: 0.3;
  border-radius: 50%;
  animation: float 25s ease-in-out infinite;
  animation-delay: -15s;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(80px, -50px); }
  66% { transform: translate(-60px, 60px); }
}

/* ---------- Container ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(5, 8, 16, 0.6);
  border-bottom: 1px solid var(--border-card);
  transition: padding 0.3s ease, background 0.3s ease;
}
.nav.scrolled {
  padding: 10px 0;
  background: rgba(5, 8, 16, 0.85);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-0);
  text-decoration: none;
}
.nav-logo-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -1px;
  box-shadow: var(--shadow-glow);
}
.nav-logo:hover .nav-logo-mark { transform: rotate(-6deg); transition: transform 0.4s ease; }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  color: var(--text-2);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.nav-links a:hover { color: var(--text-0); background: rgba(255,255,255,0.06); }
.nav-cta {
  background: var(--accent-grad) !important;
  color: white !important;
  padding: 9px 16px !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 20px rgba(99,102,241,0.4);
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 25px rgba(99,102,241,0.55) !important; }
.nav-toggle {
  display: none;
  background: rgba(255,255,255,0.06);
  border: none;
  color: var(--text-0);
  width: 40px; height: 40px;
  border-radius: 10px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(5,8,16,0.97); backdrop-filter: blur(20px); flex-direction: column;
    padding: 16px 24px; gap: 4px; border-bottom: 1px solid var(--border-card); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding: 120px 0 80px;
}
.hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 60px; align-items: center; width: 100%; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 24px;
}
.hero-eyebrow .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 0 rgba(16,185,129,0.4);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.6); }
  100% { box-shadow: 0 0 0 12px rgba(16,185,129,0); }
}
.hero h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text-0);
  margin-bottom: 20px;
}
.hero h1 .gradient {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}
.hero h1 .typed-cursor {
  display: inline-block;
  width: 3px; height: 0.95em;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: text-top;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-tagline {
  font-size: 18px;
  color: var(--text-1);
  line-height: 1.7;
  max-width: 580px;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 36px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.btn-primary {
  background: var(--accent-grad);
  color: white;
  box-shadow: 0 8px 30px rgba(99,102,241,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 35px rgba(99,102,241,0.5); }
.btn-secondary {
  background: rgba(255,255,255,0.04);
  color: var(--text-0);
  border-color: var(--border-card);
}
.btn-secondary:hover { background: rgba(255,255,255,0.08); border-color: rgba(120,130,200,0.35); }

.hero-meta {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  padding-top: 28px;
  border-top: 1px solid var(--border-card);
}
.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  font-size: 14px;
}
.hero-meta-item svg { width: 18px; height: 18px; color: var(--accent); }

/* Hero visual */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.hero-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-card);
  margin-bottom: 18px;
}
.hero-card-avatar {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; font-size: 18px;
}
.hero-card-info { flex: 1; }
.hero-card-info .name { font-weight: 700; color: var(--text-0); font-size: 15px; }
.hero-card-info .role { color: var(--text-2); font-size: 13px; }
.hero-card-info .status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--success); margin-top: 2px;
  background: rgba(16,185,129,0.12); padding: 2px 8px; border-radius: 100px;
}
.hero-card-info .status::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
}
.hero-card-section {
  font-size: 12px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin: 14px 0 8px;
}
.hero-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.stack-chip {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.25);
  color: #a5b4fc;
  font-family: 'JetBrains Mono', monospace;
}
.hero-metric {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 10px 0;
}
.hero-metric:not(:last-child) {
  border-bottom: 1px solid var(--border-card);
}
.hero-metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-metric-label {
  font-size: 12px;
  color: var(--text-2);
}
/* ---------- In-card protocol footer ---------- */
.hero-card-protocol {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 8px 14px;
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
}
.hero-card-protocol svg { color: #a5b4fc; }

@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { margin-top: 40px; }
}

/* ---------- Section base ---------- */
section {
  padding: 100px 0;
  position: relative;
}
.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 60px;
}
.section-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--text-0);
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  line-height: 1.1;
}
.section-subtitle {
  color: var(--text-2);
  font-size: 17px;
  max-width: 640px;
  margin: 0 auto;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
.about-text {
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--text-1);
}
.about-text p + p { margin-top: 18px; }
.about-text strong { color: var(--text-0); font-weight: 600; }
.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.stat-card {
  padding: 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}
.stat-card:hover {
  border-color: rgba(99,102,241,0.35);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(99,102,241,0.15);
}
.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 36px;
  font-weight: 700;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}
.stat-label {
  color: var(--text-2);
  font-size: 13px;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; }
}

/* ---------- Experience (timeline) ---------- */
.timeline { position: relative; padding: 20px 0; }
.timeline::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--accent) 8%, var(--accent) 92%, transparent);
  opacity: 0.4;
}
.timeline-item {
  position: relative;
  padding-left: 60px;
  margin-bottom: 32px;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-0);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.15);
}
.timeline-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: all 0.3s ease;
}
.timeline-card:hover {
  border-color: rgba(99,102,241,0.35);
  transform: translateX(4px);
  box-shadow: -4px 0 20px rgba(99,102,241,0.18);
}
.timeline-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 8px;
}
.timeline-role {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-0);
}
.timeline-company {
  font-size: 16px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
}
.timeline-period {
  font-size: 13px;
  color: var(--text-2);
  background: rgba(255,255,255,0.04);
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid var(--border-card);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}
.timeline-location {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.timeline-list {
  list-style: none;
  margin-top: 8px;
}
.timeline-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  color: var(--text-1);
  font-size: 15px;
  line-height: 1.65;
}
.timeline-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 11px;
  width: 10px; height: 2px;
  background: var(--accent);
  border-radius: 1px;
}
.timeline-list li strong { color: var(--text-0); font-weight: 600; }

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.project-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}
.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  padding: 1px;
  background: var(--accent-grad);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.project-card:hover::before { opacity: 1; }
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(99,102,241,0.2);
}
.project-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--accent-grad-soft);
  border: 1px solid rgba(99,102,241,0.3);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  margin-bottom: 18px;
  flex-shrink: 0;
}
.project-icon svg { width: 24px; height: 24px; }
.project-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 4px;
}
.project-subtitle {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 14px;
  font-family: 'JetBrains Mono', monospace;
}
.project-desc {
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.65;
  margin-bottom: 18px;
  flex: 1;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.project-tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-card);
  color: var(--text-1);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.skill-group {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all 0.3s ease;
}
.skill-group:hover {
  border-color: rgba(99,102,241,0.35);
  transform: translateY(-2px);
}
.skill-group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.skill-group-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--accent-grad-soft);
  border: 1px solid rgba(99,102,241,0.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.skill-group-icon svg { width: 18px; height: 18px; }
.skill-group-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-0);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.skill-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skill-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-1);
}
.skill-item::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  flex-shrink: 0;
}

/* ---------- Education & Certs ---------- */
.edu-cert-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.edu-card, .cert-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 24px;
}
.edu-card h3, .cert-card h3 {
  font-size: 18px;
  color: var(--text-0);
  font-weight: 700;
  margin-bottom: 6px;
}
.edu-card .degree {
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 10px;
}
.edu-card .meta, .cert-card .issuer {
  color: var(--text-2);
  font-size: 13.5px;
  margin-bottom: 14px;
}
.cert-item {
  padding: 14px 0;
  border-top: 1px solid var(--border-card);
  display: flex;
  align-items: start;
  gap: 12px;
}
.cert-item:first-child { border-top: none; padding-top: 0; }
.cert-bullet {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(16,185,129,0.12);
  color: var(--success);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.cert-bullet svg { width: 13px; height: 13px; }
.cert-name { font-weight: 600; color: var(--text-0); font-size: 14.5px; }
.cert-issuer {
  color: var(--text-2);
  font-size: 13px;
  margin-top: 2px;
}
.cert-verified {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(16,185,129,0.12);
  color: var(--success);
  font-weight: 600;
  margin-top: 6px;
}
@media (max-width: 768px) {
  .edu-cert-grid { grid-template-columns: 1fr; }
}

/* ---------- Soft skills ---------- */
.soft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 30px;
}
.soft-item {
  display: flex;
  gap: 12px;
  padding: 18px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: 12px;
}
.soft-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-grad-soft);
  border: 1px solid rgba(99,102,241,0.4);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.soft-check svg { width: 12px; height: 12px; }
.soft-item span { color: var(--text-1); font-size: 14.5px; line-height: 1.5; }

/* ---------- Languages ---------- */
.lang-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 30px;
  flex-wrap: wrap;
}
.lang-pill {
  padding: 14px 22px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.lang-flag {
  width: 28px; height: 20px;
  border-radius: 4px;
  background: linear-gradient(to bottom, #d91023 50%, #fff 50%);
  position: relative;
  overflow: hidden;
}
.lang-flag::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 35%; background: #d91023;
}
.lang-flag.es::after {
  content: ""; position: absolute; left: 30%; top: 50%;
  width: 6px; height: 6px; border-radius: 50%;
  background: #ffc400; transform: translateY(-50%);
}
.lang-flag.en {
  background: linear-gradient(to bottom, #012169 33%, #fff 33% 66%, #c8102e 66%);
}
.lang-name { font-weight: 700; color: var(--text-0); font-size: 15px; }
.lang-level { color: var(--text-2); font-size: 12.5px; }

/* ---------- Contact ---------- */
.contact {
  text-align: center;
}
.contact-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 40px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.contact-card::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle at center, rgba(99,102,241,0.12), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.contact-card h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  color: var(--text-0);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.contact-card p {
  color: var(--text-1);
  font-size: 17px;
  margin-bottom: 28px;
}
.contact-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.contact-info {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 30px;
  border-top: 1px solid var(--border-card);
}
.contact-info a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  font-family: 'JetBrains Mono', monospace;
  transition: color 0.2s ease;
}
.contact-info a:hover { color: var(--accent); }
.contact-info svg { width: 16px; height: 16px; }

/* ---------- Footer ---------- */
.footer {
  padding: 32px 0 40px;
  text-align: center;
  border-top: 1px solid var(--border-card);
  margin-top: 60px;
  font-size: 13px;
  color: var(--text-3);
}
.footer a { color: var(--accent); text-decoration: none; }
.footer-signature {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-2);
}

/* ---------- Scroll animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ---------- Back to portal (footer + floating button) ---------- */
.back-to-portal {
  display: inline-block;
  margin-bottom: 12px;
  padding: 8px 18px;
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 100px;
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.back-to-portal:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateX(-2px);
}

.floating-back-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(20, 22, 36, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.30);
  border-radius: 100px;
  color: var(--text-0);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 100;
  transition: all 0.25s ease;
}
.floating-back-btn:hover {
  background: rgba(99, 102, 241, 0.20);
  border-color: rgba(99, 102, 241, 0.55);
  transform: translateY(-2px);
}
.floating-back-btn svg { width: 16px; height: 16px; }

/* Hide floating button on screens with cursor (desktop UX) since nav already has it.
   Show on touch devices where the floating action is the most discoverable affordance. */
@media (hover: hover) and (pointer: fine) {
  .floating-back-btn { display: none; }
}

/* ---------- Mobile responsive refinements ---------- */
@media (max-width: 640px) {
  /* Hero */
  .hero { padding: 80px 0 40px; }
  .hero h1 { font-size: clamp(2rem, 8vw, 2.6rem) !important; }
  .hero-tagline { font-size: 15px !important; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-meta { flex-direction: column; gap: 12px !important; align-items: flex-start; }

  /* Hero card / visual */
  .hero-visual { margin-top: 30px; }
  .hero-card { padding: 22px; }
  .hero-card-protocol { font-size: 11.5px; padding: 7px 12px; }

  /* About stats */
  .about-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }

  /* Projects grid */
  .projects-grid { grid-template-columns: 1fr !important; gap: 18px !important; }

  /* Skills grid */
  .skills-grid { grid-template-columns: 1fr !important; }

  /* Soft skills */
  .soft-grid { grid-template-columns: 1fr !important; }

  /* Timeline */
  .timeline { padding-left: 16px !important; }

  /* Contact */
  .contact-card { padding: 32px 24px !important; }
  .contact-actions { flex-direction: column; }
  .contact-actions .btn { width: 100%; justify-content: center; }
  .contact-info { flex-direction: column; align-items: center; gap: 14px !important; }

  /* Floating back button — bigger tap target on touch */
  .floating-back-btn { bottom: 16px; left: 16px; padding: 12px 20px; font-size: 14px; }
}

@media (max-width: 380px) {
  /* Tiny phones (iPhone SE 1st gen, etc.) */
  .container { padding: 0 14px !important; }
  .hero-card-header { flex-direction: column; align-items: flex-start; }
  .hero-card-info { width: 100%; }
}

/* ---------- Cursor (desktop only) ---------- */
@media (hover: hover) and (pointer: fine) {
  body {
    cursor: none;
  }
  .cursor {
    position: fixed;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease, background 0.2s ease;
    box-shadow: 0 0 8px var(--accent);
  }
  .cursor-ring {
    position: fixed;
    width: 32px; height: 32px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform 0.25s ease, width 0.25s ease, height 0.25s ease;
    opacity: 0.5;
  }
  .cursor.hover { transform: translate(-50%, -50%) scale(2.5); background: transparent; border-color: var(--accent); }
  .cursor-ring.hover { width: 50px; height: 50px; border-width: 2px; opacity: 0.8; }
  a, button, .btn, .stack-chip, .project-card, .stat-card, .skill-group, .timeline-card, .lang-pill { cursor: none; }
}
