:root {
  --bg: #08080c;
  --surface: rgba(255, 255, 255, 0.05);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #a78bfa;
  --accent-warm: #fb7185;
  --radius: 18px;
  --font-body: "Outfit", system-ui, sans-serif;
  --font-display: "Syne", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* ── Background ── */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

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

.orb--1 {
  width: min(85vw, 480px);
  height: min(85vw, 480px);
  top: -20%;
  left: -15%;
  background: #6366f1;
  animation: float-a 20s ease-in-out infinite alternate;
}

.orb--2 {
  width: min(70vw, 400px);
  height: min(70vw, 400px);
  bottom: -25%;
  right: -20%;
  background: #0ea5e9;
  animation: float-b 24s ease-in-out infinite alternate;
}

.orb--3 {
  width: min(55vw, 280px);
  height: min(55vw, 280px);
  top: 35%;
  left: 55%;
  background: #ec4899;
  opacity: 0.22;
  animation: float-c 18s ease-in-out infinite alternate;
}

@keyframes float-a {
  to { transform: translate(6%, 8%) scale(1.05); }
}

@keyframes float-b {
  to { transform: translate(-8%, -6%) scale(1.08); }
}

@keyframes float-c {
  to { transform: translate(-12%, 10%) scale(0.95); }
}

.grid-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}

.noise {
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cursor-glow {
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

body.is-ready .cursor-glow {
  opacity: 1;
}

/* ── Layout ── */
.page {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  min-height: 100dvh;
  padding: 28px 16px 40px;
}

.card {
  width: 100%;
  max-width: 440px;
  padding: 28px 22px 24px;
  background: rgba(15, 15, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Sin JS o reduced motion: visible de inmediato */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 0.06s);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Hero ── */
.hero {
  text-align: center;
  margin-bottom: 28px;
}

.avatar-stage {
  position: relative;
  width: 124px;
  height: 124px;
  margin: 0 auto 20px;
}

.avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-warm), var(--accent));
  background-size: 300% 300%;
  animation: ring-shift 6s ease infinite;
  z-index: 0;
}

@keyframes ring-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.avatar-wrap {
  position: absolute;
  inset: 3px;
  z-index: 1;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(145deg, #334155, #1e293b);
}

.avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
}

.avatar-fallback:not([hidden]) {
  display: flex;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.experience {
  margin: 0 0 14px;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  opacity: 0.85;
}

.name {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 9vw, 3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.name-line {
  display: block;
}

.name-line--accent {
  background: linear-gradient(90deg, #38bdf8, #a78bfa, #fb7185);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: text-shine 8s linear infinite;
}

@keyframes text-shine {
  to { background-position: 200% center; }
}

.role {
  margin: 0 0 18px;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.bio {
  position: relative;
  margin: 0 0 18px;
  padding: 14px 16px 14px 18px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #cbd5e1;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.bio-mark {
  display: none;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li span {
  display: block;
  padding: 5px 12px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
}

/* ── Sections ── */
.block {
  margin-bottom: 22px;
}

.section-label {
  margin: 0 0 12px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-line {
  display: none;
}

/* ── Links ── */
.links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.links--social {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  overflow: hidden;
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    transform 0.25s var(--ease-out),
    box-shadow 0.25s ease;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  transform: perspective(600px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
}

.link-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 42%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 58%
  );
  transform: translateX(-130%);
  transition: transform 0.55s var(--ease-out);
  pointer-events: none;
}

.link:hover .link-shine,
.link:focus-visible .link-shine {
  transform: translateX(130%);
}

.link-glow {
  display: none;
}

.link:hover,
.link:focus-visible {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  outline: none;
}

.link--featured {
  border-color: rgba(56, 189, 248, 0.28);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(167, 139, 250, 0.08));
}

.link--compact {
  padding: 13px 10px;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  text-align: center;
}

.link-icon {
  flex-shrink: 0;
  font-size: 1.2rem;
  line-height: 1;
}

.link-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.link--compact .link-text {
  align-items: center;
}

.link-text strong {
  font-weight: 600;
  font-size: 0.9rem;
}

.link-text small {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.link-arrow {
  font-size: 1rem;
  color: var(--accent);
  opacity: 0.55;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.link:hover .link-arrow {
  opacity: 1;
  transform: translateX(2px);
}

/* ── Footer ── */
.footer {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.philosophy-track {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  margin-bottom: 12px;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.philosophy-track .dot {
  display: none;
}

/* Ocultar duplicados del marquee antiguo */
.philosophy-track span:nth-child(n + 4) {
  display: none;
}

.email-link {
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
}

.email-link:hover {
  text-decoration: underline;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .cursor-glow {
    display: none;
  }

  .link {
    transform: none !important;
  }
}

@media (min-width: 640px) {
  .card {
    padding: 32px 28px 28px;
  }

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

@media (hover: none) {
  .cursor-glow {
    display: none;
  }
}

/* Fallback sin JS */
noscript .reveal {
  opacity: 1;
  transform: none;
}
